Skip to content

Plan: add an ALL mission type to edit mission, fence and rally items … - #3780

Open
Autonomost wants to merge 2 commits into
ArduPilot:masterfrom
Autonomost:feature/plan-all-mission-type
Open

Autonomost wants to merge 2 commits into
ArduPilot:masterfrom
Autonomost:feature/plan-all-mission-type

Conversation

@Autonomost

Copy link
Copy Markdown
Contributor

…together

The mission type dropdown on the Plan screen gains an ALL entry. In that mode the single command grid holds mission, fence and rally items at once; a row's type follows its command (RALLY_POINT, FENCE_* or anything else), so no extra columns are needed. The map draws all three sets in one overlay with type-aware midline handles, and the fence polygon tools work in this mode.

Read and Write open a small picker (Mission / Fence / Rally, all ticked by default) so one click transfers everything or any subset. Reading a subset keeps the grid rows of the types that were not fetched. Uploads go in mission, fence, rally order; a type the vehicle rejects (for example fence items on old firmware) is reported without aborting the rest.

The MAVFTP download path now updates the cache matching the item type instead of always writing the mission cache.

…together

The mission type dropdown on the Plan screen gains an ALL entry. In that
mode the single command grid holds mission, fence and rally items at once;
a row's type follows its command (RALLY_POINT, FENCE_* or anything else),
so no extra columns are needed. The map draws all three sets in one
overlay with type-aware midline handles, and the fence polygon tools work
in this mode.

Read and Write open a small picker (Mission / Fence / Rally, all ticked by
default) so one click transfers everything or any subset. Reading a subset
keeps the grid rows of the types that were not fetched. Uploads go in
mission, fence, rally order; a type the vehicle rejects (for example fence
items on old firmware) is reported without aborting the rest.

The MAVFTP download path now updates the cache matching the item type
instead of always writing the mission cache.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical and moderate issues affect mixed-item handling and transfers.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds an ALL mission type combining mission, fence, and rally items in Flight Planner.

Changes:

  • Adds unified editing and type-aware map rendering.
  • Adds selective Mission/Fence/Rally read and write support.
  • Updates MAVFTP caching by item type.
File summaries
File Summary
GCSViews/FlightPlanner.cs Implements ALL-mode planning, transfers, rendering, and cache updates.
Controls/MissionTypePicker.cs Adds the Mission/Fence/Rally selection dialog.
Review details

Suppressed comments (3)

GCSViews/FlightPlanner.cs:722

  • After a subset is selected here, the existing confirmation below still says the read will clear all existing points, while getWPs(sender, types) deliberately preserves rows whose types were not fetched. The prompt is false for the new partial-read flow and can make users cancel a safe refresh; make it conditional on all types being selected or change its wording.
                    types = MissionTypePicker.Show(this, "Read");
                    if (types == null || types.Count == 0)
                        return;

GCSViews/FlightPlanner.cs:8006

  • This infers the midline type from the physical row immediately before pnt2, but ALL-mode mission midlines are built after fence/rally points are filtered out. A mission edge can therefore span fence rows; dragging it sees a fence vertex at pnt2 - 2 and inserts/recalculates a fence command instead of a mission waypoint. Determine the type from the midline's tagged endpoints or attach the type when creating the marker.
                            if (midtype == MAVLink.MAV_MISSION_TYPE.ALL)
                                midtype = IsFencePolygonVertexRow(pnt2 - 2)
                                    ? MAVLink.MAV_MISSION_TYPE.FENCE
                                    : MAVLink.MAV_MISSION_TYPE.MISSION;

GCSViews/FlightPlanner.cs:850

  • The picker is shown only after the preflight loop above validates every grid row. In ALL mode, choosing only one type still fails on an invalid number or zero-altitude warning in an unselected fence/rally row, so the new subset write cannot ignore that type. Select the types before validation or limit validation to rows whose command type is selected.
                types = MissionTypePicker.Show(this, "Write", counts);
  • Files reviewed: 2/2 changed files
  • Comments generated: 5
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread GCSViews/FlightPlanner.cs
Comment thread GCSViews/FlightPlanner.cs
Comment thread GCSViews/FlightPlanner.cs
Comment thread GCSViews/FlightPlanner.cs Outdated
Comment thread Controls/MissionTypePicker.cs Outdated
- Classify FENCE_HOME_CIRCLE_INCLUSION (legacy home centred fence) as a
  fence item so it is not uploaded as a mission command.
- Reading a subset of types now says it replaces only those types
  instead of claiming all points will be cleared.
- Ask which types to write before checking the grid, and only apply the
  altitude checks to rows of a type that is being sent.
- Distance, gradient and bearing are computed from a mission-only list
  in ALL mode, so mission legs no longer span fence or rally rows and
  those rows are left alone.
- Dragging a mission midline takes its type from the row it starts at
  rather than the physical row before its end, which could be a fence
  vertex in ALL mode.
- Insert the home sentinel when the downloaded mission is empty, not
  only when the mission was not refreshed, so the first fence or rally
  row is not stripped as home.
- When several types are written, a type the vehicle rejects is logged
  and the remaining types are still sent; the failures are reported
  together at the end. A single type fails as before.
- MissionTypePicker takes its captions from Strings.resx so the dialog
  is translated like the rest of the planner.

@Autonomost Autonomost left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made the changes as requested.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants