ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Global Costmap not visualized

asked 2013-09-25 00:24:00 -0500

dneuhold gravatar image


I tried to visualize the costmap in RVIZ. The local costmap is published and visualized, while the global costmap doesn't publish any data. Since RVIZ is able to find the global costmap topic, I assume that it is advertised but no data are transmitted (no messages are received).

I use the following configuration:

  • cost_scaling_factor: 10.0
  • footprint: '[]'
  • global_frame: /map
  • height: 20
  • inflation_radius: 0.5
  • lethal_cost_threshold: 100
  • map_topic: map
  • map_type: costmap
  • mark_threshold: 0
  • max_obstacle_height: 0.6
  • max_obstacle_range: 20
  • observation_sources: scan
  • obstacle_range: 20
  • origin_x: 0.0
  • origin_y: 0.0
  • origin_z: 0.0
  • publish_frequency: 1.0
  • publish_voxel_map: false
  • raytrace_range: 3.0
  • resolution: 0.05
  • restore_defaults: false
  • robot_base_frame: /base_footprint
  • robot_radius: 0.18
  • rolling_window: false
  • scan: {clearing: true, data_type: LaserScan, marking: true, topic: /scan}
  • static_map: true
  • track_unknown_space: true
  • transform_tolerance: 0.5
  • unknown_cost_value: 255
  • unknown_threshold: 255
  • update_frequency: 1.0
  • width: 20
  • z_resolution: 0.2
  • z_voxels: 10

Hopefully someone could help or give me a hint.

Thanks, Daniel

edit retag flag offensive close merge delete


Not sure about this, but have you tried setting publish_voxel_map to true?

Hendrik Wiese gravatar image Hendrik Wiese  ( 2013-09-25 00:33:07 -0500 )edit

Unfortunately the global_costmap is still not published! I appreciate every hint or idea to visualize it in rviz.

dneuhold gravatar image dneuhold  ( 2013-09-26 22:15:56 -0500 )edit

What I meant with my (deleted) comment was: could you provide the whole costmap configuration file as it is. Not just the settings as they should be. Maybe there's another namespace issue...

Hendrik Wiese gravatar image Hendrik Wiese  ( 2013-09-26 23:09:50 -0500 )edit

What is the global topic you are listening on?

David Lu gravatar image David Lu  ( 2013-09-27 05:58:53 -0500 )edit

The topic I am listening on is: /move_base/global_costmap/obstacles The topic is "ok" (in rviz) but no messages are received. There is also no namespace issue, I checked every parameter twice. Thanks to all of you

dneuhold gravatar image dneuhold  ( 2013-09-29 19:15:32 -0500 )edit

You might want to check that the publish_frequency is > 0.0 for the global costmap, when running the system. The safest way would be to dump the params, while it's running, so you see what's really going on.

dornhege gravatar image dornhege  ( 2013-09-30 00:13:45 -0500 )edit

Which version of ROS are you using?

David Lu gravatar image David Lu  ( 2013-09-30 04:12:40 -0500 )edit

I use ROS groovy!

dneuhold gravatar image dneuhold  ( 2013-09-30 04:34:14 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2013-11-04 21:33:37 -0500

dneuhold gravatar image

Hi, after some time trying to set the parameters correctly I realized that they are correct. But I localized the problem ... Since I configure all parameters directly from my code (with setparam("")) I assumed that this is the last instance which configures the parameters. If I perform a "rosparam get" in the console, all parameters are set according to the code.

But it seems that there is a bug ... a launch file from /move_base/global_costmap overwrites my parameters WITHOUT signalizing this on a "rosparam get"!!! So I just changed the publish_frequency there and everything worked fine! :)

Hopefully this helps you solving similar problems.

BR, Daniel

edit flag offensive delete link more

answered 2013-09-29 23:28:37 -0500

dneuhold gravatar image

updated 2013-09-29 23:34:05 -0500

Here is my configuration, actually I tried to set the parameters directly from the code (to make sure that no launch file overwrites the parameters).

nh.setParam("/move_base/local_costmap/update_frequency",1); nh.setParam("/move_base/local_costmap/static_map",false); nh.setParam("/move_base/local_costmap/rolling_window",true); nh.setParam("/move_base/local_costmap/width",10);
nh.setParam("/move_base/local_costmap/height",10); nh.setParam("/move_base/local_costmap/track_unknown_space",true); nh.setParam("/move_base/local_costmap/obstacle_range",10); nh.setParam("/move_base/local_costmap/raytrace_range",10); nh.setParam("/move_base/local_costmap/unknown_cost_value",255); nh.setParam("/move_base/local_costmap/unknown_threshold",255); nh.setParam("/move_base/local_costmap/publish_frequency",1);

nh.setParam("/move_base/global_costmap/update_frequency",1); nh.setParam("/move_base/global_costmap/static_map",true); nh.setParam("/move_base/global_costmap/rolling_window",false); nh.setParam("/move_base/global_costmap/width",200);
nh.setParam("/move_base/global_costmap/height",200); nh.setParam("/move_base/global_costmap/track_unknown_space",true); nh.setParam("/move_base/global_costmap/obstacle_range",10); nh.setParam("/move_base/global_costmap/raytrace_range",10); nh.setParam("/move_base/global_costmap/unknown_cost_value",255); nh.setParam("/move_base/global_costmap/unknown_threshold",255); nh.setParam("/move_base/global_costmap/publish_frequency",1);

nh.setParam("/move_base/TrajectoryPlannerROS/xy_goal_tolerance",0.1); nh.setParam("/move_base/TrajectoryPlannerROS/goal_distance_bias",0.5); nh.setParam("/move_base/TrajectoryPlannerROS/path_distance_bias",0.8);


I know that this solution may not be the best but all parameters are set the way I want them to be set during run time.

Thanks for all your contributions!

BR, Daniel

edit flag offensive delete link more



Please do not create answers for discussion or comments. Instead, edit and append to your original post.

dornhege gravatar image dornhege  ( 2013-09-30 00:12:46 -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



Asked: 2013-09-25 00:24:00 -0500

Seen: 1,790 times

Last updated: Nov 04 '13