Attach the tree of defaults recursively and with namespacing.

PiperOrigin-RevId: 650664018
Change-Id: I17751a02a406dcb2a2ca218c316b5eb0370071b8
This commit is contained in:
Alessio Quaglino
2024-07-09 09:53:05 -07:00
committed by Copybara-Service
parent d0f86bc2c5
commit 462cfa5ceb
6 changed files with 111 additions and 50 deletions
+5
View File
@@ -559,6 +559,11 @@ TEST_F(MujocoTest, AttachDifferent) {
// check body 2 is attached to body 1
EXPECT_THAT(m_attached->body_parentid[2], 1);
// check that the correct defaults are present
EXPECT_THAT(mjs_findDefault(parent, "main"), NotNull());
EXPECT_THAT(mjs_findDefault(parent, "geom_size"), NotNull());
EXPECT_THAT(mjs_findDefault(parent, "attached-cylinder-1"), NotNull());
// compare with expected XML
mjModel* m_expected = LoadModelFromString(xml_result, er.data(), er.size());
EXPECT_THAT(m_expected, NotNull()) << er.data();