Skip to content

Commit

Permalink
[tests] added test for loading turtlebot with RobotDescriptionManager
Browse files Browse the repository at this point in the history
  • Loading branch information
kecks committed Aug 21, 2024
1 parent c7ebb55 commit fecadc0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_robot_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class TestRobotDescription(unittest.TestCase):
def setUpClass(cls):
cls.path = str(pathlib.Path(__file__).parent.resolve()) + '/../resources/robots/' + "pr2" + '.urdf'
cls.urdf_obj = URDF.from_xml_file(cls.path)
cls.path_turtlebot = str(pathlib.Path(__file__).parent.resolve()) + '/../resources/robots/' + "turtlebot" + '.urdf'

def test_robot_description_construct(self):
robot_description = RobotDescription("pr2", "base_link", "torso_lift_link", "torso_lift_joint", self.path)
Expand Down Expand Up @@ -190,3 +191,13 @@ def test_load_robot_description(self):
rdm.register_description(robot_description)
rdm.load_description("pr2_test2")
self.assertIs(RobotDescription.current_robot_description, robot_description)

def test_robot_description_turtlebot(self):
robot_description = RobotDescription("turtlebot", "base_link", "base_link", "base_joint", self.path_turtlebot)
self.assertEqual(robot_description.name, "turtlebot")
self.assertEqual(robot_description.base_link, "base_link")
self.assertEqual(robot_description.torso_link, "base_link")
self.assertEqual(robot_description.torso_joint, "base_joint")
self.assertTrue(type(robot_description.urdf_object) is URDF)
self.assertEqual(len(robot_description.links), 11)
self.assertEqual(len(robot_description.joints), 10)

0 comments on commit fecadc0

Please sign in to comment.