25 if rospy.has_param(
'/robot_description'):
26 urdf_str = rospy.get_param(
'/robot_description')
27 path = path_to_save_files +
"/" + file_name +
".urdf" 28 urdf_file = open(path,
"wb")
29 urdf_file.write(urdf_str)
33 rospy.logerr(
"Parameter server does not have /robot_description param")
36 if rospy.has_param(
'/robot_description_semantic'):
37 srdf_str = rospy.get_param(
'/robot_description_semantic')
38 path = path_to_save_files +
"/" + file_name +
".srdf" 39 srdf_file = open(path,
"wb")
40 srdf_file.write(srdf_str)
44 rospy.logerr(
"Parameter server does not have /robot_description_semantics param")
47 if __name__ ==
'__main__':
48 rospy.init_node(
"saving_urdf_and_srdf_to_files", anonymous=
True)
50 save_files.save_urdf_from_param()
51 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")