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

Disable global costmap

asked 2017-05-13 10:10:55 -0500

peterwe gravatar image

updated 2017-05-26 02:47:46 -0500

Hey everyone,

I am currently building a robot with its own global planner plugin. This means that the global planner does not need the global costmap any more, instead it takes a graph (based on a map) provided by a different node.

Now, I want the navigation stack to avoid building the global costmap because that would just waste computation power and time but I still need the map for localization purposes and to be shown in rviz for visualization and setting the start- and goal positions.

When I put this

<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

in my launch file, it will probably automatically produce my costmap, right? Or does it produce the costmap only when I plan my path on it?

Does this question with the answer of David Lu do what I want? He proposes to put this in the global_costmap.yaml to disable the obstacle avoidance:

    - {name: static_layer, type: 'costmap_2d::StaticLayer'}

I don't know if that is the right approach.


My global_costmap_params.yaml file:

  global_frame: /map
  robot_base_link: base_link
  update_frequency: 1.0
  publish_frequency: 0.5
  static_map: true
  rolling_window: false
  map_type: costmap
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2017-05-24 10:39:17 -0500

Procópio gravatar image

The costmap is not automatically produced by the publication of a map, but rather by the configuration of your global_costmap.

What David Lu suggests in the linked answer is to use only a static layer (coming from the published map) which would create a costmap from the publish map, which is not what you want.

I have never done this before so I do not know how it would behave, but you could try edit your global_costmap.yaml to have a minimal config, without any layer, for example:

  map_type: costmap
  global_frame    : map
  robot_base_frame: base_footprint

Again, I am not sure what the result will be, mostly because it depends on how your global planner plugin interacts with the global costmap.

edit flag offensive delete link more


As of kinetic without a plugin configuration a pre-hydro style costmap is configured.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-05-24 12:56:20 -0500 )edit

@Procópio : Thank you for your answer! In fact, I'm already using the minimal config you proposed and @Humpelstilzchen is right: a costmap is created with the minimal config I use (I've added my global_costmap_params.yaml file to my post).

peterwe gravatar image peterwe  ( 2017-05-26 02:44:46 -0500 )edit

My global planner does not need the global costmap at all. I just need the static map in the beginning to set my start and goal locations in rviz. And of course to make amcl work properly.

peterwe gravatar image peterwe  ( 2017-05-26 02:56:45 -0500 )edit

answered 2019-07-11 22:12:53 -0500

I'm just posting the solution I found here.

I disable the costmap scanning in the costmap_common_params.yaml. Set the value of marking to false or turn down the obstacle_range to value you want.

front_scan: {data_type: LaserScan, topic: movo/front_scan, marking: false, clearing: true, inf_is_valid: true, obstacle_range: 4.75, raytrace_range: 8.0}
rear_scan: {data_type: LaserScan, topic: movo/rear_scan, marking: false, clearing: true, inf_is_valid: true, obstacle_range: 4.75, raytrace_range: 8.0}
edit flag offensive delete link more

Question Tools



Asked: 2017-05-13 10:10:55 -0500

Seen: 1,589 times

Last updated: May 26 '17