def listener():
global odom_pub,left_motor_pub,left_motor_speed_pub,right_motor_pub,right_motor_speed_pub
#subscribing to required topics
rospy.Subscriber("/cmd_vel", Twist, cmd_velCb)
rospy.Subscriber('imu_data',Imu,imuCb)
rospy.Subscriber('north',std_msgs.msg.Float32,northCb)
odom_pub = rospy.Publisher('/odom', Odometry, queue_size=10)
left_motor_pub = rospy.Publisher('/left_motor', std_msgs.msg.Int32, queue_size=10)
right_motor_pub = rospy.Publisher('/right_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_speed_pub = rospy.Publisher('/right_motor_speed', std_msgs.msg.Int32, queue_size=10)
rospy.spin()
评论列表
文章目录