11 NAME =
"test_kdl_parser" 17 filename = sys.argv[1]
19 self.fail(
"Expected filename!")
23 self.assertEqual(tree.getNrOfJoints(), 8)
25 self.assertEqual(tree.getNrOfSegments(), 10)
26 chain = tree.getChain(
"base_link",
"right_gripper")
27 self.assertEqual(chain.getNrOfSegments(), 2)
28 self.assertEqual(chain.getNrOfJoints(), 2)
29 self.assertEqual(chain.getSegment(0).getName(),
"gripper_pole")
30 self.assertEqual(chain.getSegment(0).getJoint().getName(),
"gripper_extension")
31 self.assertEqual(chain.getSegment(1).getName(),
"right_gripper")
32 self.assertEqual(chain.getSegment(1).getJoint().getName(),
"right_gripper_joint")
34 inertia = chain.getSegment(1).getInertia()
35 self.assertAlmostEqual(inertia.getCOG().z(), 3.0)
37 if __name__ ==
'__main__':
38 rostest.run(PKG, NAME, TestKdlParser, sys.argv)
def treeFromFile(filename)