Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Empty Costmap using PointCloud2

When I run rostopic echo /move_base/local_costmap/costmap, the costmap data is filled with zeros even though it has a pointcloud2 observation source. After testing obstacle_layer.cpp, I noticed ObstacleLayer::pointCloud2Callback is never being called, but maybe this isn't the issue. Below are all the costmap params and the two launch files I run at startup.

costmap_common_params.yaml:

obstacle_range: 25
raytrace_range: 25
footprint: [[1.65, 1.02], [2, 0], [1.65, -1.02], [-1.65,-1.02], [-1.65,1.02]]
footprint_padding: 1
inflation_radius: 6
max_obstacle_height: 100

observation_sources: velodyne

velodyne: {sensor_frame: velodyne, data_type: PointCloud2, topic: velodyne_points, marking: true, clearing: true, min_obstacle_height: -10, obstacle_range: 25, raytrace_range: 25}

plugins:
 - {name: obstacle, type: "costmap_2d::ObstacleLayer"}
 - {name: inflation, type: "costmap_2d::InflationLayer"}

obstacle:
  track_unknown_space: true

global_costmap_params.yaml:

global_costmap:
  global_frame: map
  robot_base_frame: base_link
  update_frequency: 1.0
  static_map: false
  rolling_window: true

local_costmap_params.yaml:

local_costmap:
  global_frame: odom
  robot_base_frame: base_link
  update_frequency: 1.0
  publish_frequency: 0.5
  static_map: false
  rolling_window: true
  width: 10.0
  height: 10.0
  resolution: 0.025
  origin_x: 0.0

move_base.launch:

<launch>
  <master auto="start"/>

  <!-- Run the map server -->
  <!--  <node name="map_server" pkg="map_server" type="map_server" args="$(find map_server)/tutorialMap.pgm 0.05"/> -->


  <!--- Run AMCL -->
  <!--  <include file="$(find amcl)/examples/amcl_omni.launch" /> -->

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find bolt_2dnav)/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find bolt_2dnav)/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find bolt_2dnav)/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find bolt_2dnav)/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find bolt_2dnav)/base_local_planner_params.yaml" command="load" />
    <param name="odom_frame_id" value="odom"/>
    <param name="base_frame_id" value="base_link"/>
    <param name="global_frame_id" value="map"/>
  </node>
</launch>
  origin_y: 0.0
  min_obstacle_height: -10.0

robot_configuration.launch:

<launch>
  <node pkg="robot_setup_tf" type="odom" name="odom" output="screen">
  </node>

  <node pkg="robot_setup_tf" type="tf_broadcaster" name="tf_broadcaster" output="screen">
  </node>

  <!-- <param name ="/use_sim_time" value="true"/> -->

  <node pkg="tf" type="static_transform_publisher" name="map_odom_tf_broadcaster" args="0 0 0 0 0 0 1 map odom 10" />

</launch>

Empty Costmap using PointCloud2

When I run rostopic echo /move_base/local_costmap/costmap, the costmap data is filled with zeros even though it has a pointcloud2 observation source. After testing obstacle_layer.cpp, I noticed ObstacleLayer::pointCloud2Callback is never being called, but maybe this isn't the issue. Below are all the costmap params and the two launch files I run at startup.

costmap_common_params.yaml:

obstacle_range: 25
raytrace_range: 25
footprint: [[1.65, 1.02], [2, 0], [1.65, -1.02], [-1.65,-1.02], [-1.65,1.02]]
footprint_padding: 1
inflation_radius: 6
max_obstacle_height: 100

observation_sources: velodyne

velodyne: {sensor_frame: velodyne, data_type: PointCloud2, topic: velodyne_points, marking: true, clearing: true, min_obstacle_height: -10, obstacle_range: 25, raytrace_range: 25}

plugins:
 - {name: obstacle, type: "costmap_2d::ObstacleLayer"}
 - {name: inflation, type: "costmap_2d::InflationLayer"}

obstacle:
  track_unknown_space: true

global_costmap_params.yaml:

global_costmap:
  global_frame: map
  robot_base_frame: base_link
  update_frequency: 1.0
  static_map: false
  rolling_window: true

local_costmap_params.yaml:

local_costmap:
  global_frame: odom
  robot_base_frame: base_link
  update_frequency: 1.0
  publish_frequency: 0.5
  static_map: false
  rolling_window: true
  width: 10.0
  height: 10.0
  resolution: 0.025
  origin_x: 0.0

move_base.launch:

<launch>
  <master auto="start"/>

  <!-- Run the map server -->
  <!--  <node name="map_server" pkg="map_server" type="map_server" args="$(find map_server)/tutorialMap.pgm 0.05"/> -->


  <!--- Run AMCL -->
  <!--  <include file="$(find amcl)/examples/amcl_omni.launch" /> -->

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find bolt_2dnav)/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find bolt_2dnav)/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find bolt_2dnav)/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find bolt_2dnav)/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find bolt_2dnav)/base_local_planner_params.yaml" command="load" />
    <param name="odom_frame_id" value="odom"/>
    <param name="base_frame_id" value="base_link"/>
    <param name="global_frame_id" value="map"/>
  </node>
</launch>
  origin_y: 0.0
  min_obstacle_height: -10.0

robot_configuration.launch:

<launch>
  <node pkg="robot_setup_tf" type="odom" name="odom" output="screen">
  </node>

  <node pkg="robot_setup_tf" type="tf_broadcaster" name="tf_broadcaster" output="screen">
  </node>

  <!-- <param name ="/use_sim_time" value="true"/> -->

  <node pkg="tf" type="static_transform_publisher" name="map_odom_tf_broadcaster" args="0 0 0 0 0 0 1 map odom 10" />

</launch>