本文整理汇总了Python中urdf_parser_py.urdf.URDF.parse_xml_string方法的典型用法代码示例。如果您正苦于以下问题:Python URDF.parse_xml_string方法的具体用法?Python URDF.parse_xml_string怎么用?Python URDF.parse_xml_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类urdf_parser_py.urdf.URDF
的用法示例。
在下文中一共展示了URDF.parse_xml_string方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from urdf_parser_py.urdf import URDF [as 别名]
# 或者: from urdf_parser_py.urdf.URDF import parse_xml_string [as 别名]
def main():
global tf
global command, limbs
global pub
# Initialize the ROS node
rospy.init_node('kdl_kinect')
# Create a transform listener
tf = TransformListener()
# Retrieve raw robot parameters from rosmaster
robot_string = rospy.get_param("robot_description", None)
if not robot_string:
raise Exception('Robot model not specified')
# Load URDF model of robot description locally
robot_urdf = URDF.parse_xml_string(robot_string)
# Load URDF model of robot description into KDL
robot_kdl = kdl_parser.kdl_tree_from_urdf_model(robot_urdf)
# Publish Atlas commands
pub = rospy.Publisher('/atlas/atlas_command', AtlasCommand)
# Subscribe to hydra and atlas updates
rospy.Subscriber("/arms/hydra_calib", Hydra, hydra_callback, queue_size = 1)
rospy.Subscriber("/skeleton", Skeleton, skeleton_callback, queue_size = 1)
rospy.Subscriber("/atlas/atlas_state", AtlasState, atlas_callback, queue_size = 1)
# Start main event handling loop
rospy.loginfo('Started kdl_hydra node...')
r = rospy.Rate(10) # 10hz
while not rospy.is_shutdown():
r.sleep()
rospy.loginfo('Stopping kdl_hydra node...')