zkytony / ROSNavigationGuide

A guide for ROS navigation tuning | demo: https://youtu.be/1-7GNtR6gVk
114 stars 41 forks source link

Dynamic obstacle avoidance is not possible during navigation #4

Open GanJie-SEU opened 2 years ago

GanJie-SEU commented 2 years ago

When I use my own robot model for navigation, I can only carry out global path planning, but can not carry out dynamic obstacle avoidance. After adding an obstacle to gazebo, rviz can scan the obstacle, but cannot avoid it dynamically. In local_ There is no costmap showing local obstacles in costmap.

The following is the output of the terminal

[ INFO] [1650278048.203346998]: Requesting the map...
[ WARN] [1650278048.204495079]: Request for map failed; trying again...
[ WARN] [1650278048.382385700, 319.126000000]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 319.126 timeout was 0.1.
[ INFO] [1650278049.000633452, 319.718000000]: Received a 1984 X 1984 map @ 0.050 m/pix

[ INFO] [1650278049.541249018, 320.223000000]: Initializing likelihood field model; this can take some time on large maps...
[ INFO] [1650278049.707587658, 320.381000000]: Done initializing likelihood field model.
[ WARN] [1650278049.773666357, 320.440000000]: global_costmap: Pre-Hydro parameter "map_type" unused since "plugins" is provided
[ INFO] [1650278049.774419936, 320.441000000]: global_costmap: Using plugin "static_layer"
[ INFO] [1650278049.779203944, 320.445000000]: Requesting the map...
[ INFO] [1650278050.063882197, 320.698000000]: Resizing costmap to 1984 X 1984 at 0.050000 m/pix
[ INFO] [1650278050.116358374, 320.751000000]: Received a 1984 X 1984 map at 0.050000 m/pix
[ INFO] [1650278050.118422760, 320.753000000]: global_costmap: Using plugin "obstacle_layer"
[ INFO] [1650278050.132122465, 320.769000000]:     Subscribed to Topics: scan bump lds
[ INFO] [1650278050.323435180, 320.955000000]: global_costmap: Using plugin "inflation_layer"
[ INFO] [1650278050.343791245, 320.977000000]: RRT* planner initialized successfully
[ WARN] [1650278050.345983190, 320.979000000]: local_costmap: Pre-Hydro parameter "map_type" unused since "plugins" is provided
[ INFO] [1650278050.346403652, 320.980000000]: local_costmap: Using plugin "obstacle_layer"
[ INFO] [1650278050.348114528, 320.982000000]:     Subscribed to Topics: scan bump lds
[ INFO] [1650278050.369217527, 321.006000000]: local_costmap: Using plugin "inflation_layer"
[ INFO] [1650278050.392557083, 321.028000000]: Created local_planner dwa_local_planner/DWAPlannerROS
[ INFO] [1650278050.401583916, 321.034000000]: Sim period is set to 0.20
[ INFO] [1650278050.741151969, 321.362000000]: Recovery behavior will clear layer 'obstacles'
[ INFO] [1650278050.743895496, 321.365000000]: Recovery behavior will clear layer 'obstacles'
[ INFO] [1650278050.771401797, 321.395000000]: odom received!
[ WARN] [1650278051.064555020, 321.686000000]: The origin for the sensor at (0.04, -0.00, 0.80) is out of map bounds. So, the costmap cannot raytrace for it.
[ WARN] [1650278052.177060287, 322.686000000]: The origin for the sensor at (0.04, -0.00, 0.80) is out of map bounds. So, the costmap cannot raytrace for it.
[ WARN] [1650278053.270416825, 323.686000000]: The origin for the sensor at (0.04, -0.00, 0.80) is out of map bounds. So, the costmap cannot raytrace for it.

Here are my costmap parameters

max_obstacle_height: 1.0  # assume something like an arm is mounted on top of the robot

# Obstacle Cost Shaping (http://wiki.ros.org/costmap_2d/hydro/inflation)
#robot_radius: 0.7  # distance a circular robot should be clear of the obstacle (kobuki: 0.18)
# footprint: [[x0, y0], [x1, y1], ... [xn, yn]]  # if the robot is not circular
footprint: [[0.4, 0.5], [0.4, -0.5], [-0.7, -0.5], [-0.7, 0.5]]

#map_type: voxel
map_type: costmap

  # 导航包所需要的传感器

obstacle_layer:
  enabled:              true
  max_obstacle_height:  0.8
  origin_z:             0.0
  z_resolution:         0.2
  z_voxels:             2
  unknown_threshold:    15
  mark_threshold:       0
  combination_method:   1
  track_unknown_space:  true    #true needed for disabling global path planning through unknown space
  obstacle_range: 2.5
  raytrace_range: 3.0
  origin_z: 0.0
  z_resolution: 0.2
  z_voxels: 2
  publish_voxel_map: false
  observation_sources: scan bump lds    
  scan:
    sensor_frame: lidar_link
    data_type: LaserScan
    topic: scan
    marking: true
    clearing: true
    inf_is_valid: true
    min_obstacle_height: 0
    max_obstacle_height: 0.8
  bump:
    data_type: PointCloud2
    topic: mobile_base/sensors/bumper_pointcloud
    marking: true
    clearing: false
    min_obstacle_height: 0.0
    max_obstacle_height: 1.0
  # for debugging only, let's you see the entire voxel grid
  lds:                       
    data_type: LaserScan
    topic: scan
    marking: true
    clearing: true
    min_obstacle_height: 0.0       
    max_obstacle_height: 1.0 

# cost_scaling_factor and inflation_radius were now moved to the inflation_layer ns
inflation_layer:
  enabled:              true
  cost_scaling_factor:  5.0  # exponential rate at which the obstacle cost drops off (default: 10)
  inflation_radius:     1.0  # max. distance from an obstacle at which costs are incurred for planning paths.

static_layer:
  enabled:              true
  cost_scaling_factor:  3.0 
  inflation_radius:     0.5
zkytony commented 2 years ago

My guess is either (1) the local costmap isn't receiving messages through the sensor topics, or (2) the parameters are not in the correct namespace so they are not loaded correctly.

ROS Answers is a better place to find answers or ask questions like this!

GanJie-SEU commented 2 years ago

Thank you for your answer. The topic of my costmap parameter subscription is the lidar publishing topic, and the lidar publishing topic also publishes data. I don't quite understand what you said about not receiving data and incorrect namespace for parameters. As for the ROS Answers you mentioned, I will go to this website to inquire. Thank you again for your answer!!!

@.***

@.*** |

---- 回复的原邮件 ---- | 发件人 | Kaiyu @.> | | 日期 | 2022年04月18日 21:22 | | 收件人 | @.> | | 抄送至 | @.**@.> | | 主题 | Re: [zkytony/ROSNavigationGuide] Dynamic obstacle avoidance is not possible during navigation (Issue #4) |

My guess is either (1) the local costmap isn't receiving messages through the sensor topics, or (2) the parameters are not in the correct namespace so they are not loaded correctly.

ROS Answers is a better place to find answers or ask questions like this!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>