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

Revision history [back]

click to hide/show revision 1
initial version

UPDATE: I can actually have a completely blank map by using the two files I attach below. Could someone please help me in understanding why I cannot obtain a 2D local costmap?

Launch file

<launch>
  <param name="/use_sim_time" value="true"/>

  <!-- Publishes the voxel grid to rviz for display -->
  <node pkg="costmap_2d" type="costmap_2d_markers" name="voxel_visualizer">
    <remap from="voxel_grid" to="costmap/voxel_grid"/>
  </node>

  <!-- Run the costmap node -->
  <node name="costmap_node" pkg="costmap_2d" type="costmap_2d_node" >
    <rosparam file="$(find costmap_2d)/launch/example_params.yaml" command="load" ns="costmap" />
  </node>

</launch>

.yaml file

global_frame: velodyne
robot_base_frame: velodyne
footprint: [
    # tail
    [-0.25, -0.25],
    [-0.25, 0.25],
    # nose
    [0.25, 0.5],
    [0.25, 0.00],
    [0.25, -0.5]
    ]

transform_tolerance: 5
rolling_window: true

resolution: 0.05
publish_frequency: 1.0
update_frequency: 1.0

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

inflation:
  enabled:              true
  cost_scaling_factor:  5.0  
  inflation_radius:     0.5 

obstacles:
  enabled: true
  track_unkown_space: false
  observation_sources: velodyne
  velodyne: {
    observation_persistance: 0.5,
    sensor_frame: velodyne,
    data_type: PointCloud2,
    topic: velodyne_points,
    marking: true,
    clearing: true,
    expected_update_rate: 0.1,
    min_obstacle_height: 0.0,
    max_obstacle_height: 5
  }

Thank you.

UPDATE: Using "use_simtime = true" as suggested by @Dragonslayer , I can actually have a published map, but it is completely blank map by blank. I am using the two files I attach below. Could someone please help me in understanding why I cannot obtain a 2D local costmap?

Launch file

<launch>
  <param name="/use_sim_time" value="true"/>

  <!-- Publishes the voxel grid to rviz for display -->
  <node pkg="costmap_2d" type="costmap_2d_markers" name="voxel_visualizer">
    <remap from="voxel_grid" to="costmap/voxel_grid"/>
  </node>

  <!-- Run the costmap node -->
  <node name="costmap_node" pkg="costmap_2d" type="costmap_2d_node" >
    <rosparam file="$(find costmap_2d)/launch/example_params.yaml" command="load" ns="costmap" />
  </node>

</launch>

.yaml file

global_frame: velodyne
robot_base_frame: velodyne
footprint: [
    # tail
    [-0.25, -0.25],
    [-0.25, 0.25],
    # nose
    [0.25, 0.5],
    [0.25, 0.00],
    [0.25, -0.5]
    ]

transform_tolerance: 5
rolling_window: true

resolution: 0.05
publish_frequency: 1.0
update_frequency: 1.0

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

inflation:
  enabled:              true
  cost_scaling_factor:  5.0  
  inflation_radius:     0.5 

obstacles:
  enabled: true
  track_unkown_space: false
  observation_sources: velodyne
  velodyne: {
    observation_persistance: 0.5,
    sensor_frame: velodyne,
    data_type: PointCloud2,
    topic: velodyne_points,
    marking: true,
    clearing: true,
    expected_update_rate: 0.1,
    min_obstacle_height: 0.0,
    max_obstacle_height: 5
  }

Thank you.