6 from xml.dom.minidom
import parseString
7 if __name__ ==
"__main__":
8 rospy.init_node(
"semantic_robot_state_generator")
9 root_link = rospy.get_param(
"~root_link",
"BODY")
10 global_frame = rospy.get_param(
"~global_frame",
"odom")
11 robot_description = rospy.get_param(
"/robot_description")
12 robot_description_doc = parseString(robot_description)
13 robot_name = robot_description_doc.getElementsByTagName(
"robot")[0].getAttribute(
"name")
15 srdf_str =
"""<?xml version="1.0" ?> 17 <virtual_joint name="world_joint" type="floating" parent_frame="%s" child_link="%s" /> 18 <passive_joint name="world_joint" /> 20 """ % (robot_name, global_frame, root_link)
21 rospy.set_param(
"/robot_description_semantic", srdf_str)