19 from xml.dom.minidom
import parse
24 from unittest
import TestCase
26 PKG =
"sr_multi_moveit_config" 32 Test class for checking that the collada name "biotac_decimated.dae" of the urdf of the 33 biotac hands has not been changed so they can be identified 40 with open(hand_urdf_path,
'r') as hand_urdf_xacro_file: 41 hand_urdf_xml = parse(hand_urdf_xacro_file) 49 hand_urdf = hand_urdf_xml.toprettyxml(indent=' ')
50 robot = URDF.from_xml_string(hand_urdf)
54 for key
in robot.link_map:
55 link = robot.link_map[key]
57 if hasattr(link.visual.geometry,
'filename'):
58 filename = os.path.basename(link.visual.geometry.filename)
59 if filename ==
"biotac_decimated.dae":
65 hand_urdf_path = self.rospack.get_path(
'sr_description')+
"/robots/" +
"shadowhand_motor.urdf.xacro" 67 self.assertFalse(is_biotac, msg=
"Wrong biotac hand")
70 hand_urdf_path = self.rospack.get_path(
'sr_description')+
"/robots/" +
"shadowhand_motor_biotac.urdf.xacro" 72 self.assertTrue(is_biotac, msg=
"No file name is called biotac_decimated.dae")
75 hand_urdf_path = self.rospack.get_path(
'sr_description')+
"/robots/" +
"shadowhand_motor_ff_biotac.urdf.xacro" 77 self.assertTrue(is_biotac, msg=
"No file name is called biotac_decimated.dae")
80 hand_urdf_path = self.rospack.get_path(
'sr_description')+
"/robots/" +
"shadowhand_muscle_biotac.urdf.xacro" 82 self.assertTrue(is_biotac, msg=
"No file name is called biotac_decimated.dae")
84 if __name__ ==
"__main__":
86 rostest.rosrun(PKG,
"test_biotac_collada_name", TestBiotacColladaName)
def process_includes(elt, macros=None, symbols=None)
def check_name(self, hand_urdf_path)
def grab_properties(elt, table)
def test_motor_hand(self)
def test_motor_biotac_hand(self)
def test_motor_ff_biotac_hand(self)
def test_muscle_biotac_hand(self)
def grab_macros(elt, macros)
def eval_all(node, macros, symbols)