27 if rospy.has_param(
'/robot_description'):
28 urdf_str = rospy.get_param(
'/robot_description')
29 path = path_to_save_files +
"/" + file_name +
".urdf" 30 urdf_file = open(path,
"wb")
31 urdf_file.write(urdf_str)
35 rospy.logerr(
"Parameter server does not have /robot_description param")
38 if rospy.has_param(
'/robot_description_semantic'):
39 srdf_str = rospy.get_param(
'/robot_description_semantic')
40 path = path_to_save_files +
"/" + file_name +
".srdf" 41 srdf_file = open(path,
"wb")
42 srdf_file.write(srdf_str)
46 rospy.logerr(
"Parameter server does not have /robot_description_semantics param")
49 if __name__ ==
'__main__':
50 rospy.init_node(
"saving_urdf_and_srdf_to_files", anonymous=
True)
52 save_files.save_urdf_from_param()
53 save_files.save_srdf_from_param()
def save_srdf_from_param(self, path_to_save_files="/tmp", file_name="robot")
def save_urdf_from_param(self, path_to_save_files="/tmp", file_name="robot")