def listener():
# In ROS, nodes are uniquely named. If two nodes with the same
# node are launched, the previous one is kicked off. The
# anonymous=True flag means that rospy will choose a unique
# name for our 'listener' node so that multiple listeners can
# run simultaneously.
rospy.init_node('listener', anonymous=True)
rospy.Subscriber("/turtlebot_angle", Float64, callback1)
rospy.Subscriber("/turtlebot_posex", Float64, callback2)
rospy.Subscriber("/turtlebot_posey", Float64, callback3)
rospy.Subscriber("/turtlebot_follower/dist_object1", Float64, callback4)
rospy.Subscriber("/turtlebot_follower/dist_object2", Float64, callback5)
rospy.Subscriber("/turtlebot_follower/dist_object3", Float64, callback6)
rospy.Subscriber("/turtlebot_follower/dist_object4", Float64, callback7)
#rospy.Subscriber("/turtlebot_follower/dist_object", Float64, callback8)
# spin() simply keeps python from exiting until this node is stopped
rospy.spin()
object_position4.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录