We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sdf14
Error Code 19: Msg: Inertia Calculated for collision: box_col_zero_density is invalid.
UNIT_World_TEST
[ RUN ] DOMWorld.ResolveAutoInertials /Users/scpeters/ws/sdformat/src/sdformat/src/World_TEST.cc:552: Failure Value of: errors.empty() Actual: false Expected: true Error Code 19: Msg: Inertia Calculated for collision: box_col_zero_density is invalid. /Users/scpeters/ws/sdformat/src/sdformat/src/World_TEST.cc:580: Failure Value of: errors.empty() Actual: false Expected: true Error Code 19: Msg: Inertia Calculated for collision: box_col_zero_density is invalid. [ FAILED ] DOMWorld.ResolveAutoInertials (63 ms)
The text was updated successfully, but these errors were encountered:
the following might work:
diff --git a/src/Collision.cc b/src/Collision.cc index cf03c565..46337d51 100644 --- a/src/Collision.cc +++ b/src/Collision.cc @@ -303,6 +303,13 @@ void Collision::CalculateInertial( ); } + if (density == 0) + { + // Set to default Inertial, which has zero mass and moments of inertia. + _inertial = gz::math::Inertiald(); + return; + } + auto geomInertial = this->dataPtr->geom.CalculateInertial(_errors, _config, density, this->dataPtr->autoInertiaParams); diff --git a/src/Link.cc b/src/Link.cc index c3d772dd..57e68055 100644 --- a/src/Link.cc +++ b/src/Link.cc @@ -646,6 +646,13 @@ void Link::ResolveAutoInertials(sdf::Errors &_errors, totalInertia = totalInertia + collisionInertia; } + if (!totalInertia.MassMatrix().IsValid()) + { + _errors.push_back({ErrorCode::LINK_INERTIA_INVALID, + "Inertia Calculated for link: " + + this->dataPtr->name + " is invalid."}); + } + this->dataPtr->inertial = totalInertia; // If CalculateInertial() was called with SAVE_CALCULATION
Sorry, something went wrong.
quarkytale
No branches or pull requests
Environment
sdf14
as of 2ba6470Description
Steps to reproduce
UNIT_World_TEST
Output
The text was updated successfully, but these errors were encountered: