Skip to content

Commit

Permalink
bugfix: set mass of root link
Browse files Browse the repository at this point in the history
  • Loading branch information
Janosch Machowinski committed Jan 23, 2017
1 parent e7f06e9 commit d1d2507
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/kdl_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ bool treeFromUrdfModel(const urdf::ModelInterface& robot_model, Tree& tree)

// warn if root link has inertia. KDL does not support this
if (robot_model.getRoot()->inertial)
LOG_DEBUG("WARN: The root link %s has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.", robot_model.getRoot()->name.c_str());
{
KDL::RigidBodyInertia *i = const_cast<KDL::RigidBodyInertia *>(&(tree.getRootSegment()->second.segment.getInertia()));
*i = toKdl(robot_model.getRoot()->inertial);
}

// add all children
for (size_t i=0; i<robot_model.getRoot()->child_links.size(); i++)
Expand Down

0 comments on commit d1d2507

Please sign in to comment.