0
$\begingroup$

Rosanswers logo

Dear all,
I am using frontier_exploration+rtabmap slam+move_base for my robot autonomous exploration.

I have question about how costmap work?
Because when the slam algorithm do some mapping job.
(means map-> odom tf will be changed, and static map will rotate / shift I guess...)

(https://drive.google.com/file/d/0Bw2w48wxi6PLa3lMTi14cmpsY1U/view)
The static will rotate in the above picture.
But the costmap doesn't rotate to match the static.
It just add new inflation to costmap.
Does anyone how to make the costmap rotate with static map , or make the "old" costmap disappear?

common_costmap_params.yaml

# robot shape
robot_radius: 0.17

static_layer:
    map_topic: /map
    # first_map_only: false
    # subscribe_to_updates: false
    # track_unknown_space: true
    # use_maximum: false
    # lethal_cost_threshold: 100
    # unknown_cost_value: -1
    # trinary_costmap: true

obstacle_layer:
    track_unknown_space: true
    # transform_tolerance: 0.2
    observation_sources: laser_scan_sensor
    laser_scan_sensor: 
        topic:                      /center/laser_scan
        # sensor_frame:               "" # leave empty to read from sensor data
        # observation_persistence:    0.0
        # expected_update_rate:       0.0
        data_type:                  LaserScan
        # min_obstacle_height:        0.0
        # max_obstacle_height:        2.0
        inf_is_valid:               true
        clearing:                   true
        marking:                    true
        obstacle_range:             3.0 # laser_max_range
        raytrace_range:             3.0 # laser_max_range
        
inflation_layer:
    inflation_radius: 0.25
    cost_scaling_factor: 0.0

global_costmap_params.yaml

global_costmap:
    # global_frame: map
    # robot_base_frame: base_link

    # rolling_window: false
    # track_unknown_space: false
    # always_send_full_costmap: false

    # pose_update_frequency: 10.0

    update_frequency: 1.0 # 5
    publish_frequency: 0.5 # 0
    transform_tolerance: 0.5 # 0.3

    # width: 10.0
    # height: 10.0
    # resolution: 0.05
    # origin_x: 0
    # origin_y: 0

    plugins: 
        # WARNING!! This order of layers (s->o->i) cant not be change
        - {name: static_layer,     type: "costmap_2d::StaticLayer"}
        - {name: obstacle_layer,   type: "costmap_2d::ObstacleLayer"}
        - {name: inflation_layer,  type: "costmap_2d::InflationLayer"}

local_costmap_params.yaml

local_costmap:
    global_frame: odom
    # robot_base_frame: base_link

    rolling_window: true
    # track_unknown_space: false
    # always_send_full_costmap: false

    # pose_update_frequency: 10.0

    update_frequency: 5.0 # 5
    publish_frequency: 2.0 # 0
    transform_tolerance: 0.5 # 0.3

    width: 3.0 
    height: 3.0 
    resolution: 0.05
    # origin_x: 0
    # origin_y: 0

    plugins: 
        - {name: obstacle_layer,   type: "costmap_2d::ObstacleLayer"}
        - {name: inflation_layer,  type: "costmap_2d::InflationLayer"}

    inscribed_radius: 0.17
    circumscribed_radius: 0.17

Originally posted by Jam on ROS Answers with karma: 77 on 2016-09-08

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

http://answers.ros.org/question/224528/clearing-of-obstacle-layer-in-the-layered_costmap/

using the move_base/clear_costmaps service of move_base solve my problem!


Originally posted by Jam with karma: 77 on 2016-09-19

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.