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

can't manage to use costmap_2d individually (costmap_2d launch file)

asked 2016-06-15 04:36:13 -0500

bsk gravatar image

updated 2016-06-17 12:52:43 -0500

Hello,

i can create map with gmapping and hector_slam. since i dont have a robot system (just laser scanner) i'm just trying to use costmap_2d individually so i created a launch file (based on example.launch in costmap_2d launch directory)

while i was running gmapping (with laser scan matcher), in another terminal i run, "rosrun map_server map_server mymap.yaml" ...then my costmap.launch, didnt gave any error, but in rviz nothing has changed.

what am i missing? Should i add something to rviz to show costmap?

*note: i created launch directory in laser_scan_matcher in the first place so i continue to use that directory for creating new launch and yaml files for my case.

my costmap.launch file:

<launch>
 <!-- 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 laser_scan_matcher)/launch/myparams.yaml" command="load" ns="costmap" />
  </node>
</launch>

my params.yaml file:

global_frame: /map
robot_base_frame: base_link
update_frequency: 5.0
publish_frequency: 1.0

publish_voxel_map: true

static_map: false

map_type: voxel
origin_z: 0.0
z_resolution: 0.2
z_voxels: 10
unknown_threshold: 10
mark_threshold: 0

transform_tolerance: 0.3
obstacle_range: 2.5
max_obstacle_height: 2.0
raytrace_range: 3.0
footprint: [[-0.325, -0.325], [-0.325, 0.325], [0.325, 0.325], [0.46, 0.0], [0.325, -0.325]]
#robot_radius: 0.46
footprint_padding: 0.01
inflation_radius: 0.55
cost_scaling_factor: 10.0
lethal_cost_threshold: 100
observation_sources: base_scan
base_scan: {data_type: LaserScan, expected_update_rate: 0.4,
  observation_persistence: 0.0, marking: true, clearing: true, max_obstacle_height: 0.4, min_obstacle_height: 0.08}
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-06-17 15:06:31 -0500

David Lu gravatar image

You should use the costmap_2d_node node rather than costmap_2d_markers.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-06-15 04:36:13 -0500

Seen: 1,238 times

Last updated: Jun 17 '16