Missing connection between /map and /base_link
Navigation 报错:
[ WARN] [1522398152.672156241]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: Could not find a connection between 'map' and 'base_footprint' because they are not part of the same tree.Tf has two or more unconnected trees.. canTransform returned after 0.105784 timeout was 0.1.
或者
Timed out waiting for transform from base_link to map to become available before running costmap, tf error: Could not find a connection between 'map' and 'base_link' because they are not part of the same tree.Tf has two or more unconnected trees.. canTransform returned after 0.101544 timeout was 0.1.
In general, the /map (to /odom or /base_link) frame is broadcast by a localization node (eg. amcl or gmapping). The /odom (to /base_link) frame is broadcast by an odometry producing node (eg. from your wheel encoders or robot_pose_ekf).
解决办法:
在launch文件中添加:
<node pkg="tf" type="static_transform_publisher" name="map_to_odom" args="0.0 0.0 0.0 0 0 0.0 /map /odom 1000"/>
ROS中base_link, odom, fixed_frame, target_frame和虚拟大地图map的关系
参考:https://blog.csdn.net/crazyquhezheng/article/details/43346907