From f7735d96071629ae71504d4c7a4660ecc7d68102 Mon Sep 17 00:00:00 2001 From: Wim Meeussen Date: Fri, 4 Nov 2011 09:19:14 -0700 Subject: [PATCH] add warning when root link has inertia, because KDL does not support root link with inertia --- kdl_parser/src/kdl_parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kdl_parser/src/kdl_parser.cpp b/kdl_parser/src/kdl_parser.cpp index 114aa40..dcb6418 100644 --- a/kdl_parser/src/kdl_parser.cpp +++ b/kdl_parser/src/kdl_parser.cpp @@ -168,6 +168,10 @@ bool treeFromUrdfModel(const urdf::Model& robot_model, Tree& tree) { tree = Tree(robot_model.getRoot()->name); + // warn if root link has inertia. KDL does not support this + if (robot_model.getRoot()->inertial) + ROS_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()); + // add all children for (size_t i=0; ichild_links.size(); i++) if (!addChildrenToTree(robot_model.getRoot()->child_links[i], tree))