22 #include <gtest/gtest.h> 23 #include <libs/kdl_parser/kdl_parser.h> 24 #include <kdl/tree.hpp> 40 urdf_file = SRCDIR
"/caesar.urdf";
41 ASSERT_TRUE(tree_from_file(urdf_file, tree));
52 string filename =
"invalidFileName";
54 ASSERT_ANY_THROW(tree_from_file(filename, tree));
58 EXPECT_EQ((
unsigned int)9, tree.getNrOfJoints());
59 EXPECT_EQ((
unsigned int)37, tree.getNrOfSegments());
64 ASSERT_TRUE(tree.getChain(
"/base_link",
"katana_l_finger_link", chain));
65 EXPECT_EQ(9, chain.getNrOfSegments());
66 EXPECT_EQ(6, chain.getNrOfJoints());
70 EXPECT_EQ(
"/base_link", tree.getRootSegment()->first);
71 EXPECT_EQ(tree.getSegment(
"/base_link"), tree.getRootSegment());
Fawkes library namespace.
virtual void SetUp()
Load the robot description and initialize the tree.
Test Class for KDLParser.
KDL::Tree tree
The result of parsing the URDF file.
string urdf_file
The URDF file path.