def speed_converter():
rospy.init_node('wheel_speed', anonymous=True)
pub1 = rospy.Publisher('lwheel_vtarget', Float32, queue_size=10)
pub2 = rospy.Publisher('rwheel_vtarget', Float32, queue_size=10)
rate = rospy.Rate(10)
while not rospy.is_shutdown():
rospy.Subscriber('cmd_vel', Twist, callback)
s1 = "The left wheel's target speed is %f m/s." % lv
s2 = "The right wheel's target speed is %f m/s." % rv
rospy.loginfo(s1)
rospy.loginfo(s2)
pub1.publish(lv)
pub2.publish(rv)
rate.sleep()
评论列表
文章目录