Skip to content

Conversation

@Luka-Filipovic
Copy link

Solved Problem

When the final mission waypoint is reached, the navigator sets the loiter position setpoint to the current position instead of the mission’s intended waypoint.

As a result, the vehicle ends up loitering at the position where it entered the waypoint’s acceptance radius, instead at the waypoint itself.

Solution

On mission end, call setLoiterItemFromCurrentPositionSetpoint() if current position setpoint is of type SETPOINT_TYPE_POSITION

@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-dev-call-oct-1-2025-team-sync-and-community-q-a/47561/2

@dagar
Copy link
Member

dagar commented Oct 1, 2025

This looks correct, can you comment on testing?

Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense 👍

@MaEtUgR
Copy link
Member

MaEtUgR commented Oct 1, 2025

if current position setpoint is of type SETPOINT_TYPE_POSITION

I assume the type used to always be loiter some time ago and after some changes it can now be a position and that's when it broke.

@MaEtUgR MaEtUgR merged commit 6c69d86 into PX4:main Oct 1, 2025
67 checks passed
@Luka-Filipovic
Copy link
Author

can you comment on testing?

SITL test with gz_x500

Top is before, bottom is after changes.
The time line points to the moment the last waypoint is reached. On the top one you can see that it makes the vehicle return back to the point where the item is reached.
On the bottom one it gently brakes to the desired waypoint.
image


I work only with multicopters, so I'm unsure how it affects vehicles such as VTOL, are they are allowed to loiter at the position setpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants