Fix mass/inertia checking for moving bodies with nested children.

Previously, we only checked immediate children of moving bodies.

PiperOrigin-RevId: 726999705
Change-Id: I133a557daf86223b8751c6d46e25809781e168a1
This commit is contained in:
Tom Power
2025-02-14 11:25:31 -08:00
committed by Copybara-Service
parent 37d7591ce0
commit 78a4d2f389
3 changed files with 128 additions and 27 deletions
+7
View File
@@ -414,6 +414,13 @@ class mjCModel : public mjCModel_, private mjSpec {
// compute qpos0
void ComputeReference();
// return true if all bodies have valid mass and inertia
bool CheckBodiesMassInertia(std::vector<mjCBody*> bodies);
// return true if body has valid mass and inertia
bool CheckBodyMassInertia(mjCBody* body);
mjListKeyMap ids; // map from object names to ids
mjCError errInfo; // last error info
std::vector<mjKeyInfo> key_pending_; // attached keyframes