Ask Your Question
0

How does costmap determine its orientation?

asked 2017-04-03 12:51:55 -0500

sterlingm gravatar image

updated 2017-04-03 12:53:14 -0500

Hi,

I have tried to publish a frame specifically to make a costmap be oriented in the way that I want, but it seems that the costmap is always oriented to the "map" tf, even when I specify a different global frame in the costmap's yaml file.

In the image below, you can see that the costmap is aligned with map:

image description

However, in the yaml file, I do not have "map" as the global frame. I specify "map_new" as the global frame. This frame is one that I publish specifically for the costmap to have a different orientation. In this image, you can see that "map_new" is significantly different than "map", and that the costmap is not aligned with "map_new" at all:

image description

Here is the yaml file for the costmap:

costmap:
    plugins:
        - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
        - {name: inflation_layer, type: "costmap_2d::InflationLayer"}
    global_frame: /map_new
    robot_base_frame: /base_link
    static_map: true
    rolling_window: false
    resolution: 0.01
    update_frequency: 20
    publish_frequency: 20
    width: 3
    height: 3
    origin_x: 0
    origin_y: 0
    obstacle_range: 10.0
    raytrace_range: 10.0
    transform_tolerance: 2.0
    robot_radius: 0.225
    always_send_full_costmap: true

    inflation_layer:
      enabled: true
      inflation_radius: 0.1

   obstacle_layer:
     enabled: true
     origin_z: 0.0
     z_voxels: 2
     max_obstacle_height: 1.4
     observation_sources: scan bump
     scan:
       data_type: LaserScan
       topic: scan_filtered
       marking: true
       clearing: true
       min_obstacle_height: 0.0
       max_obstacle_height: 0.35
     bump:
       data_type: PointCloud2
       topic: mobile_base/sensors/bumper_pointcloud
       marking: true
       clearing: true
       min_obstacle_height: 0.0
       max_obstacle_height: 0.15

The "map_new" frame uses "map" as its parent, but since I specify "map_new" as the global frame, I would expect the costmap to be aligned with "map_new". How does the costmap determine which frame it will align its axes with?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-04-04 14:30:49 -0500

sterlingm gravatar image

This was caused by overriding the parameter in the launch file:

  <node name="costmap_node" pkg="costmap_2d" type="costmap_2d_node" output="screen" >
    <rosparam file="../param/my_costmap_config.yaml" command="load" />
    <param name="costmap/global_frame" value="map" />
  </node>

I didn't realize that I was doing this. When I remove the line

 <param name="costmap/global_frame" value="map" />

The costmap is oriented as expected:

image description

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-04-03 12:51:55 -0500

Seen: 444 times

Last updated: Apr 04 '17