I'm currently facing challenges with the local planner in ROS2's Navigation stack, which is ineffectively distorting the global plan to avoid obstacles as displayed in these videos:

GPS ok But Local Planner does not avoid obstacles Pre mapped spod issue local planner- collision

. The behavior observed is that the local planner seems to be caught in a loop, making continuous minor adjustments around the robot's footprint, reminiscent of a spiral pattern. enter image description here

I'm unsure about the root cause and how to configure the planner for optimal performance properly.

Here's my configuration file for the path planner: https://pastebin.com/5B52hKH4.

I've tried all the documented global planners in nav2: Smac Planner Hybrid, Lattice, Dubins, and Reedshep. My current setup uses the default DWB as the local planner:

  plugin: "dwb_core::DWBLocalPlanner"
  debug_trajectory_details: True

And for the global planner:

  plugin:  "nav2_smac_planner/SmacPlannerHybrid"
  downsample_costmap: false
  downsampling_factor: 1
  tolerance: 1.0
  allow_unknown: true
  cost_scaling_factor: 0.9
  neutral_cost: 50
  max_iterations: 1000000
  max_on_approach_iterations: 1000
  max_planning_time: 10.0
  motion_model_for_search:  "DUBIN"

One hypothesis I have is that the LiDARs might be detecting parts of the robot (e.g., the truck) as obstacles, leading the robot to attempt to avoid its own "shadow". This behavior can be observed in this video Nav2 Smac Planner: Dubin Ackerman Local Planner Inadequate for Large Truck Robot

enter image description here

To address this, I attempted to filter out the scan beams that detect this part of the truck, hoping it would mitigate the issue. However, this approach didn't yield the desired results, as the robot still displayed the same erratic behavior, as shown in this video Laser Scan Filtering avoid false positives (Error) NAV2

enter image description here

Does anyone have insights or suggestions on how to effectively configure the local planner to deviate from the global plan for obstacle avoidance? Filtering the laser scan didn't seem to be effective. Are there other methods or configurations I should consider? Additionally, has anyone tried using TEB with nav2? Does it offer better performance in such scenarios? If yes, How to configure it/ integrate it with Nav2?

  • $\begingroup$ I checked that the issue in unrelated to the Lidar false positive detection, as stated in this video description: youtu.be/I5RTD0vqJKw. It is also unrelated to the DWB parameters as I set extensively different values. I WILL CLOSE THIS ISSUE since I did not get any answer or could progress alone. $\endgroup$ Sep 23, 2023 at 9:28

1 Answer 1


Completely answered here: Local Planner Not Extending Beyond Robot's Footprint Boundaries to Distort Global Planner's Path


Avoiding Obstacles with GPS Follower Now, we need fine-tuning to optimize the behavior.


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.