Ask Your Question
0

Trying to get our robot navigating

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

Ronro gravatar image

updated 2021-08-31 17:49:12 -0500

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_costmap:
  global_frame: world
  robot_base_frame: base_link
  update_frequency: 5.0
  static_map: true

Local costmap yaml

local_costmap:
  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

TrajectoryPlannerROS:
  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

<launch>
 <!--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>
  </node>
</launch>

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 ...
(more)
edit retag flag offensive close merge delete

Comments

Checking TF tree may help you discover something. TF tree can be created with rosrun tf view_frameswith all nodes up. ( ref http://wiki.ros.org/tf#view_frames )

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

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

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

I'm sorry. I overlooked it.

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

1 Answer

Sort by » oldest newest most voted
0

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

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_costmap:
  global_frame: world
  robot_base_frame: base_link
  update_frequency: 5.0
  static_map: true

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

  static_layer:
    map_topic: "map"
edit flag offensive delete link more

Comments

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

Ronro gravatar image Ronro  ( 2021-09-06 13:54:12 -0500 )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 -0500 )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 -0500 )edit

Are you able to see the map in rviz?

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 46 times

Last updated: Sep 01