赞
踩
/turtle1/pose [turtlesim/Pose]
#!/usr/bin/env python #coding:utf-8 #// /turtle1/pose [turtlesim/Pose] import rospy from turtlesim.msg import Pose def turtleCallBack(msg): rospy.loginfo("turtle pose: x:%06f, y:%0.6f",msg.x , msg.y) def turtle_subscriber(): rospy.init_node('turtle_subscriber',anonymous = True) rospy.Subscriber("/turtle1/pose",Pose,turtleCallBack) rospy.spin() if __name__ == '__main__': turtle_subscriber()
运行结果:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。