ros-navigation / navigation2

ROS 2 Navigation Framework and System
https://nav2.org/
Other
2.3k stars 1.2k forks source link

How to stop some behavior server's behaviors? #4491

Closed yigitboracagiran closed 1 week ago

yigitboracagiran commented 1 week ago

Required Info: I want to stop spinning and backing up when nav2 goal has sent to occupied cell.

Steps to reproduce issue

1- Set NavFn tolerance parameter to 0 2- Give robot a Nav2 goal to occupied cell.

Expected behavior

Don't spin or back up, only write failed log to terminal.

Actual behavior

[behavior_server-7] [INFO] [1719322863.658381792] [behavior_server]: Running spin [behavior_server-7] [INFO] [1719322863.658584803] [behavior_server]: Turning 1.57 for spin behavior. [behavior_server-7] [INFO] [1719322879.658188259] [behavior_server]: Running backup In the below video, I'm sending the robot to an obstacle with DWB.

https://github.com/ros-navigation/navigation2/assets/111417887/b8abbea0-2366-4165-86a1-98beeaf88f7b

SteveMacenski commented 1 week ago

You should:

  1. Create a new BT XML that doesn't contain the recoveries that you do not want, since the Behavior Tree is configurable to your application requirements for navigation behavior.
  2. You can remove the spin / backup from your parameter file for the beahvior server so that they aren't available to trigger. Won't really save you much, but no reason to have them if you wont use them

If you have future questions about how to configure / work with Nav2, reference our documentation at docs.nav2.org (which contains everything you need to do this) and/or ask on Robotics Stack Exchange. The issue tracker is not the correct place to ask for advice and usually I just close tickets like this, but this is an especially simple one for me to answer in 15 seconds.