semantic_robot_state_generator.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 # simple script to generate srdf parameter on the fly
00004 # with only world virtual joint
00005 import rospy
00006 from xml.dom.minidom import parseString
00007 if __name__ == "__main__":
00008     rospy.init_node("semantic_robot_state_generator")
00009     root_link = rospy.get_param("~root_link", "BODY")
00010     global_frame = rospy.get_param("~global_frame", "odom")
00011     robot_description = rospy.get_param("/robot_description")
00012     robot_description_doc = parseString(robot_description)
00013     robot_name = robot_description_doc.getElementsByTagName("robot")[0].getAttribute("name")
00014 
00015     srdf_str = """<?xml version="1.0" ?>
00016     <robot name="%s">
00017     <virtual_joint name="world_joint" type="floating" parent_frame="%s" child_link="%s" />
00018     <passive_joint name="world_joint" />
00019     </robot>
00020     """ % (robot_name, global_frame, root_link)
00021     rospy.set_param("/robot_description_semantic", srdf_str)
00022 


jsk_interactive_marker
Author(s): furuta
autogenerated on Wed May 1 2019 02:40:31