引自《ros_by_example_hydro___volume_1》
1、安装仿真器:
sudo apt-get install ros-hydro-arbotix-*
2、测试仿真器
仿真Turtlebot机器人
roslaunch rbx1_bringup fake_turtlebot.launch
结果输出:
process[arbotix-1]: started with pid [8630]
process[robot_state_publisher-2]: started with pid [8631]
[INFO] [WallTime: 1426938547.392359] ArbotiX being simulated.
[INFO] [WallTime: 1426938547.443767] Started DiffController (base_controller). Geometry: 0.26m wide, 4100.0 ticks/m.
使用rviz观测:
新的终端:rosrun rviz rviz -d `rospack find rbx1_nav`/sim.rviz
(这里边使用rospack find定位rbx1_nav包的位置,用的特殊符号是 倒引号,倒引号含义参考:http://www.cnblogs.com/balaamwe/archive/2012/03/15/2397998.html)
新的终端:rostopic pub -r 10 /cmd_vel geometry_msgs/Twist '{linear: {x: 0.2, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0.5}}' ——发布指令
最终结果:
节点图:
3、Timed Out-and-Back in the ArbotiX Simulator
终止终端(rostopic pub -r 10 /cmd_vel geometry_msgs/Twist '{linear: {x: 0.2, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0.5}}'),RESET RVIZ 界面:在终端输入rosrun rbx1_nav timed_out_and_back.py
橙色为勾选了EKF之后的结果,可以看出如果没有做EKF的话,轨迹来回一下不能完全重合呢,图中是黄色回到起点后方位角略有不同。