Merge pull request #3432 from VihaanAgarwal:fix/convex-inertia-unreferenced-mesh

PiperOrigin-RevId: 965896711
Change-Id: I3254a621ef7689544130fd0ce43b86c0261f52b1
This commit is contained in:
Copybara-Service
2026-08-17 04:52:41 -07:00
2 changed files with 25 additions and 2 deletions
+16
View File
@@ -975,6 +975,22 @@ TEST_F(MjCMeshTest, ExactConvexInertia) {
mj_deleteModel(model);
}
TEST_F(MjCMeshTest, UnreferencedConvexInertiaMesh) {
static constexpr char xml[] = R"(
<mujoco>
<asset>
<mesh name="orphan" inertia="convex"
vertex="0 0 1 1 0 0 0 1 0 -1 0 0 0 -1 0"
face="0 1 2 0 2 3 0 3 4 0 4 1 1 4 3 1 3 2"/>
</asset>
<worldbody/>
</mujoco>
)";
std::array<char, 1024> error;
MjModelPtr model = LoadModelFromString(xml, error.data(), error.size());
EXPECT_THAT(model.get(), NotNull()) << error.data();
}
TEST_F(MjCMeshTest, ExactShellInertia) {
const std::string xml_path = GetTestDataFilePath(kShellInertiaPath);
std::array<char, 1024> error;