0

I am navigating my custom mobile robot in GAZEBO simulation (ROS Noetic). I have generated map , used AMCL for localization, then used global and local planner for path planning.

My issue is while running the global and local planner i can do global path planning and the robot moves(from initial to final point), but the local planner doesn't generate its cost map and doesn't avoid obstacles (colides with obstacles not present while generating map).

It shows a single 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.. canTransform returned after 96.134 timeout was 0.1."

I hope think this warning might prevent local planner and costmap to work. I have tried a lot of methods but couldn't solve it.

Note the local planner doesn't identify obstacles in its range , its just black

Below is the video for navigation and parameters used.

Link of navigation : text

maap_amcl_kob4.launch

<launch>

  <!-- Map Server Arguments -->
  <arg name="map_file" default="$(find kob_4_description)/maps/3rd_t3_home/3rd_tb3_home.yaml"/>
  <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

  <!-- Arguments -->
  <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"/>

  <!-- AMCL -->
  <include file = "$(find kob_4_description)/launch/kob_amcl.launch" />

</launch>

kob_amcl.launch

<launch>
<node pkg="amcl" type="amcl" name="amcl" output="screen">
  <!-- 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="30"/>
  <param name="min_particles" value="500"/>
  <param name="max_particles" value="5000"/>
  <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.8"/>
  <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.2"/>
  <param name="update_min_a" value="0.5"/>
  <param name="odom_frame_id" value="odom"/>
  <param name="resample_interval" value="1"/>
  <param name="transform_tolerance" value="0.1"/>
  <param name="recovery_alpha_slow" value="0.0"/>
  <param name="recovery_alpha_fast" value="0.0"/>
</node>
</launch>

common_costmap.yaml

robot_radius: 0.175

robot_base_frame: base_footprint
update_frequency: 4.0
publish_frequency: 3.0
transform_tolerance: 0.5

resolution: 0.05

obstacle_range: 5.5
raytrace_range: 6.0

static:
    map_topic: /map
    subscribe_to_updates: true

obstacles_laser:
    observation_sources: /scan
    laser: {data_type: LaserScan, clearing: true, marking: true, topic: scan, inf_is_valid: true}

inflation:
    inflation_radius: 0.6


dwa_planner.yaml

DWAPlannerROS:

# Robot Configuration Parameters
  max_vel_x: 0.5
  min_vel_x: 0.0

  max_vel_y: 0.0
  min_vel_y: 0.0

# The velocity when robot is moving in a straight line
  max_vel_trans:  0.2
  min_vel_trans:  0.035

  max_vel_theta: 4.0
  min_vel_theta: 0.0

  acc_lim_x: 2.5
  acc_lim_y: 0.0
  acc_lim_theta: 4.0

# Goal Tolerance Parametes
  xy_goal_tolerance: 0.2
  yaw_goal_tolerance: 0.2
  latch_xy_goal_tolerance: false

# Forward Simulation Parameters
  sim_time: 1.5 # sec
  vx_samples: 20 # units
  vy_samples: 0
  vth_samples: 40
  controller_frequency: 10.0 #hz

# Trajectory Scoring Parameters
  path_distance_bias: 32.0
  goal_distance_bias: 20.0
  occdist_scale: 0.02
  forward_point_distance: 0.325
  stop_time_buffer: 0.2
  scaling_speed: 0.05
  max_scaling_factor: 0.09

# Oscillation Prevention Parameters
  oscillation_reset_dist: 0.05

# Debugging
  publish_traj_pc : true
  publish_cost_grid_pc: true


global_costmap.yaml

global_costmap:
  global_frame: map
  robot_base_frame: base_link

  update_frequency: 50
  publish_frequency: 50
  transform_tolerance: 0.5

  static_map: true

local_costmap.yaml

local_costmap:
  global_frame: odom
  robot_base_frame: base_link

  update_frequency: 50
  publish_frequency: 50
  transform_tolerance: 0.5  

  static_map: false  
  rolling_window: true
  width: 3
  height: 3
  resolution: 0.05
move_base.yaml

shutdown_costmaps: false
controller_frequency: 10.0
planner_patience: 5.0
controller_patience: 15.0
conservative_reset_dist: 3.0
planner_frequency: 5.0
oscillation_timeout: 10.0
oscillation_distance: 0.2


Command 1 : roslaunch kob_4_description gaz_rviz.launch

Terminal output :

roslaunch kob_4_description gaz_rviz.launch
WARNING: Package name "3d_scan_description" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
... logging to /home/dell/.ros/log/c6a1a59a-17c3-11ee-af5d-57436f4e29c3/roslaunch-dell-G3-3500-4002.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

WARNING: Package name "3d_scan_description" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
started roslaunch server http://192.168.117.253:44409/

SUMMARY
========

PARAMETERS
 * /gazebo/enable_ros_network: True
 * /robot_description: <?xml version="1....
 * /rosdistro: noetic
 * /rosversion: 1.16.0
 * /use_gui: True
 * /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    joint_state_publisher (joint_state_publisher/joint_state_publisher)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    rviz (rviz/rviz)
    spawn_urdf (gazebo_ros/spawn_model)

auto-starting new master
process[master]: started with pid [4037]
ROS_MASTER_URI=http://192.168.117.253:11311

setting /run_id to c6a1a59a-17c3-11ee-af5d-57436f4e29c3
WARNING: Package name "3d_scan_description" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
process[rosout-1]: started with pid [4054]
started core service [/rosout]
process[spawn_urdf-2]: started with pid [4057]
process[joint_state_publisher-3]: started with pid [4058]
process[robot_state_publisher-4]: started with pid [4059]
process[gazebo-5]: started with pid [4060]
process[gazebo_gui-6]: started with pid [4062]
process[rviz-7]: started with pid [4070]
[ WARN] [1688184013.090960937]: The root link base_link 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.
WARNING: Package name "3d_scan_description" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
WARNING: Package name "3d_scan_description" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
WARNING: Package name "3d_scan_description" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
WARNING: Package name "3d_scan_description" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
[ INFO] [1688184014.206852943]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1688184014.208745193]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1688184014.327932021]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1688184014.328848367]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[ INFO] [1688184015.271985830]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1688184015.289536468]: Physics dynamic reconfigure ready.
[ INFO] [1688184015.740304891, 0.001000000]: Laser Plugin: Using the 'robotNamespace' param: '/'
[ INFO] [1688184015.740367890, 0.001000000]: Starting Laser Plugin (ns = /)
[ INFO] [1688184015.741480051, 0.001000000]: Laser Plugin (ns = /)  <tf_prefix_>, set to ""
[ INFO] [1688184015.779689162, 0.001000000]: Loading gazebo_ros_control plugin
[ INFO] [1688184015.779790280, 0.001000000]: Starting gazebo_ros_control plugin in namespace: /
[ INFO] [1688184015.780490952, 0.001000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server.
[ INFO] [1688184015.901229484, 0.001000000]: Loaded gazebo_ros_control.
[ INFO] [1688184015.914564775, 0.001000000]: Starting plugin DiffDrive(ns = //)
[ WARN] [1688184015.914702794, 0.001000000]: DiffDrive(ns = //): missing <rosDebugLevel> default is na
[ INFO] [1688184015.915626434, 0.001000000]: DiffDrive(ns = //): <tf_prefix> = 
[ WARN] [1688184015.915735898, 0.001000000]: DiffDrive(ns = //): missing <publishOdomTF> default is true
[ WARN] [1688184015.915860491, 0.001000000]: DiffDrive(ns = //): <odometrySource> no matching key to 1
[ WARN] [1688184015.915924133, 0.001000000]: GazeboRosDiffDrive Plugin (ns = ) missing <publishTf>, defaults to 1
[ INFO] [1688184015.916455231, 0.001000000]: DiffDrive(ns = //): Try to subscribe to cmd_vel
[ INFO] [1688184015.918232012, 0.001000000]: DiffDrive(ns = //): Subscribe to cmd_vel
[ INFO] [1688184015.918632454, 0.001000000]: DiffDrive(ns = //): Advertise odom on odom 
[spawn_urdf-2] process has finished cleanly
log file: /home/dell/.ros/log/c6a1a59a-17c3-11ee-af5d-57436f4e29c3/spawn_urdf-2*.log


Command 2 : roslaunch kob_4_description maap_amcl_kob4.launch

Terminal output :

roslaunch kob_4_description maap_amcl_kob4.launch
WARNING: Package name "3d_scan_description" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
... logging to /home/dell/.ros/log/c6a1a59a-17c3-11ee-af5d-57436f4e29c3/roslaunch-dell-G3-3500-4602.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

WARNING: Package name "3d_scan_description" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
started roslaunch server http://192.168.117.253:40531/

SUMMARY
========

PARAMETERS
 * /amcl/gui_publish_rate: 10.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: 30
 * /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: 5000
 * /amcl/min_particles: 500
 * /amcl/odom_alpha1: 0.2
 * /amcl/odom_alpha2: 0.2
 * /amcl/odom_alpha3: 0.8
 * /amcl/odom_alpha4: 0.2
 * /amcl/odom_alpha5: 0.1
 * /amcl/odom_frame_id: odom
 * /amcl/odom_model_type: diff
 * /amcl/recovery_alpha_fast: 0.0
 * /amcl/recovery_alpha_slow: 0.0
 * /amcl/resample_interval: 1
 * /amcl/transform_tolerance: 0.1
 * /amcl/update_min_a: 0.5
 * /amcl/update_min_d: 0.2
 * /rosdistro: noetic
 * /rosversion: 1.16.0

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

ROS_MASTER_URI=http://192.168.117.253:11311

WARNING: Package name "3d_scan_description" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
process[map_server-1]: started with pid [4625]
process[amcl-2]: started with pid [4626]
[ INFO] [1688184105.137895483]: Requesting the map...
[ INFO] [1688184105.344951491, 74.269000000]: Received a 299 X 210 map @ 0.050 m/pix

[ INFO] [1688184105.354813355, 74.278000000]: Initializing likelihood field model; this can take some time on large maps...
[ INFO] [1688184105.372673294, 74.294000000]: Done initializing likelihood field model.


Command 3 : roslaunch kob_4_description move_base.launch

Terminal output : 

 roslaunch kob_4_description move_base.launch
WARNING: Package name "3d_scan_description" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
... logging to /home/dell/.ros/log/c6a1a59a-17c3-11ee-af5d-57436f4e29c3/roslaunch-dell-G3-3500-4687.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://192.168.117.253:34941/

SUMMARY
========

PARAMETERS
 * /move_base/DWAPlannerROS/acc_lim_theta: 4.0
 * /move_base/DWAPlannerROS/acc_lim_x: 2.5
 * /move_base/DWAPlannerROS/acc_lim_y: 0.0
 * /move_base/DWAPlannerROS/controller_frequency: 10.0
 * /move_base/DWAPlannerROS/forward_point_distance: 0.325
 * /move_base/DWAPlannerROS/goal_distance_bias: 20.0
 * /move_base/DWAPlannerROS/latch_xy_goal_tolerance: False
 * /move_base/DWAPlannerROS/max_scaling_factor: 0.09
 * /move_base/DWAPlannerROS/max_vel_theta: 4.0
 * /move_base/DWAPlannerROS/max_vel_trans: 0.2
 * /move_base/DWAPlannerROS/max_vel_x: 0.5
 * /move_base/DWAPlannerROS/max_vel_y: 0.0
 * /move_base/DWAPlannerROS/min_vel_theta: 0.0
 * /move_base/DWAPlannerROS/min_vel_trans: 0.035
 * /move_base/DWAPlannerROS/min_vel_x: 0.0
 * /move_base/DWAPlannerROS/min_vel_y: 0.0
 * /move_base/DWAPlannerROS/occdist_scale: 0.02
 * /move_base/DWAPlannerROS/oscillation_reset_dist: 0.05
 * /move_base/DWAPlannerROS/path_distance_bias: 32.0
 * /move_base/DWAPlannerROS/publish_cost_grid_pc: True
 * /move_base/DWAPlannerROS/publish_traj_pc: True
 * /move_base/DWAPlannerROS/scaling_speed: 0.05
 * /move_base/DWAPlannerROS/sim_time: 1.5
 * /move_base/DWAPlannerROS/stop_time_buffer: 0.2
 * /move_base/DWAPlannerROS/vth_samples: 40
 * /move_base/DWAPlannerROS/vx_samples: 20
 * /move_base/DWAPlannerROS/vy_samples: 0
 * /move_base/DWAPlannerROS/xy_goal_tolerance: 0.2
 * /move_base/DWAPlannerROS/yaw_goal_tolerance: 0.2
 * /move_base/base_local_planner: dwa_local_planner...
 * /move_base/conservative_reset_dist: 3.0
 * /move_base/controller_frequency: 10.0
 * /move_base/controller_patience: 15.0
 * /move_base/global_costmap/global_frame: map
 * /move_base/global_costmap/inflation/inflation_radius: 0.6
 * /move_base/global_costmap/obstacle_range: 5.5
 * /move_base/global_costmap/obstacles_laser/laser/clearing: True
 * /move_base/global_costmap/obstacles_laser/laser/data_type: LaserScan
 * /move_base/global_costmap/obstacles_laser/laser/inf_is_valid: True
 * /move_base/global_costmap/obstacles_laser/laser/marking: True
 * /move_base/global_costmap/obstacles_laser/laser/topic: scan
 * /move_base/global_costmap/obstacles_laser/observation_sources: /scan
 * /move_base/global_costmap/publish_frequency: 50
 * /move_base/global_costmap/raytrace_range: 6.0
 * /move_base/global_costmap/resolution: 0.05
 * /move_base/global_costmap/robot_base_frame: base_link
 * /move_base/global_costmap/robot_radius: 0.175
 * /move_base/global_costmap/static/map_topic: /map
 * /move_base/global_costmap/static/subscribe_to_updates: True
 * /move_base/global_costmap/static_map: True
 * /move_base/global_costmap/transform_tolerance: 0.5
 * /move_base/global_costmap/update_frequency: 50
 * /move_base/local_costmap/global_frame: odom
 * /move_base/local_costmap/height: 3
 * /move_base/local_costmap/inflation/inflation_radius: 0.6
 * /move_base/local_costmap/obstacle_range: 5.5
 * /move_base/local_costmap/obstacles_laser/laser/clearing: True
 * /move_base/local_costmap/obstacles_laser/laser/data_type: LaserScan
 * /move_base/local_costmap/obstacles_laser/laser/inf_is_valid: True
 * /move_base/local_costmap/obstacles_laser/laser/marking: True
 * /move_base/local_costmap/obstacles_laser/laser/topic: scan
 * /move_base/local_costmap/obstacles_laser/observation_sources: /scan
 * /move_base/local_costmap/publish_frequency: 50
 * /move_base/local_costmap/raytrace_range: 6.0
 * /move_base/local_costmap/resolution: 0.05
 * /move_base/local_costmap/robot_base_frame: base_link
 * /move_base/local_costmap/robot_radius: 0.175
 * /move_base/local_costmap/rolling_window: True
 * /move_base/local_costmap/static/map_topic: /map
 * /move_base/local_costmap/static/subscribe_to_updates: True
 * /move_base/local_costmap/static_map: False
 * /move_base/local_costmap/transform_tolerance: 0.5
 * /move_base/local_costmap/update_frequency: 50
 * /move_base/local_costmap/width: 3
 * /move_base/oscillation_distance: 0.2
 * /move_base/oscillation_timeout: 10.0
 * /move_base/planner_frequency: 5.0
 * /move_base/planner_patience: 5.0
 * /move_base/shutdown_costmaps: False
 * /rosdistro: noetic
 * /rosversion: 1.16.0

NODES
  /
    move_base (move_base/move_base)

ROS_MASTER_URI=http://192.168.117.253:11311

WARNING: Package name "3d_scan_description" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
process[move_base-1]: started with pid [4711]
[ WARN] [1688184130.806271397, 95.548000000]: 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 95.548 timeout was 0.1.
[ WARN] [1688184130.943852629, 95.656000000]: global_costmap: Parameter "plugins" not provided, loading pre-Hydro parameters
[ INFO] [1688184130.951974600, 95.664000000]: global_costmap: Using plugin "static_layer"
[ INFO] [1688184130.973749384, 95.678000000]: Requesting the map...
[ INFO] [1688184131.218470000, 95.884000000]: Resizing costmap to 299 X 210 at 0.050000 m/pix
[ INFO] [1688184131.334738607, 95.984000000]: Received a 299 X 210 map at 0.050000 m/pix
[ INFO] [1688184131.337471303, 95.987000000]: global_costmap: Using plugin "obstacle_layer"
[ INFO] [1688184131.339822484, 95.989000000]:     Subscribed to Topics: 
[ INFO] [1688184131.351981299, 95.997000000]: global_costmap: Using plugin "inflation_layer"
[ WARN] [1688184131.419924739, 96.052000000]: local_costmap: Parameter "plugins" not provided, loading pre-Hydro parameters
[ INFO] [1688184131.434745032, 96.061000000]: local_costmap: Using plugin "obstacle_layer"
[ INFO] [1688184131.436731271, 96.063000000]:     Subscribed to Topics: 
[ INFO] [1688184131.450584066, 96.074000000]: local_costmap: Using plugin "inflation_layer"
[ INFO] [1688184131.533828160, 96.138000000]: Created local_planner dwa_local_planner/DWAPlannerROS
[ INFO] [1688184131.535949000, 96.140000000]: Sim period is set to 0.10
[ INFO] [1688184131.709804834, 96.271000000]: Recovery behavior will clear layer 'obstacles'
[ INFO] [1688184131.723983407, 96.282000000]: Recovery behavior will clear layer 'obstacles'
[ INFO] [1688184131.765587377, 96.316000000]: odom received!
[ INFO] [1688184452.632560303, 362.807000000]: Got new plan
[ INFO] [1688184452.893997059, 363.008000000]: Got new plan
[ INFO] [1688184453.150923098, 363.209000000]: Got new plan
.
.
.
[ INFO] [1688184494.340184853, 396.307000000]: Goal reached

I would like to know the reason for the error and ways to solve it.

Vega
  • 27,856
  • 27
  • 95
  • 103

0 Answers0