semantic_robot_state_generator.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 # simple script to generate srdf parameter on the fly
4 # with only world virtual joint
5 import rospy
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")
14 
15  srdf_str = """<?xml version="1.0" ?>
16  <robot name="%s">
17  <virtual_joint name="world_joint" type="floating" parent_frame="%s" child_link="%s" />
18  <passive_joint name="world_joint" />
19  </robot>
20  """ % (robot_name, global_frame, root_link)
21  rospy.set_param("/robot_description_semantic", srdf_str)
22 


jsk_interactive_marker
Author(s): furuta
autogenerated on Sat Mar 20 2021 03:03:33