-
Notifications
You must be signed in to change notification settings - Fork 17.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plane: Allow a Lua script to return to a previous mission track #27759
Conversation
d6a1611
to
434076e
Compare
Tested on SITL and by Overhead Intelligence on a MFE Fighter VTOL |
f6490b8
to
fa64426
Compare
ArduPlane/ArduPlane.cpp
Outdated
@@ -908,6 +908,50 @@ bool Plane::set_land_descent_rate(float descent_rate) | |||
#endif | |||
return false; | |||
} | |||
|
|||
// allow scripts to find access prev_WP_loc | |||
bool Plane::get_previous_location(Location &previous_location) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Pete is right that this functionality can be done in the script without a binding
c82b5f3
to
def8b77
Compare
I got a CI fail on sitltest-plane. I downloaded the log but can't see the problem. Can you help @IamPete1 ? Oh found it - I'm pretty sure my code shouldn't affect this:
|
I have restarted it, that test has been failing occasionally. |
Is that something I can do myself? |
Not directly, maintainers only. However, whenever you push it will restart all of CI, so you can always rebase to re-trigger everything. |
Thanks - looks like I need to do a rebase anyway. Are you good with the changes? |
def8b77
to
8effb75
Compare
Rebased on master |
As discussed in #27639 on the dev call on 29 Aug 2024, added a way to get the previous WP location prior to switching out of AUTO mode and then restore it again after (in my case) doing some terrain object avoidance. This allows a plane to resume cross tracking mid mission which is required for magnetic field measurements in wilderness areas.
I changed the names proposed by @tridge in the call because:
The sample script includes a LocationTracker() class which can be used to save previous target locations that can be passed to set_crosstrack_start()
Includes a sample lua script which requires you to be running a mission. A switch will save the previous location (high) and switch to loiter, then resume the mission and restore crosstracking (low). This screen shot shows a loiter being triggered, then switching back to crosstracking and resuming the path by crosstracking to the mission track rather than just heading direct for the next WP (WP 10).