0
$\begingroup$

Rosanswers logo

Hi there, I used navigation stack wit move base on my lidar. It could generate path to the goal, and display global costmap, However, the local costmap is empty with zeros, while the lidar has data generated (non-zeros). I searched around and people suggesting that the min. obstacle height and max. obstacle height of the laser scan is the problem, I tried it out, but it still doesn't work, could anyone kindly advise what I could change?

base_local_planner_params.yaml:

TrajectoryPlannerROS:
  max_vel_x: 0.45
  min_vel_x: 0.1
  max_vel_theta: 1.0
  min_in_place_vel_theta: 0.4

  acc_lim_theta: 3.2
  acc_lim_x: 2.5
  acc_lim_y: 2.5

  holonomic_robot: false

costmap_common_params.yaml:

obstacle_range: 2.5
raytrace_range: 3.0
footprint: [[-0.305, -0.18], [-0.305, 0.18], [0.305, 0.18], [0.305, -0.18]]
#robot_radius: ir_of_robot
inflation_radius: 0.55

observation_sources: laser_scan_sensor #point_cloud_sensor

laser_scan_sensor: {sensor_frame: frame_name, data_type: LaserScan, topic: topic_name, marking: true, clearing: true}

#point_cloud_sensor: {sensor_frame: frame_name, data_type: PointCloud, topic: topic_name, marking: true, clearing: true}

global_costmap_params.yaml:

global_costmap:
    footprint: [[-0.305, -0.18], [-0.305, 0.18], [0.305, 0.18], [0.305, -0.18]]
    footprint_padding: 0.01
    transform_tolerance: 1.0
    update_frequency: 5.0
    publish_frequency: 5.0

    global_frame: map
    robot_base_frame: base_footprint
    resolution: 0.05

    rolling_window: false
    track_unknown_space: true

    plugins: 
        - {name: static,    type: "costmap_2d::StaticLayer"}            
        - {name: sensor,    type: "costmap_2d::ObstacleLayer"}
        - {name: inflation, type: "costmap_2d::InflationLayer"}

    static:        
        map_topic: /map 
        subscribe_to_updates: true

    sensor:
        observation_sources: laser_scan_sensor
        laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true}

    inflation:
        inflation_radius: 2.5
        cost_scaling_factor: 6.0

local_costmap_params.yaml:

local_costmap:
    footprint: [[-0.305, -0.18], [-0.305, 0.18], [0.305, 0.18], [0.305, -0.18]]
    footprint_padding: 0.01
    transform_tolerance: 1.0
    update_frequency: 10.0
    publish_frequency: 10.0

    global_frame: /odom
    robot_base_frame: /base_footprint
    resolution: 0.05
    static_map: false
    rolling_window: true
    width: 2.0
    height: 2.0
    resolution: 0.1

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

    sensor:
        observation_sources: laser_scan_sensor
        laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true, max_obstacle_height: 2.0, min_obstacle_height: 0.0, inf_is_valid: true}

    inflation:
        inflation_radius: 2.5
        cost_scaling_factor: 8.0

Originally posted by IvyKK on ROS Answers with karma: 39 on 2019-03-27

Post score: 0


Original comments

Comment by gvdhoorn on 2019-03-27:\

An inflation_radius of 2.5 is very high, the unit is meter you should have something equivalent to the size of your robot

Or the robot is just really big and clunky, and 2.5m is really needed to avoid it running into things .. ;)

Comment by Delb on 2019-03-27:
That would be a really clunky robot indeed, and I wouldn't get one :)

Comment by IvyKK on 2019-03-28:
Yes. Thanks!! that's the problem.. I reorganized the code and it works okay now!

Comment by Delb on 2019-03-28:
Can you answer your own question specifying what exactly solved the issue ? Was it the code organization or just the inflation radius (or both) ?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

There are few things to say (not sure if they are causing the issue though but that would improve your code):

  • You should reorganize your files to actually have the common params only in the costmap_commons_param.yaml. For example the footprint doesn't have to be in your 3 files.
  • An inflation_radius of 2.5 is very high, the unit is meter you should have something equivalent to the size of your robot (in your case it should be around 0,35 if you allow the robot to be close to the obstacles).
  • You have defined the resolution twice with different values in the local_costmap file.

Originally posted by Delb with karma: 3907 on 2019-03-27

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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