def listener():
global odom_pub,left_motor_pub,left_motor_speed_pub,right_motor_pub,right_motor_speed_pub
rospy.Subscriber("/cmd_vel", Twist, callback)
odom_pub = rospy.Publisher('/odom', Odometry, queue_size=10)
left_motor_pub = rospy.Publisher('/left_motor', std_msgs.msg.Int32, queue_size=10)
left_motor_speed_pub = rospy.Publisher('/left_motor_speed', std_msgs.msg.Int32, queue_size=10)
right_motor_pub = rospy.Publisher('/right_motor', std_msgs.msg.Int32, queue_size=10)
right_motor_speed_pub = rospy.Publisher('/right_motor_speed', std_msgs.msg.Int32, queue_size=10)
rospy.spin()
评论列表
文章目录