Initial support for writing UsdPhysics data starting with UsdPhysicsRigidbodyAPI support.

The SDF_FORMAT_ARGS `usdMjcfToggleUsdPhysics` is introduced to toggle writing UsdPhysics or not when converting. Off by default

PiperOrigin-RevId: 746467942
Change-Id: I26cb9a4c4ae2eef96163dab967a74f14940a2a6d
This commit is contained in:
Google DeepMind
2025-04-11 08:18:11 -07:00
committed by Copybara-Service
parent 006c18b1d8
commit 8e7457d7c6
7 changed files with 122 additions and 15 deletions
@@ -32,9 +32,11 @@ namespace mujoco {
using pxr::SdfPath;
pxr::SdfLayerRefPtr LoadLayer(const std::string& xml) {
pxr::SdfLayerRefPtr LoadLayer(
const std::string& xml,
const pxr::SdfFileFormat::FileFormatArguments& args) {
auto layer = pxr::SdfLayer::CreateAnonymous(
"test_layer", pxr::SdfFileFormat::FindByExtension("xml"));
"test_layer", pxr::SdfFileFormat::FindByExtension("xml"), args);
layer->ImportFromString(xml);
EXPECT_THAT(layer, testing::NotNull());
return layer;