Skip to content

Commit

Permalink
Cleaned up the Code
Browse files Browse the repository at this point in the history
Signed-off-by: Jasmeet Singh <jasmeet0915@gmail.com>
  • Loading branch information
jasmeet0915 committed Jul 13, 2023
1 parent c8120ae commit 42a4707
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/Link.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,16 @@ Errors Link::Load(ElementPtr _sdf, const ParserConfig &_config)

if (inertiaElem->Get<bool>("auto"))
{
std::cout << "Inertia is set to automatic" << std::endl;
for(auto collision : this->dataPtr->collisions)
{
std::cout << "Density of the collision is: " << collision.Density();
std::cout << std::endl;

Errors inertiaErrors = collision.MassMatrix(xxyyzz, xyxzyz, mass);
std::cout << "Inertia of " << this->dataPtr->name << std::endl;
std::cout << xxyyzz.X() << " , " << xxyyzz.Y() << " , " << xxyyzz.Z() << std::endl;
std::cout << xyxzyz.X() << " , " << xyxzyz.Y() << " , " << xyxzyz.Z() << std::endl;
std::cout << "Mass of " << this->dataPtr->name << " is " << mass << std::endl;
errors.insert(errors.end(), inertiaErrors.begin(),
inertiaErrors.end());
}
}
else
{
std::cout << "Inertia is not set to automatic" << std::endl;
// Get the mass.
mass = inertialElem->Get<double>("mass", 1.0).first;
xxyyzz.X(inertiaElem->Get<double>("ixx", 1.0).first);
Expand Down Expand Up @@ -255,11 +248,6 @@ Errors Link::Load(ElementPtr _sdf, const ParserConfig &_config)
}
}
}
std::cout << "--------------------------------------" << std::endl;
std::cout << "Inertia of " << this->dataPtr->name << std::endl;
std::cout << xxyyzz.X() << " , " << xxyyzz.Y() << " , " << xxyyzz.Z() << std::endl;
std::cout << xyxzyz.X() << " , " << xyxzyz.Y() << " , " << xyxzyz.Z() << std::endl;
std::cout << "Mass of " << this->dataPtr->name << " is " << mass << std::endl;

if (!this->dataPtr->inertial.SetMassMatrix(
gz::math::MassMatrix3d(mass, xxyyzz, xyxzyz)))
Expand Down

0 comments on commit 42a4707

Please sign in to comment.