-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
[WIP] Smart RTL from @samuelsadok #7363
base: main
Are you sure you want to change the base?
Conversation
OK, I quickly tested in SITL. Works nicely, but needs a load of polishing. I'll also port this over to use local coordinates instead of global coordinates, which is the direction PX4 is generally heading. |
Cool thanks for taking over! Here's the accompanying document: https://drive.google.com/open?id=0Bzbo-c8nJd81cmxTaE1YT1hpUWs Yeah I didn't find out how to set setpoints using local coordinates. The graph's native format is local coordinates, so all conversions are just a simple wrapper function that can be removed. If the local frame moves (if that's even possible), there are several absolute coordinates that need to be shifted. |
TODO:
|
Yes that makes sense, however in this case synchronisation considerations are necessary. Adding points while the consolidation is running should be possible with minor changes. Currently the consolidation function assumes the global Doing a rewrite while recording this rather difficult but it's probably acceptable to just drop new positions while a rewrite is in progress. |
Can we augment this with a last moment possible FW decend to transition altitude for VTOL? Assuming we will be on the path we know is safe we could descend as FW to the RTL altitude, and do this at the last moment possible (so FW descend rate over current altitude - RTL altitude = distance from home to start descending) |
7f32b3d
to
9cf7af6
Compare
@mhkabir should this still be open? |
@dagar @julianoes Is this still ongoing or can I close it? |
Definitely not ongoing, but it would be wonderful if someone would like to take another pass at getting it in. |
Not going to give up on this. |
Alright I can take a pass on it after I'm done with debugging CI |
…a memory optimimized format. This means the UAV can return to home by using only known-good flight paths. The flight graph is stored as a series of delta elements at 1m resolution and a list of nodes. Both lists share the same buffer. Each delta element takes up 2 bytes or sometimes 6 bytes if the delta is large. The path can consist of multiple disconnected segments, in which case the gaps are stored as delta elements with a jump-bit set. Once in a while or when required the graph is consolidated, which means: - Points that lie roughly in a line are replaced by a single line - Points that lie close to previously recorded lines are pruned - For lines that pass close to each other a node element is created Furthermore: - The graph is recorded at a higher precision closer to home - If the graph becomes full, the overall precision is reduced and the whole graph is re-consolidated - If the graph becomes full once more, all data is removed except for the shortest path home at that moment. One of these actions is repeated at each subsequent fill-up. Path finding information is generated/refreshed on demand and stored in the nodes. During return-to-home, the best direction to home is continuously evaluated by using the information stored in the nodes. The graph recording and path finding is implemented in navigator/tracker.cpp. The graph based return-to-home is implemented in navigator/smart_rtl.cpp.
Super interesting! @mhkabir are you interested in resurrecting this PR? Maybe we could discuss in today's PX4 Dev call? |
This adds graph-based "smart" RTL capabilities from @samuelsadok :
Adds Smart Return To Home capability by recording the flight path in a memory optimimized format. This means the UAV can return to home by using only known-good flight paths.
The flight graph is stored as a series of delta elements at 1m resolution and a list of nodes. Both lists share the same buffer. Each delta element takes up 2 bytes or sometimes 6 bytes if the delta is large. The path can consist of multiple disconnected segments, in which case the gaps are stored as delta elements with a jump-bit set.
Once in a while or when required the graph is consolidated, which means:
Furthermore:
Path finding information is generated/refreshed on demand and stored in the nodes. During return-to-home, the best direction to home is continuously evaluated by using the information stored in the nodes.
The graph recording and path finding is implemented in navigator/tracker.cpp.
The graph based return-to-home is implemented in navigator/smart_rtl.cpp. by Samuel Sadok