Ask Your Question

Error with robot localization and global costmap

asked 2020-06-30 14:18:34 -0600

ildaniel gravatar image

I am trying to make the husky robot automatically explore a map with the explore_lite package. I use melodic on 18.04 and the melodic-devel branches of each package. In new terminals, running source ~/husky_ws/devel/setup.bash in each, I command:

roslaunch husky_gazebo husky_playpen.launch
roslaunch husky_viz view_robot.launch
roslaunch husky_navigation gmapping.launch
roslaunch explore_lite explore.launch
rosrun move_base move_base

But the robot is not moving at all. I believe the error is in the move_base. In the terminal where i rosrun move_base, I am presented with the following errors:

[ WARN] [1593544033.915079325, 1332.320000000]: 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 1332.32 timeout was 0.1.
[ WARN] [1593544034.006702075, 1332.410000000]: global_costmap: Parameter "plugins" not provided, loading pre-Hydro parameters
[ INFO] [1593544034.010755084, 1332.410000000]: global_costmap: Using plugin "obstacle_layer"
[ INFO] [1593544034.015935843, 1332.420000000]:     Subscribed to Topics: 
[ INFO] [1593544034.025307642, 1332.430000000]: global_costmap: Using plugin "inflation_layer"
[ WARN] [1593544034.057914201, 1332.460000000]: local_costmap: Parameter "plugins" not provided, loading pre-Hydro parameters
[ INFO] [1593544034.061554747, 1332.460000000]: local_costmap: Using plugin "obstacle_layer"
[ INFO] [1593544034.063402066, 1332.460000000]:     Subscribed to Topics: 
[ INFO] [1593544034.069645113, 1332.470000000]: local_costmap: Using plugin "inflation_layer"
[ INFO] [1593544034.099377919, 1332.500000000]: Created local_planner base_local_planner/TrajectoryPlannerROS
[ INFO] [1593544034.103176506, 1332.500000000]: Sim period is set to 0.05
[ WARN] [1593544034.108479008, 1332.510000000]: Trajectory Rollout planner initialized with param meter_scoring not set. Set it to true to make your settings robust against changes of costmap resolution.
[ INFO] [1593544034.300935520, 1332.700000000]: Recovery behavior will clear layer 'obstacles'
[ INFO] [1593544034.305790806, 1332.710000000]: Recovery behavior will clear layer 'obstacles'

Then it rapidly prints the following error over and over again:

The robot's start position is off the global costmap. Planning will always fail, are you sure the robot has been properly localized?
The robot's start position is off the global costmap. Planning will always fail, are you sure the robot has been properly localized?
The robot's start position is off the global costmap. Planning will always fail, are you sure the robot has been properly localized?

The robot is centrally located on the map, and I even removed a nearby obstacle so it has room to move around. Any direction with this is greatly appreciated!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-06-30 16:45:38 -0600

renangm gravatar image

After replicating your setup, I can see there are two issues:

1) There are no costmaps being generated in your setup, because the costmap parameters are not being loaded. Typically we load these parameters from YAML files. Conveniently, the husky robot stack in melodic has a husky_navigation package, with a move_base.launch file that loads some YAML parameters. You could run that instead of just the move_base node. The husky navigation package has other interesting launch files, you can have a look at them here.

2) move_base is subscribing to an /odom topic by default, which is not published in your setup. Instead, the ekf_localization publishes an /odometry/filtered topic. You can change the subscribed odometry topic through the "odom_topic" parameter (in command line or the launch file), or remap the topic when calling the move_base launcher:

$ roslaunch husky_navigation move_base.launch /odom:=/odometry/filtered

After doing these two things, move_base should begin receiving plans and the robot should begin moving in gazebo. Hope this helps!

edit flag offensive delete link more


I implemented your step 1) and it does now (partially) work, thank you so much! I actually didn't see any '/odom' in move_base.launch and it appears move_base is still subscribed to /odom (rostopic info /odom) and that ekf_localization is publishing /odometry/filtered .

The robot actually drives around a little bit within a small area, but then decides exploration is complete and sits still. This may be an unrelated question having to do with the explore_lite itself, but probably still worth noting. Thanks again for your trouble!

ildaniel gravatar image ildaniel  ( 2020-06-30 17:27:53 -0600 )edit

Great to hear! You can change the move_base odom topic by remapping it inside the husky_navigation launch file. The command is <remap from="topic1" to="topic2" />, for example. If modifying the husky_navigation launch file directly, include the remap command between the <node name=move_base... and </node> tags. But even with the wrong odom, the robot maps the whole environment here in my linux. In your case, maybe it's something else like, as you said, a glitch with the explore_lite node.

renangm gravatar image renangm  ( 2020-06-30 17:53:32 -0600 )edit

I made that change (and also added an object back into the .world that I had previously removed) and it now works like a charm. You're the best!

ildaniel gravatar image ildaniel  ( 2020-06-30 19:17:07 -0600 )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


Asked: 2020-06-30 14:18:34 -0600

Seen: 207 times

Last updated: Jun 30