Timed out waiting for transform from base_link to map to become available before running costmap

Hi,

I’m trying to follow the instructions on [ROS Q&A] 183 - 2D Drone Navigation with ROS (Part 3 Path Planning)…and i can’t figure this issue when running: roslaunch quadrotor_navigation quadrotor_move_base.launch .

and the output is:

[ WARN] [1668121874.353347336]: 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: source_frame base_link does not exist… canTransform returned after 0.100257 timeout was 0.1.
[ WARN] [1668121879.387354106]: 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: source_frame base_link does not exist… canTransform returned after 0.100739 timeout was 0.1.

any suggestions how to fix this issue?

Many thanks!

Hi @tomer.hochman, welcome to the community!

The map->base_link transform is usually published by the localization system.

In your case, I see that you are launching quadrotor_move_base.launch. Does it include a localization node like amcl? If not, then that would be the issue

Hi!

I think it is included… i will add both launch files( quadrotor_localization and quadrotor_move_base) and the full message when i run quadrotor_move_base.launch…maybe i’m missing something…

user:~$ roslaunch quadrotor_navigation quadrotor_move_base.launch
... logging to /home/user/.ros/log/a6db26f2-61be-11ed-b352-0242c0a82007/roslaunch-4_xterm-8778.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://4_xterm:41029/

SUMMARY
========

PARAMETERS
 * /amcl/base_frame_id: base_link
 * /amcl/global_frame_id: map
 * /amcl/gui_publish_rate: 10.0
 * /amcl/initial_pose_a: 0.0
 * /amcl/initial_pose_x: 0.0
 * /amcl/initial_pose_y: 0.0
 * /amcl/kld_err: 0.05
 * /amcl/kld_z: 0.99
 * /amcl/laser_lambda_short: 0.1
 * /amcl/laser_likelihood_max_dist: 2.0
 * /amcl/laser_max_beams: 60
 * /amcl/laser_max_range: 12.0
 * /amcl/laser_model_type: likelihood_field
 * /amcl/laser_sigma_hit: 0.2
 * /amcl/laser_z_hit: 0.5
 * /amcl/laser_z_max: 0.05
 * /amcl/laser_z_rand: 0.5
 * /amcl/laser_z_short: 0.05
 * /amcl/max_particles: 2000
 * /amcl/min_particles: 500
 * /amcl/odom_alpha1: 0.2
 * /amcl/odom_alpha2: 0.2
 * /amcl/odom_alpha3: 0.2
 * /amcl/odom_alpha4: 0.2
 * /amcl/odom_alpha5: 0.1
 * /amcl/odom_frame_id: world
 * /amcl/odom_model_type: diff
 * /amcl/recovery_alpha_fast: 0.0
 * /amcl/recovery_alpha_slow: 0.0
 * /amcl/resample_interval: 1
 * /amcl/transform_tolerance: 1.0
 * /amcl/update_min_a: 0.2
 * /amcl/update_min_d: 0.25
 * /amcl/use_map_topic: False
 * /move_base/DWAPlannerROS/acc_lim_theta: 2.0
 * /move_base/DWAPlannerROS/acc_lim_x: 1.0
 * /move_base/DWAPlannerROS/acc_lim_y: 0.0
 * /move_base/DWAPlannerROS/forward_point_distance: 0.325
 * /move_base/DWAPlannerROS/global_frame_id: world
 * /move_base/DWAPlannerROS/goal_distance_bias: 24.0
 * /move_base/DWAPlannerROS/max_rot_vel: 5.0
 * /move_base/DWAPlannerROS/max_scaling_factor: 0.2
 * /move_base/DWAPlannerROS/max_trans_vel: 0.5
 * /move_base/DWAPlannerROS/max_vel_x: 0.5
 * /move_base/DWAPlannerROS/max_vel_y: 0.0
 * /move_base/DWAPlannerROS/min_rot_vel: 0.4
 * /move_base/DWAPlannerROS/min_trans_vel: 0.1
 * /move_base/DWAPlannerROS/min_vel_x: 0.0
 * /move_base/DWAPlannerROS/min_vel_y: 0.0
 * /move_base/DWAPlannerROS/occdist_scale: 0.5
 * /move_base/DWAPlannerROS/oscillation_reset_dist: 0.05
 * /move_base/DWAPlannerROS/path_distance_bias: 64.0
 * /move_base/DWAPlannerROS/publish_cost_grid_pc: True
 * /move_base/DWAPlannerROS/publish_traj_pc: True
 * /move_base/DWAPlannerROS/rot_stopped_vel: 0.4
 * /move_base/DWAPlannerROS/scaling_speed: 0.25
 * /move_base/DWAPlannerROS/sim_time: 1.0
 * /move_base/DWAPlannerROS/stop_time_buffer: 0.2
 * /move_base/DWAPlannerROS/trans_stopped_vel: 0.1
 * /move_base/DWAPlannerROS/vtheta_samples: 20
 * /move_base/DWAPlannerROS/vx_samples: 6
 * /move_base/DWAPlannerROS/vy_samples: 1
 * /move_base/DWAPlannerROS/xy_goal_tolerance: 0.15
 * /move_base/DWAPlannerROS/yaw_goal_tolerance: 0.3
 * /move_base/GlobalPlanner/allow_unknown: True
 * /move_base/GlobalPlanner/cost_factor: 3.0
 * /move_base/GlobalPlanner/default_tolerance: 0.0
 * /move_base/GlobalPlanner/lethal_cost: 253
 * /move_base/GlobalPlanner/neutral_cost: 50
 * /move_base/GlobalPlanner/old_navfn_behavior: False
 * /move_base/GlobalPlanner/planner_costmap_publish_frequency: 0.0
 * /move_base/GlobalPlanner/planner_window_x: 0.0
 * /move_base/GlobalPlanner/planner_window_y: 0.0
 * /move_base/GlobalPlanner/publish_potential: True
 * /move_base/GlobalPlanner/publish_scale: 100
 * /move_base/GlobalPlanner/use_dijkstra: True
 * /move_base/GlobalPlanner/use_grid_path: False
 * /move_base/GlobalPlanner/use_quadratic: True
 * /move_base/NavfnROS/allow_unknown: False
 * /move_base/NavfnROS/default_tolerance: 0.0
 * /move_base/NavfnROS/planner_window_x: 0.0
 * /move_base/NavfnROS/planner_window_y: 0.0
 * /move_base/NavfnROS/visualize_potential: False
 * /move_base/base_global_planner: navfn/NavfnROS
 * /move_base/base_local_planner: dwa_local_planner...
 * /move_base/controller_frequency: 5.0
 * /move_base/controller_patience: 3.0
 * /move_base/global_costmap/global_frame: map
 * /move_base/global_costmap/inflation_layer/cost_scaling_factor: 5.0
 * /move_base/global_costmap/inflation_layer/enabled: True
 * /move_base/global_costmap/inflation_layer/inflation_radius: 0.5
 * /move_base/global_costmap/map_type: voxel
 * /move_base/global_costmap/max_obstacle_height: 0.6
 * /move_base/global_costmap/obstacle_layer/combination_method: 1
 * /move_base/global_costmap/obstacle_layer/enabled: True
 * /move_base/global_costmap/obstacle_layer/mark_threshold: 0
 * /move_base/global_costmap/obstacle_layer/max_obstacle_height: 0.6
 * /move_base/global_costmap/obstacle_layer/observation_sources: scan
 * /move_base/global_costmap/obstacle_layer/obstacle_range: 5.5
 * /move_base/global_costmap/obstacle_layer/origin_z: 0.0
 * /move_base/global_costmap/obstacle_layer/publish_voxel_map: False
 * /move_base/global_costmap/obstacle_layer/raytrace_range: 6.0
 * /move_base/global_costmap/obstacle_layer/scan/clearing: True
 * /move_base/global_costmap/obstacle_layer/scan/data_type: LaserScan
 * /move_base/global_costmap/obstacle_layer/scan/inf_is_valid: True
 * /move_base/global_costmap/obstacle_layer/scan/marking: True
 * /move_base/global_costmap/obstacle_layer/scan/topic: /scan
 * /move_base/global_costmap/obstacle_layer/track_unknown_space: True
 * /move_base/global_costmap/obstacle_layer/unknown_threshold: 15
 * /move_base/global_costmap/obstacle_layer/z_resolution: 0.2
 * /move_base/global_costmap/obstacle_layer/z_voxels: 10
 * /move_base/global_costmap/plugins: [{'type': 'costma...
 * /move_base/global_costmap/publish_frequency: 0.5
 * /move_base/global_costmap/robot_base_frame: base_link
 * /move_base/global_costmap/robot_radius: 0.2
 * /move_base/global_costmap/static_layer/enabled: True
 * /move_base/global_costmap/static_map: True
 * /move_base/global_costmap/transform_tolerance: 0.5
 * /move_base/global_costmap/update_frequency: 1.0
 * /move_base/local_costmap/global_frame: world
 * /move_base/local_costmap/height: 4.0
 * /move_base/local_costmap/inflation_layer/cost_scaling_factor: 5.0
 * /move_base/local_costmap/inflation_layer/enabled: True
 * /move_base/local_costmap/inflation_layer/inflation_radius: 0.5
 * /move_base/local_costmap/map_type: voxel
 * /move_base/local_costmap/max_obstacle_height: 0.6
 * /move_base/local_costmap/obstacle_layer/combination_method: 1
 * /move_base/local_costmap/obstacle_layer/enabled: True
 * /move_base/local_costmap/obstacle_layer/mark_threshold: 0
 * /move_base/local_costmap/obstacle_layer/max_obstacle_height: 0.6
 * /move_base/local_costmap/obstacle_layer/observation_sources: scan
 * /move_base/local_costmap/obstacle_layer/obstacle_range: 5.5
 * /move_base/local_costmap/obstacle_layer/origin_z: 0.0
 * /move_base/local_costmap/obstacle_layer/publish_voxel_map: False
 * /move_base/local_costmap/obstacle_layer/raytrace_range: 6.0
 * /move_base/local_costmap/obstacle_layer/scan/clearing: True
 * /move_base/local_costmap/obstacle_layer/scan/data_type: LaserScan
 * /move_base/local_costmap/obstacle_layer/scan/inf_is_valid: True
 * /move_base/local_costmap/obstacle_layer/scan/marking: True
 * /move_base/local_costmap/obstacle_layer/scan/topic: /scan
 * /move_base/local_costmap/obstacle_layer/track_unknown_space: True
 * /move_base/local_costmap/obstacle_layer/unknown_threshold: 15
 * /move_base/local_costmap/obstacle_layer/z_resolution: 0.2
 * /move_base/local_costmap/obstacle_layer/z_voxels: 10
 * /move_base/local_costmap/plugins: [{'type': 'costma...
 * /move_base/local_costmap/publish_frequency: 2.0
 * /move_base/local_costmap/resolution: 0.05
 * /move_base/local_costmap/robot_base_frame: base_link
 * /move_base/local_costmap/robot_radius: 0.2
 * /move_base/local_costmap/rolling_window: True
 * /move_base/local_costmap/static_layer/enabled: True
 * /move_base/local_costmap/static_map: False
 * /move_base/local_costmap/transform_tolerance: 0.5
 * /move_base/local_costmap/update_frequency: 5.0
 * /move_base/local_costmap/width: 4.0
 * /move_base/oscillation_distance: 0.2
 * /move_base/oscillation_timeout: 10.0
 * /move_base/planner_frequency: 1.0
 * /move_base/planner_patience: 5.0
 * /move_base/shutdown_costmaps: False
 * /rosdistro: kinetic
 * /rosversion: 1.12.14

NODES
  /
    amcl (amcl/amcl)
    map_server (map_server/map_server)
    move_base (move_base/move_base)

ROS_MASTER_URI=http://4_xterm:11311

process[map_server-1]: started with pid [8811]
process[amcl-2]: started with pid [8812]
process[move_base-3]: started with pid [8830]

quadrotor_localiztion

<launch>

  <!-- Map server -->
  <arg name="map_file" default="$(find quadrotor_navigation)/maps/quad_map.yaml"/>
  <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

  <arg name="use_map_topic"   default="false"/>
  <arg name="scan_topic"      default="/scan"/>
  <arg name="initial_pose_x"  default="0.0"/>
  <arg name="initial_pose_y"  default="0.0"/>
  <arg name="initial_pose_a"  default="0.0"/>
  <!--<arg name="odom_frame_id"   default="world"/>-->
  <arg name="odom_frame_id"   default="world"/>
  <arg name="base_frame_id"   default="base_link"/>
  <arg name="global_frame_id" default="map"/>

  <node pkg="amcl" type="amcl" name="amcl">
    <param name="use_map_topic"             value="$(arg use_map_topic)"/>
    <!-- Publish scans from best pose at a max of 10 Hz -->
    <param name="odom_model_type"           value="diff"/>
    <param name="odom_alpha5"               value="0.1"/>
    <param name="gui_publish_rate"          value="10.0"/>
    <param name="laser_max_beams"             value="60"/>
    <param name="laser_max_range"           value="12.0"/>
    <param name="min_particles"             value="500"/>
    <param name="max_particles"             value="2000"/>
    <param name="kld_err"                   value="0.05"/>
    <param name="kld_z"                     value="0.99"/>
    <param name="odom_alpha1"               value="0.2"/>
    <param name="odom_alpha2"               value="0.2"/>
    <!-- translation std dev, m -->
    <param name="odom_alpha3"               value="0.2"/>
    <param name="odom_alpha4"               value="0.2"/>
    <param name="laser_z_hit"               value="0.5"/>
    <param name="laser_z_short"             value="0.05"/>
    <param name="laser_z_max"               value="0.05"/>
    <param name="laser_z_rand"              value="0.5"/>
    <param name="laser_sigma_hit"           value="0.2"/>
    <param name="laser_lambda_short"        value="0.1"/>
    <param name="laser_model_type"          value="likelihood_field"/>
    <!-- <param name="laser_model_type" value="beam"/> -->
    <param name="laser_likelihood_max_dist" value="2.0"/>
    <param name="update_min_d"              value="0.25"/>
    <param name="update_min_a"              value="0.2"/>
    <param name="odom_frame_id"             value="$(arg odom_frame_id)"/>
    <param name="base_frame_id"             value="$(arg base_frame_id)"/>
    <param name="global_frame_id"           value="$(arg global_frame_id)"/>
    <param name="resample_interval"         value="1"/>
    <!-- Increase tolerance because the computer can get quite busy -->
    <param name="transform_tolerance"       value="1.0"/>
    <param name="recovery_alpha_slow"       value="0.0"/>
    <param name="recovery_alpha_fast"       value="0.0"/>
    <param name="initial_pose_x"            value="$(arg initial_pose_x)"/>
    <param name="initial_pose_y"            value="$(arg initial_pose_y)"/>
    <param name="initial_pose_a"            value="$(arg initial_pose_a)"/>
    <remap from="scan"                      to="$(arg scan_topic)"/>
  </node>
</launch>

quadrotor_move_base

<!--
    ROS navigation stack with velocity smoother and safety (reactive) controller
-->
<launch>
  <!--<include file="$(find quadrotor_navigation)/launch/includes/velocity_smoother.launch.xml"/>-->
  <!--<include file="$(find quadrotor_navigation)/launch/includes/safety_controller.launch.xml"/>-->
  <include file="$(find quadrotor_navigation)/launch/quadrotor_localization.launch"/>

  <!--<arg name="odom_frame_id"   default="world"/>-->
  <arg name="odom_frame_id"   default="world"/>
  <arg name="base_frame_id"   default="base_link"/>
  <arg name="global_frame_id" default="map"/>
  <!--<arg name="odom_topic" default="/ground_truth/state" />-->
  <arg name="odom_topic" default="/ground_truth/state" />
  <arg name="laser_topic" default="/scan" />
  <arg name="custom_param_file" default="$(find quadrotor_navigation)/param/dummy.yaml"/>

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find quadrotor_navigation)/param/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find quadrotor_navigation)/param/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find quadrotor_navigation)/param/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find quadrotor_navigation)/param/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find quadrotor_navigation)/param/dwa_local_planner_params.yaml" command="load" />
    <rosparam file="$(find quadrotor_navigation)/param/move_base_params.yaml" command="load" />
    <rosparam file="$(find quadrotor_navigation)/param/global_planner_params.yaml" command="load" />
    <rosparam file="$(find quadrotor_navigation)/param/navfn_global_planner_params.yaml" command="load" />
    <!-- external params file that could be loaded into the move_base namespace -->
    <rosparam file="$(arg custom_param_file)" command="load" />

    <!-- reset frame_id parameters using user input data -->
    <param name="global_costmap/global_frame" value="$(arg global_frame_id)"/>
    <param name="global_costmap/robot_base_frame" value="$(arg base_frame_id)"/>
    <param name="local_costmap/global_frame" value="$(arg odom_frame_id)"/>
    <param name="local_costmap/robot_base_frame" value="$(arg base_frame_id)"/>
    <param name="DWAPlannerROS/global_frame_id" value="$(arg odom_frame_id)"/>

    <remap from="cmd_vel" to="/cmd_vel"/>
    <remap from="odom" to="$(arg odom_topic)"/>
    <remap from="/scan" to="$(arg laser_topic)"/>
  </node>
</launch>

I appreciate your help!

In your parameters, you have the odom_frame_id set as “world”, but that’s not right since you don’t have a frame that is called world.

You need to include an odometry frame before you try to launch anything from navigation, because amcl publishes the map frame to the odometry frame, which you don’t have right now. You can try setting base_link as the odometry frame, but I doubt it will work.

Do you have an /odom topic available once you launch the simulation?