Nav2 Controller Server, Goal Preemption

asked 2022-12-07 16:11:51 -0500

samc11 gravatar image

updated 2022-12-07 16:19:17 -0500

Working with Nav2 Foxy, and implementing a node which handles sending goals to the Nav2 controller server. Goals are cancelled or completely successfully, at which point another goal is sent. However, on a new goal being sent, the controller reports that the previous goal was preempted which in turn forces the new plan to be the old path until the controller loop updates. Logging below shows the issue, before "Passing New Path To Controller" it is using the old goal.

[navigation_control-17] [INFO] [1670446675.441920671] [navigation_control]: Sending goal (Type 7): 30.500000 , 36.400001
[bt_navigator-21] [INFO] [1670446675.446984210] [bt_navigator]: Begin navigating from current location to (30.50, 36.40)
[navigation_control-17] [INFO] [1670446675.457910730] [navigation_control]: Goal accepted by server, waiting for result
[controller_server-18] [INFO] [1670446675.550665196] [controller_server]: Received a goal, begin computing control effort.
[controller_server-18] [INFO] [1670446675.555532174] [controller_server]: Reached the goal!
[controller_server-18] [INFO] [1670446675.565149370] [controller_server]: Received a goal, begin computing control effort.
[controller_server-18] [INFO] [1670446675.576235011] [controller_server]: Reached the goal!
[bt_navigator-21] [INFO] [1670446675.619985254] [bt_navigator]: Navigation succeeded
[navigation_control-17] [INFO] [1670446675.636878917] [navigation_control]: Goal no longer active
[navigation_control-17] [INFO] [1670446675.643558742] [navigation_control]: Sending goal (Type 7): 30.500000 , 38.400001
[bt_navigator-21] [INFO] [1670446675.659430721] [bt_navigator]: Begin navigating from current location to (30.50, 38.40)
[navigation_control-17] [INFO] [1670446675.670092161] [navigation_control]: Goal accepted by server, waiting for result
[controller_server-18] [INFO] [1670446675.755152678] [controller_server]: Received a goal, begin computing control effort.
[controller_server-18] [INFO] [1670446675.755441039] [controller_server]: Passing new path to controller.
[controller_server-18] [INFO] [1670446675.772926784] [controller_server]: Reached the goal!
[bt_navigator-21] [INFO] [1670446675.811669168] [bt_navigator]: Navigation succeeded
edit retag flag offensive close merge delete

Comments

I don't see what you describe in the logs you posted. Can you explain more?

stevemacenski gravatar image stevemacenski  ( 2022-12-07 23:43:46 -0500 )edit

Hi, thank you for your response. To elaborate "Passing new path to controller" is logged which appears if the condition "action_server_->is_preempt_requested()" is met. Since I am waiting for goals to succeed or cancel I would not expect preemption. A more detailed log is below, where you can see the bt_navigator outputs "Begin navigating from current location to (5.08, 16.81)" upon receiving a new goal. However the controller_server outputs "Path end point is (11.43, 16.95)" which is the old goal which had been cancelled. It then shows that this goal is preempted and updates the new goal. I hope this helps to further explain my question! Thanks.

1670508439.6482799 [navigation_control-7] [INFO] [1670508439.527812141] [navigation_control]: Sending goal (Type 0): 11.431746 , 16.945609 1670508439.6489308 [navigation_control-7] [INFO] [1670508439.544296306] [navigation_control]: Goal accepted by server, waiting for result 1670508439.6506686 [bt_navigator-11] [INFO] [1670508439.544954156] [bt_navigator]: Begin navigating from current ...(more)

samc11 gravatar image samc11  ( 2022-12-08 08:33:17 -0500 )edit