2 from test_moveit.core.robot_model
import JointModelGroup, RobotModel
9 dir_path = os.path.dirname(os.path.realpath(__file__))
10 URDF_FILE =
"{}/fixtures/panda.urdf".format(dir_path)
11 SRDF_FILE =
"{}/fixtures/panda.srdf".format(dir_path)
15 """Helper function that returns a RobotModel instance."""
16 return RobotModel(urdf_xml_path=URDF_FILE, srdf_xml_path=SRDF_FILE)
22 Test that the RobotModel can be initialized with xml filepaths.
25 self.assertIsInstance(robot, RobotModel)
29 Test that the RobotModel name property returns the correct name.
32 self.assertEqual(robot.name,
"panda")
36 Test that the RobotModel model_frame property returns the correct name.
39 self.assertEqual(robot.model_frame,
"world")
43 Test that the RobotModel root_link property returns the correct name.
46 self.assertEqual(robot.root_joint_name,
"virtual_joint")
50 Test that the RobotModel joint_model_group_names property returns the correct names.
53 self.assertCountEqual(
54 robot.joint_model_group_names, [
"panda_arm",
"hand",
"panda_arm_hand"]
59 Test that the RobotModel joint_model_groups returns a list of JointModelGroups.
62 self.assertIsInstance(robot.joint_model_groups[0], JointModelGroup)
66 Test that the RobotModel has_joint_model_group returns True for existing groups.
69 self.assertTrue(robot.has_joint_model_group(
"panda_arm"))
70 self.assertFalse(robot.has_joint_model_group(
"The answer is 42."))
74 Test that the RobotModel get_joint_model_group returns the correct group.
77 jmg = robot.get_joint_model_group(
"panda_arm")
78 self.assertIsInstance(jmg, JointModelGroup)
79 self.assertEqual(jmg.name,
"panda_arm")
82 if __name__ ==
"__main__":
def test_model_frame_property(self)
def test_has_joint_model_group(self)
def test_joint_model_groups_property(self)
def test_get_joint_model_group(self)
def test_joint_model_group_names_property(self)
def test_name_property(self)
def test_initialization(self)
def test_root_joint_name_property(self)