Correct use of uninitialized value and clean up FullInertia function

PiperOrigin-RevId: 605049375
Change-Id: I7ffb6bd56b08111036e8490bf767fb9393499f13
This commit is contained in:
Matthew Bennice
2024-02-07 11:36:51 -08:00
committed by Copybara-Service
parent ea69f20b43
commit e4fada1963
2 changed files with 26 additions and 21 deletions
+2 -1
View File
@@ -266,7 +266,8 @@ void mjXURDF::Body(XMLElement* body_elem) {
// process inertia
// lquat = rotation from specified to default (joint/body) inertial frame
double lquat[4], tmpquat[4];
double lquat[4] = {1, 0, 0, 0};
double tmpquat[4] = {1, 0, 0, 0};
const char* altres = mjm_setFullInertia(pbody, lquat, pbody->inertia);
// inertia are sometimes 0 in URDF files: ignore error in altres, fix later