ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Trying to get our robot navigating

asked 2021-08-31 17:47:31 -0600

Ronro gravatar image

updated 2022-02-20 18:55:05 -0600

lucasw gravatar image

Hello, there:

My partner and I are trying to get an autonomous robot which is based on 2 Rpis that comunicate via ethernet. The robot has 4 wheels, 4 electric motors and 2 motor controllers (Roboclaw 2x15A) and is rectangle-shaped. We have implemented a little supervisor that switches between teloperated mode and autonomous mode. We also have a little RTC in order to get both rpis synchronized through chronyd server (we had some issues about the timestamp so we got this fixed like that). This was just for introducing you for what comes now.

The thing is: when having everything fired up (nodes, etc) our move_base node shows this message:

WARN /move_base [/tmp/binarydeb/ros-melodic-costmap-2d-1.16.7/src/costmap_2d_ros.cpp:101(Costmap2DROS::Costmap2DROS)] [topics: /rosout, /cmd_vel, /move_base/current_goal, /move_base/goal] Timed out waiting for transform from base_link to world to become available before running costmap, tf error: Lookup would require extrapolation into the past.  Requested time 1630430254.744803905 but the earliest data is at time 1630437446.981132030, when looking up transform from frame [base_link] to frame [world]. canTransform returned after 0.10104 timeout was 0.1.

We have the following configuration of the navigation stack:

Common costmap params yaml

obstacle_range: 2.5
raytrace_range: 3.0
footprint: [[-17, -22], [17, -22], [17,25], [-17,25]]
inflation_radius: 0.60

IMPORTANT: we have no laser or imus. Just a camera and odometry source (motors).

Global costmap yaml

  global_frame: world
  robot_base_frame: base_link
  update_frequency: 5.0
  static_map: true

Local costmap yaml

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

Base local planner params yaml

  max_vel_x: 2
  min_vel_x: 0.1
  max_vel_theta: 1.0
  min_in_place_vel_theta: 0.4
  acc_lim_theta: 3.2
  acc_lim_x: 2.5
  acc_lim_y: 2.5
  holonomic_robot: false

Map yaml

image: /home/ubuntu/catkin_ws/src/robot_navigation/map_2.pgm
resolution: 0.012270416 
origin: [11.019, 0.12270416, 0.0]
occupied_thresh: 0.85
free_thresh: 0.15
negate: 0

Map image (i can´t upload images since I haven´t got enough points). In the system is a .pgm file. Tf tree and node graph.

And last but not least, here are the launch and yamls of robot_localization package and move_base:

Robot_localization launch file

 <!--Robot location-->
  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_se" clear_params="true">
    <rosparam command="load" file="$(find robot_localization)/params/ekf_robot.yaml" />
    <rosparam param="initial_state">[10.0,  0.0,  0.0,
                                 0.0,  0.0,  1.0,
                                 0.0,  0.0,  0.0,
                                 0.0,  0.0,  0.0,
                                 0.0,  0.0,  0.0]</rosparam>

Robot_localization yaml

frequency: 30
silent_tf_failure: false
sensor_timeout: 0.1
two_d_mode: true
transform_time_offset: 0.0
transform_timeout: 0.0
print_diagnostics: true
debug: false
debug_out_file: /path/to/debug/file.txt
publish_tf: true
publish_acceleration: false
map_frame: world              # Defaults to "map" if unspecified
odom_frame: odom            # Defaults to "odom" if unspecified
base_link_frame: base_link  # Defaults to "base_link" if unspecified
world_frame: world           # Defaults to the value of odom_frame if unspecified

odom0: /odom ...
edit retag flag offensive close merge delete


Checking TF tree may help you discover something. TF tree can be created with rosrun tf view_frameswith all nodes up. ( ref )

miura gravatar image miura  ( 2021-08-31 18:10:59 -0600 )edit

Already posted the TF tree between map yaml and robot localization launch.

Ronro gravatar image Ronro  ( 2021-09-01 03:02:37 -0600 )edit

I'm sorry. I overlooked it.

miura gravatar image miura  ( 2021-09-01 19:51:57 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2021-09-01 19:53:34 -0600

miura gravatar image

From rosgraph.png, it looks like the cost map of move_base is not linked to the map image.

If you change the global costmap yaml to the following, it should improve the problem.

  global_frame: world
  robot_base_frame: base_link
  update_frequency: 5.0
  static_map: true

  resolution: 0.012270416 
    - {name: static_layer, type: "costmap_2d::StaticLayer"}

    map_topic: "map"
edit flag offensive delete link more


Hi, Miura. This improves nothing. How this should help us? Thanks in advice.

Ronro gravatar image Ronro  ( 2021-09-06 13:54:12 -0600 )edit

So it did not change. I am thinking that the change will be in the node graph.

When I look at the node graph, there is no line extending from /map to any node. This means that no one is using the loaded map image, and we assume that this is one of the reasons for the anomaly.

miura gravatar image miura  ( 2021-09-06 18:00:02 -0600 )edit

Well...That´s kinda weird because our robot sometimes says that he is not on the costmap and he doesn´t plan anything :/

Ronro gravatar image Ronro  ( 2021-09-08 13:30:48 -0600 )edit

Are you able to see the map in rviz?

miura gravatar image miura  ( 2021-09-08 18:21:11 -0600 )edit

Question Tools

1 follower


Asked: 2021-08-31 17:47:31 -0600

Seen: 131 times

Last updated: Sep 01 '21