Add initial SmartFlight planner integration#1559
Open
Ryanf55 wants to merge 1 commit into
Open
Conversation
tridge
approved these changes
Sep 7, 2025
Contributor
|
@Ryanf55 any reason not to merge now? |
…tegration Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com>
Contributor
Author
Please merge at your convenience. I just squashed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Create the initial integration module for a weather aware planner from Shearwater.ai's web planner into MAVProxy. Shearwater provides top quality path planning software, and recently exposed it over a REST API. They are looking for feedback from ArduPilot partners/users, so I thought it would be nice to write them a MAVProxy module so that you can use their planner from a GCS. Their planner is in beta - this is not
Assumptions
Details
Related to #1533 with a bit of overlap
Usage
Request a bearer token from sheawater, and put it in a
.envfile next to smart_flight_planner.py.I recommend the mavinit.scr settings:
Run SITL (assuming your already built plane before, for rapid iteration)
./Tools/autotest/sim_vehicle.py --debug -v plane --console --map --custom-location="21.306831, -157.945131, 5, 90" --no-configure --no-rebuild --mavcesiumDisable grid, disable follow on the map, then zoom out to see the whole island.

It comes preloaded with a sample area, and a start and goal loiter location. Let's start by using those.
In the console, click "SmartFlight -> Compute Plan" to call the planner.
Once the console says that it computed the plan, use the map to right click -> SmartFlight -> Show -> Show Plans
Three different plans show up that are optimized according to different criteria.

You can now set takeoff mode, arm.
Wait to get in the loiter, then on the MAVProxy console, click "SmartFlight -> Execute -> Energy Optimized Plan.

You'll see the green plan populate with waypoint numbers, the vehicle switch to AUTO and start flying the green path.
This automatically loads the route into the current mission and engages AUTO (assuming the vehicle is armed).
At any point, hit RTL, and change some of the parameters.
smartflight set <tab>.When ready, recompute the plan and show it again. If you try to compute the same plan multiple times, it will instead reuse the locally cached one. Planner computation can take ~45 seconds for paths across Oahu.
The CLI fully exposes all the UI functions. With MAVCesium, you get a good idea of how this allows you to fly close to terrain, and obey AGL constraints from regulations without crashing into terrain.
Future improvements