在Ubuntu 16.04+ROS kinetic环境学习《Learning_ROS_for_Robotics_Programming_2nd_edition》的chapter 9 The Navigation Stack –Beyond Setups时候出现如下警告导致无法成功运行本章案例。
1 错误记录
(1)执行如下命令:
roslaunch chapter9_tutorials chapter9_configuration_gazebo.launch
roslaunch chapter9_tutorials move_base.launch
(2)错误信息
1)Warning
第一条:
[ WARN] [1480983367.577704599]: The root link base_footprint has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF
【分析】:现象看是URDF问题,从URDF入手解决
第二条:
[ WARN] [1480981421.815460738, 6.221000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: . canTransform returned after 6.221 timeout was 0.1
【分析】:从现象看是tf问题,使用常见分析命令roswtf,rosrun tf tf_monitor,rosrun tf tf_eco src des等看看;
同时看看各个node的输入是否都正常获取,没有的话分析下是订阅主题名称不对,还是主题上根本就无消息出来。
2) Rviz界面左侧显示红色失败
2 解决措施
2.1 修改文件chapter7_tutorials/robot1_description/urdf/robot1_base_04.xacro
注释掉如下红色,解决上面第一条警告:
修改如下红色用于解决第二条警告,以及rviz失败问题
2.2 修改文件chapter7_tutorials/robot1_description/urdf/robot.gazebo
修改如下红色用于解决第二条警告,以及rviz失败问题
2.3 修改了文件chapter9_tutorials/launch/chapter9_configuration_gazebo.launch
注释掉如下红色并将其加入到了chapter9_tutorials/launch/move_base.launch,为了调整使一切ready后再启动rviz
2.4 修改了文件chapter9_tutorials/launch/move_base.launch
添加如下到启动文件末尾
3 运行结果显示
3.1 Rviz显示界面
3.2 rqt_graph显示
从图中分析知道:
Node AMCL: input了robot_state_publisher的tf_static, gazebo仿真底座控制器的/tf(odom->base_footprint),gazebo的 laser sensor的/scan, /initialpose
output了/tf(map->odom),/particlecloud
Node move_base: input了map_server的/map, gazebo仿真底座控制器odom,gazebo仿真sensor的/scan, robot_state_publisher的tf_static,gazebo仿真底座控制器的tf,amcl的tf,move_base_simple的goal
output了:cmd_vel给gazebo仿真的底座控制器