Sending Twist Messages to a Real Robot

实际使用的是kobuki 底座的turtlebot机器人,之前没有看资料,使用

roslaunch turtlebot_bringup minimal.launch

测试(提示音)通过后,查看rostopic list,发现有好多运行的节点,其中有

/cmd_vel_mux/的几个topic。

如:

cmd_vel_mux/input/navi

cmd_vel_mux/input/safety_controller

然后通过

rostopic type /cmd_vel_mux/input/navi

rostopic type /cmd_vel_mux/input/safety_controller

其格式均为:  geometry/Twist

因此可用如下指令来控制实际的turtlebot

rostopic pub -r 10 /cmd_vel_mux/safety_controller geometry_msgs/Twist '{linear: {x: 0, y: 0,z: 0}, angular: {x: 0, y: 0, z: 1.0}}'

rostopic pub -r 10 /cmd_vel_mux/navi geometry_msgs/Twist '{linear: {x: 0, y: 0,z: 0}, angular: {x: 0, y: 0, z: 1.0}}'

原文地址:https://www.cnblogs.com/siahekai/p/11000819.html