Warning: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist

asked 2019-10-28 08:53:04 -0500

fendrbud gravatar image

updated 2019-10-28 09:33:44 -0500

I am trying to set up my navigation stack according to navigation setup tutorial when I encounter the following error:

 [ WARN] [1572268788.927613562]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.101027 timeout was 0.1.

My launch files are

<launch>
   <!-- Run ROSARIA (Sensors and odometry) -->
   <node pkg="rosaria" type="RosAria" name="rosaria" output="screen">
   <param name="publish_aria_lasers" value="true"/>
   </node>

   <!-- Set up transform configuration (URDF, joint_state_publisher and robot_state_publisher -->
   <param name="robot_description" textfile="$(find robot_state_publisher)/amr-ros-config/description/urdf/pioneer-lx.urdf"/>
   <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />   
   <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
</launch>

and

<launch>

   <master auto="start"/>
   <!-- Run the map server --> 
   <arg name="map_file" default="$(find map_server)/maps/willow.yaml"/>
   <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)"/>

   <!--- Run AMCL --> 
   <include file="$(find amcl)/examples/amcl_omni.launch" />

   <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
   <rosparam file="$(find cyborg_2dnav)/costmap_common_params.yaml" command="load" ns="global_costmap" /> 
   <rosparam file="$(find cyborg_2dnav)/costmap_common_params.yaml" command="load" ns="local_costmap" />
   <rosparam file="$(find cyborg_2dnav)/local_costmap_params.yaml" command="load" />
   <rosparam file="$(find cyborg_2dnav)/global_costmap_params.yaml" command="load" /> 
   <rosparam file="$(find cyborg_2dnav)/base_local_planner_params.yaml" command="load" />
   </node>

   <node name="rviz" pkg="rviz" type="rviz" args="-d $(find robot_state_publisher)amr-ros-config/description/urdf/display_urdf.rviz"/>

</launch>

global_costmap_params.yaml:

global_costmap:
  global_frame: /map
  robot_base_frame: base_link
  update_frequency: 5.0
  static_map: false

local_costmap_params.yaml:

local_costmap:
  global_frame: odom
  robot_base_frame: base_link
  update_frequency: 5.0
  publish_frequency: 2.0
  static_map: false
  rolling_window: true
  width: 6.0
  height: 6.0
  resolution: 0.05

This rqt_graph shows my current nodes and topics.

I am not sure how to fix this and would appreciate any help!

edit retag flag offensive close merge delete

Comments

can you please post the output from:

rosrun rqt_tf_tree rqt_tf_tree
pavel92 gravatar image pavel92  ( 2019-10-28 10:47:39 -0500 )edit

Here is the transform tree. From the error message and the tree it seems to me that there is no transform from base_link to the map, however I thought amcl published this. Looking at the rqt_graph I can see that amcl is not subscribing to the /map topic published by the map_server. I guess this might be the problem?

fendrbud gravatar image fendrbud  ( 2019-10-29 03:55:25 -0500 )edit

yup, your map frame does not exist atm and is not part of the tf tree so the lookup for the transform between base_link to map fails

pavel92 gravatar image pavel92  ( 2019-10-29 03:58:29 -0500 )edit

check the amcl documentation. Under Published Topics you will find this:

Publishes the transform from odom (which can be remapped via the ~odom_frame_id parameter) to map.
pavel92 gravatar image pavel92  ( 2019-10-29 04:14:05 -0500 )edit

Hmm.. I still encounter the same issue when mapping the odom_frame_id to map like this:

<launch>
<node pkg="amcl" type="amcl" name="amcl">
   <!-- Publish scans from best pose at a max of 10 Hz -->
  <param name="odom_model_type" value="omni"/>
  <param name="odom_alpha5" value="0.1"/>
  ..........
   <param name="use_map_topic" value="true" />
  <param name="odom_frame_id" value="/map" />
</node>
</launch>

I still have the same error message and the same tf tree.

fendrbud gravatar image fendrbud  ( 2019-10-31 08:15:53 -0500 )edit

I got it working now when implementing slam_gmapping!

fendrbud gravatar image fendrbud  ( 2019-10-31 08:38:28 -0500 )edit
4

can you please explain how did you implemented it ?

AmirSaman gravatar image AmirSaman  ( 2020-12-06 20:54:38 -0500 )edit