Update ConfigureArducopter and FlightPlanner to accomodate new param names and units/scales#3685
Update ConfigureArducopter and FlightPlanner to accomodate new param names and units/scales#3685EosBandi wants to merge 11 commits intoArduPilot:masterfrom
Conversation
|
These are the obvoius ones, still combing through the full code for possible impacts.... |
|
@EosBandi thank you so much!! |
|
for those that looked over this, are we all happy? |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates Mission Planner UI/configuration logic to handle ArduCopter 4.7 parameter renames and unit/scale changes, including adding a central mapping helper and extending several views to read/write the newer parameters.
Changes:
- Add
paramchanges47utility mapping old↔new 4.7 parameter names and unit-change descriptions. - Update multiple UI/config flows to prefer new 4.7 parameters (with fallback to legacy names) and apply unit conversions.
- Add UI warning behavior when editing parameters affected by 4.7 renames/unit changes.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/FaceMap/FaceMapUI.cs | Use WP_SPD fallback and ensure speed is in m/s for DO_CHANGE_SPEED. |
| Swarm/WaypointLeader/DroneGroup.cs | Update RTL/WPNAV accel parameter sets to support 4.7 names/units. |
| Grid/GridUI.cs | Same WP_SPD fallback logic as FaceMap for speed changes. |
| GCSViews/FlightPlanner.cs | Support WP_RADIUS_M and 4.7 WPNAV speed/accel param changes with unit conversions. |
| GCSViews/ConfigurationView/ConfigInitialParams.cs | Handle ATC accel param rename/unit scaling and update user guidance text. |
| GCSViews/ConfigurationView/ConfigArducopter.cs | Expand supported param aliases and add enter-warning for 4.7 param changes. |
| GCSViews/ConfigurationView/ConfigAC_Fence.cs | Prefer RTL_ALT_M when present and adjust displayed/default scaling. |
| ExtLibs/Utilities/paramchanges47.cs | New mapping helper for 4.7 param renames and warnings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // use brute force, for all three possible params | ||
|
|
||
| // m | ||
| port.setParam("WP_RADIUS", float.Parse(TXT_WPRad.Text) / CurrentState.multiplierdist); | ||
|
|
||
| // m | ||
| port.setParam("WP_RADIUS_M", float.Parse(TXT_WPRad.Text) / CurrentState.multiplierdist); | ||
|
|
||
| // cm's | ||
| port.setParam("WPNAV_RADIUS", float.Parse(TXT_WPRad.Text) / CurrentState.multiplierdist * 100.0); | ||
|
|
There was a problem hiding this comment.
Unconditionally writing all three parameters can generate avoidable MAVLink PARAM_SET failures/noise (and potentially slow down or confuse users) on firmwares that only support one of these names. Prefer setting only the parameter(s) that exist on the connected vehicle (e.g., check the param dictionary for supported keys), or wrap each setParam in targeted error handling and only attempt fallbacks if the first write fails.
| // use brute force, for all three possible params | |
| // m | |
| port.setParam("WP_RADIUS", float.Parse(TXT_WPRad.Text) / CurrentState.multiplierdist); | |
| // m | |
| port.setParam("WP_RADIUS_M", float.Parse(TXT_WPRad.Text) / CurrentState.multiplierdist); | |
| // cm's | |
| port.setParam("WPNAV_RADIUS", float.Parse(TXT_WPRad.Text) / CurrentState.multiplierdist * 100.0); | |
| var wpRadiusMeters = float.Parse(TXT_WPRad.Text) / CurrentState.multiplierdist; | |
| var wpRadiusCentimeters = wpRadiusMeters * 100.0f; | |
| // Try the supported waypoint-radius parameter name for the connected firmware, | |
| // only falling back to alternatives if the previous write fails. | |
| Exception wpRadiusSetException = null; | |
| try | |
| { | |
| // m | |
| port.setParam("WP_RADIUS", wpRadiusMeters); | |
| } | |
| catch (Exception ex1) | |
| { | |
| wpRadiusSetException = ex1; | |
| try | |
| { | |
| // m | |
| port.setParam("WP_RADIUS_M", wpRadiusMeters); | |
| wpRadiusSetException = null; | |
| } | |
| catch (Exception ex2) | |
| { | |
| wpRadiusSetException = ex2; | |
| try | |
| { | |
| // cm's | |
| port.setParam("WPNAV_RADIUS", wpRadiusCentimeters); | |
| wpRadiusSetException = null; | |
| } | |
| catch (Exception ex3) | |
| { | |
| wpRadiusSetException = ex3; | |
| } | |
| } | |
| } | |
| if (wpRadiusSetException != null) | |
| throw wpRadiusSetException; | |
|
|
||
| namespace MissionPlanner.Utilities | ||
| { | ||
| public class paramchanges47 |
There was a problem hiding this comment.
New public API types in C# should follow PascalCase naming. Consider renaming paramchanges47 to ParamChanges47 (and similarly PascalCase for its public methods) to match standard .NET conventions. Also, using System.Text; is unused in this file and can be removed.
| if (paramCompareForm.DialogResult == DialogResult.OK) | ||
| { | ||
| CustomMessageBox.Show("Initial Parameters succesfully updated.\r\nCheck parameters before flight!\r\n\r\nAfter test flight :\r\n\tSet ATC_THR_MIX_MAN to 0.5\r\n\tSet PSC_ACCZ_P to MOT_THST_HOVER\r\n\tSet PSC_ACCZ_I to 2*MOT_THST_HOVER\r\n\r\nHappy flying!", "Initial parameter calculator"); | ||
| CustomMessageBox.Show("Initial Parameters succesfully updated.\r\nCheck parameters before flight!\r\n\r\nAfter test flight :\r\n\tSet ATC_THR_MIX_MAN to 0.5\r\n\tSet PSC_ACCZ_P/PSC_D_ACC_P to MOT_THST_HOVER\r\n\tSet PSC_ACCZ_I/PSC_D_ACC_I to 2*MOT_THST_HOVER\r\n\r\nHappy flying!", "Initial parameter calculator"); |
There was a problem hiding this comment.
Correct spelling: change 'succesfully' to 'successfully' in the user-facing message.
| CustomMessageBox.Show("Initial Parameters succesfully updated.\r\nCheck parameters before flight!\r\n\r\nAfter test flight :\r\n\tSet ATC_THR_MIX_MAN to 0.5\r\n\tSet PSC_ACCZ_P/PSC_D_ACC_P to MOT_THST_HOVER\r\n\tSet PSC_ACCZ_I/PSC_D_ACC_I to 2*MOT_THST_HOVER\r\n\r\nHappy flying!", "Initial parameter calculator"); | |
| CustomMessageBox.Show("Initial Parameters successfully updated.\r\nCheck parameters before flight!\r\n\r\nAfter test flight :\r\n\tSet ATC_THR_MIX_MAN to 0.5\r\n\tSet PSC_ACCZ_P/PSC_D_ACC_P to MOT_THST_HOVER\r\n\tSet PSC_ACCZ_I/PSC_D_ACC_I to 2*MOT_THST_HOVER\r\n\r\nHappy flying!", "Initial parameter calculator"); |
|
@EosBandi, no huge pressure of course but could you update this PR when you get a chance? I'm just keen to clear up our AP 4.7 issues list! |
…ly tagged in the release notes.
Support for ArduCopter 4.7 Parameter Changes:
ConfigArducopter.csNote: Changes in ConfigArducopter.Designer are :