Robotics StackExchange | Archived questions

Ros Navigation - Global costmap not seen on rviz and not used for global planning

I am using the ros navigation stack to navigate my robot using a known map. I have set up all my config files as shown in the tutorials. But when i launch move_base, I see only the local costmap on rviz. When i give a goal, only the local costmap is used for planning(both local and global). the global plnner plans through the obstacles that are on the global costmap but do not appear on the local costmap. Below are my yaml files:

Baselocalplanner_params.yaml

TrajectoryPlannerROS:
  max_vel_x: 0.6
  min_vel_x: 0.12
  max_vel_theta: 0.15
  min_in_place_vel_theta: 0.1

  acc_lim_theta: 1.0
  acc_lim_x: 2.5
  acc_lim_y: 2.5

  holonomic_robot: false

Costmapcommonparams

obstacle_range: 5.0
raytrace_range: 3.0
footprint: [ [0.0, 0.5], [0.0, -0.5], [-1.0, -0.5], [-1.0, 0.5] ]
inflation_radius: 0.3
transform_tolerance: 0.2

observation_sources:  point_cloud_sensor
point_cloud_sensor: {sensor_frame: velodyne, data_type: PointCloud2, topic: velodyne_points, marking: true, clearing: `true}`

Globalcostmapparams

global_costmap:
  global_frame: /map
  robot_base_frame: base_link
  update_frequency: 5.0
  static_map: true

Localcostmapparams

global_costmap:
  global_frame: /map
  robot_base_frame: base_link
  update_frequency: 5.0
  static_map: true

move_base

<launch>

   <master auto="start"/>
 <!-- Run the map server --> 
    <arg name="map" default="$(find my_robot_name_2dnav)/aug1_map1.yaml" /> 
    <node name="map_server" pkg="map_server" type="map_server" args="$(arg map)"/>

   <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find my_robot_name_2dnav)/costmap_params.yaml" command="load" ns="global_costmap" /> 
    <rosparam file="$(find my_robot_name_2dnav)/costmap_params.yaml" command="load" ns="local_costmap" />


     [<rosparam file="$(find my_robot_name_2dnav)/local_costmap_params_basic.yaml" command="load" />
        <rosparam file="$(find my_robot_name_2dnav)/global_costmap_params_basic.yaml" command="load" /> 
        <rospara

m file="$(find my_robot_name_2dnav)/base_local_planner_params_basic.yaml" command="load" />
 </node>

</launch>]

Link to images: Rviz Costmap 1 Rviz Costmap 2

When i launch move base, I get the following:

    process[map_server-1]: started with pid [17078]
process[move_base-2]: started with pid [17079]
[ INFO] [1534368364.047088034]: Using plugin "obstacle_layer"
[ INFO] [1534368364.053267464]:     Subscribed to Topics: point_cloud_sensor
[ INFO] [1534368364.134737032]: Using plugin "inflation_layer"
[ INFO] [1534368364.286482803]: Using plugin "obstacle_layer"
[ INFO] [1534368364.290238877]:     Subscribed to Topics: point_cloud_sensor
[ INFO] [1534368364.360609173]: Using plugin "inflation_layer"
[ INFO] [1534368364.466953814]: Created local_planner base_local_planner/TrajectoryPlannerROS
[ INFO] [1534368364.488073750]: Sim period is set to 0.10
[ INFO] [1534368364.864098849]: Recovery behavior will clear layer obstacles
[ INFO] [1534368364.873908575]: Recovery behavior will clear layer obstacles
[ INFO] [1534368364.999236758]: odom received!

EDIT

After adding the following to costmapcommonparmas as in link to ros answer post :

recovery_behaviors:
    name: 'costmap_reset_conservative'
    type: 'clear_costmap_recovery/ClearCostmapRecovery'
costmap_reset_conservative:
  reset_distance: 1.5
  layer_names: ["obstacle_layer"]

I still did not see any changes.

Next, I set the clearing parameter in the following in costmapcommonparams from true to false:

point_cloud_sensor: {sensor_frame: velodyne, data_type: PointCloud2, topic: velodyne_points, marking: true, clearing: false}

With that, I was now able to see the global costmap, but my global planner still planned through the obstacles in the global costmap. Please see image in Rviz Costmap 3

Asked by kllysin on 2018-08-15 15:45:25 UTC

Comments

Answers

@kllysin Hello! did you manage to figure this out? A few things that came to my mind after reading this, let me know if these match to what your solution was :

  1. Your local costmap params and global costmap params in the answer are exactly same but I am assuming this is a typo mistake
  2. In the global costmap params, to my knowledge if you want to add a known map as a layer to the global costmap you need to specify it as a plugin apart from setting the static_map parameter to true as follows :

    plugins:

    • {name: static_layer, type: "costmap_2d::StaticLayer"}
  3. Then you can also choose from the static map layer parameters from http://wiki.ros.org/costmap_2d/hydro/staticmap that you want to specify in the global costmap params too. This is especially important because you need to point your static layer to listen to the right topic wherever your known map is getting published. Sample :

static_layer: map_topic: /my_topic_name

Asked by indraneel on 2020-12-19 09:33:14 UTC

Comments