Commit Graph
8106 Commits
Author SHA1 Message Date
Peter Barker 5bec328c81 Copter: tidy comments and indentation of moved AHRS trimming code
Removes the comment claiming save_trim is a method on RC_Channels, moves
the auto-trim description from auto_cancel to auto_run which it
describes, and drops the extra indentation level auto_start and auto_run
carried over from their previous nesting.

Whitespace and comments only.
2026-09-22 09:30:40 +09:00
d2fe1453cf Copter: move AutoTrim support into Copter object
Co-authored-by: Ayush Suri <vtdlduddn3267@gmail.com>
Co-authored-by: codemaster1104 <akshatshrivastava1823@gmail.com>
2026-09-22 09:30:40 +09:00
Peter Barker 2aeb8bf242 Copter: do not disarm the vehicle on battery fs if fs is none 2026-09-14 12:44:42 +10:00
Peter BarkerandClaude Opus 5 f4a1826f3a ArduCopter: fix PosHold brake-to-loiter speed threshold units
d56e91bbe2 converted mode_poshold to metres and radians, changing
vel_right_cms/vel_fw_cms to vel_right_ms/vel_fw_ms at both sites which
compare them against POSHOLD_SPEED_0, but left the constant at 10.  The
threshold silently went from 10cm/s to 10m/s.

That constant guards a shortcut which truncates the remaining braking
time to 0.5s once the vehicle has essentially stopped.  At 10m/s it is
true at any speed a copter reaches in PosHold, so braking is always cut
short and PosHold hands over to loiter while still travelling.
AC_Loiter::init_target_m() sets the loiter target to the position at
handover, so the vehicle overshoots that target and then flies backwards
to reach it.

Rename to POSHOLD_SPEED_0_MS to match POSHOLD_WIND_COMP_ESTIMATE_SPEED_MAX_MS,
which the same commit did rescale and rename.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 08:43:03 +09:00
Eric Katzfey 4c3eb9678c Copter: suppress QURT absolute-value warning
Keep existing fabsF behavior and locally suppress Hexagon Clang's narrowing diagnostic for the double-precision guided position target.
2026-09-05 09:08:20 +10:00
Peter BarkerandClaude Opus 5 11b11b8ca9 ArduCopter: remove EKF compass offset saving from disarm
This is now done for all vehicles by AP_Arming::disarm().

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 09:29:27 +10:00
Randy Mackay 8e5baa34f7 Copter: 4.7.1 release notes 2026-09-02 12:32:57 +09:00
George Zogopoulos ecb117a150 Copter: 4.7.1-beta1 release notes 2026-09-02 12:32:37 +09:00
Andy Piper c4f79e1014 Copter: migrate ground effect detection to AP_GroundEffect
Replaces Copter's built-in ground-effect detection with the
AP_GroundEffect library and wires its AC_PosControl and per-cycle
vehicle state.

A stored GND_EFFECT_COMP=0 is migrated to GNDEFF_ALT=-1; the enabled
default needs no migration.

With the default GNDEFF_ALT of 0.5m touchdown_expected now also
requires the vehicle to be near the ground (within 0.5m of the takeoff
height, and within 20m horizontally of the launch point when no
rangefinder is available), where the old code asserted it for any slow
descent at any height. GNDEFF_ALT=0 restores the old behaviour.
2026-09-01 20:09:07 +09:00
Peter Barker 109e11e745 ArduCopter: remove RCn_OPTION parameter conversion
Rewrote a stored RCn_OPTION of ARMDISARM_UNUSED (41) to
ARMDISARM_AIRMODE (154).  Added Sep-2021 and present in Copter-4.2.0, so
anybody moving from 4.3.0 or later has already had it applied.

A stored 41 which survives becomes an unhandled auxiliary function and
does nothing, which is the same outcome as any other option number this
firmware does not know.
2026-09-01 20:49:36 +10:00
Peter Barker 5b8866bedc ArduCopter: remove parameter conversions from before 4.3
All of these conversions are present in the Copter-4.3.0 tag, so anybody
running 4.3.0 or later has already had them applied:

 - PSC_NE_VEL_FLTE (Aug-2021)
 - ACRO_RP_RATE/ACRO_Y_RATE replacing ACRO_RP_P/ACRO_Y_P (Sep-2021)
 - INS_HNTC2 from the old fixed notch (Apr-2022)
 - FENCE_ parameters into the AC_Fence object (Mar-2022)
 - the rate and expo command model parameters (Jun-2022)
 - PRX to PRX1_ (Aug-2022)

Past this a user moving from a version of ArduCopter earlier than 4.3.0
will not have these parameters converted.
2026-09-01 20:49:36 +10:00
Peter Barker 73498f2b8c ArduCopter: annotate and correct parameter conversion comments
These are all "PARAMETER_CONVERSION - Added: <Mon>-<Year> for <Release>"
now, so that a grep for conversion vintages finds them and can parse the
date.

Also annotates the ARMDISARM_UNUSED to ARMDISARM_AIRMODE rewrite of
stored RCn_OPTION values, which had no annotation at all: it calls
set_and_save() directly rather than going through an AP_Param::convert_*
helper, so an audit anchored on those helpers did not see it.

Established by content rather than by date: absent from Copter-4.1.0 and
present in Copter-4.2.0.  No functional change.
2026-08-31 08:18:26 +10:00
Randy Mackay ba4854e589 Copter: move loiter-turns state into structure 2026-08-30 16:45:12 +10:00
Leonard Hall a45810a47d Copter: Auto: fly LOITER_TURNS on using S-curves 2026-08-30 16:45:12 +10:00
Iampete1 062c3b096b Copter: landing gear: deal with new range finder state 2026-08-26 17:54:30 +10:00
bnsgeyer 4fe7ad4fab Copter: add parameter table for flip mode 2026-08-20 17:59:29 -04:00
Bill Geyer 539eb71cd7 Copter: parameterize rotation rate for flip mode 2026-08-20 17:59:29 -04:00
Randy Mackay 2152c71ad3 Copter: remove unused new_radio_frame 2026-08-11 02:01:53 +01:00
Randy MackayandIampete1 17792724fa Copter: simple mode fix
Co-authored-by: Iampete1 <iampete@hotmail.co.uk>

Replaces update_simple_mode with apply_simple_mode function that takes roll and pitch input arguments.  The rotation is now done within the various get-pilot-desired-xxx methods removing the need for each flight mode to call update_simple_mode and also removing the slightly ugly call to overwrite RC_Channels' control inputs from the flight code (e.g. no more calls to set_control_in)
2026-08-11 02:01:53 +01:00
Peter Barker e65a80dabb Copter: make compile-time guard a parameter check for compass checks disabled 2026-08-05 11:54:44 +10:00
Peter BarkerandClaude Opus 5 890622b001 Copter: honour arm-switch air-mode in throttle mix and land detector
Arming with the ARMDISARM_AIRMODE switch sets ap.armed_with_airmode_switch,
but only Copter::set_throttle_zero_flag() consulted it.  The throttle mix and
the land detector tested air_mode == AIRMODE_ENABLED instead, so a vehicle
armed with the air-mode arming switch fell back to ATC_THR_MIX_MIN at zero
throttle (little attitude authority) and used the 1s land-detector trigger
rather than the air-mode 3s trigger.

Add Copter::air_mode_active() and use it in all three places.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 10:38:06 +09:00
Randy Mackay 9ec17d025f Copter: RTL_CONE_SLOPE param desc gets angles 2026-08-03 11:21:32 +10:00
muramura 2112de0256 Copter: make AltHold an optional build feature 2026-08-03 08:12:37 +10:00
Randy Mackay 637524750e Copter: auto mode fix to continue past RTL if rtl-final-descent non-zero 2026-07-30 23:50:22 +10:00
Peter Barker ab6ea184a1 ArduCopter: tie MODE_AUTO_ENABLED to AP_MISSION_ENABLED
Copter's one and only AP_Mission object is a member of ModeAuto, so
compiling ModeAuto out leaves AP::mission() with nothing to return while
the rest of the codebase still believes mission support is present.

Default MODE_AUTO_ENABLED to AP_MISSION_ENABLED so that disabling
mission support removes AUTO mode too, and reject the two inconsistent
combinations at compile time.
2026-07-29 18:18:35 +10:00
Peter Barker cc335ac1fd ArduCopter: allow build with AUTO mode compiled out
class ModeAuto was declared unconditionally even though only its
instantiation was guarded, so its AP_Mission and
AP_Mission_ChangeDetector members failed to compile with mission support
disabled.  Guard the class, and the two aux-function switch entries
whose RC_Channel::AUX_FUNC enumerators are themselves gated on
AP_MISSION_ENABLED.
2026-07-29 18:18:35 +10:00
Peter Barker 38fc0305d9 ArduCopter: fix build with MODE_AUTO_ENABLED=0
GCS_MAVLINK_Copter::mission_state() exists only to report the paused
state of AUTO mode, and dereferences copter.mode_auto - but that member
is compiled out when MODE_AUTO_ENABLED is 0, so the build failed.

Guard the override so we fall back to the GCS_MAVLINK base
implementation when AUTO mode is not compiled in.
2026-07-29 18:18:35 +10:00
Peter Barker 07ac38b8c6 Copter: use bool-returning AP_AHRS::get_wind
Moves off the Vector3f-returning wind_estimate() method.  Copter uses
the success of airspeed_vector_TAS() to decide whether it has a usable
wind estimate; that is left alone here, so no functional change.
2026-07-28 13:48:28 +10:00
Peter Barker 62d8bbb80f ArduCopter: correct Copter mode entry with low RC rate demand 2026-07-23 17:56:59 +10:00
George Zogopoulos 7819cfe41a Copter: 4.7.0 release notes 2026-07-21 16:58:06 +09:00
Peter BarkerandClaude Fable 5 aff75169f4 Copter: do not fetch unused yaw reset angle
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 17:25:44 +10:00
Peter Barker b6d7107929 Copter: flowhold: correct height estimate calculations
... by accumulating height weights into float rather than uint8_t

these weights are all likely to be very low, so the "ends up at zero" case is likely to always be taken.

 - min_flow_change is 0.04
 - the value is in radians/second

I have an inkling this might originally have been "i" - i.e. accumulate across the three axes and then divide by the number of axes included in delta_height_m - but the code was subsequently changed to be include the abs_weight instead but the type was missed.
2026-07-15 20:52:11 +10:00
Peter Barker 6164e08114 ArduCopter: update reset counters when active backend changes 2026-07-15 08:07:55 +10:00
George Zogopoulos 4a32a7fd0b Copter: 4.7.0-beta8 release notes 2026-07-13 20:04:30 +09:00
Randy MackayandAndy Piper e0fa4a47e1 Copter: set-target-angle-and-climbrate scaling fix
Co-authored-by: Andy Piper <github@andypiper.com>
2026-07-11 12:52:27 +09:00
George Zogopoulos 56a4b7fe6e Copter: Use the AC_CustomControl gating flag 2026-07-10 10:14:26 +10:00
George Zogopoulos d9cca080ec Copter: Rename Custom Control define names to be copter-specific 2026-07-10 10:14:26 +10:00
George Zogopoulos 42949a5af0 Copter: Add AC_CustomControl directory to build 2026-07-10 10:14:26 +10:00
Leonard Hall f6c0aa9cf9 Copter: ModeFollow: fix YAW_BEHAVE_FACE_LEAD_VEHICLE 2026-07-08 10:35:23 +09:00
bnsgeyer 0986d74130 Copter: add support to determine runup complete using manual throttle mode 2026-07-07 06:07:12 -04:00
Brown d95ad99488 Copter: swap PosHold controller-to-pilot mix inputs
Keep the mix ratio semantics unchanged and swap the blend inputs.
2026-07-07 09:39:39 +10:00
Peter Barker 7ae44d4a63 ArduCopter: reset attitude targets based on reset count not primary core index
this means if we change estimators that the target will also be reset
2026-06-30 15:50:15 +10:00
Peter BarkerandClaude Opus 4.8 a17b82e558 ArduCopter: move beacon up to AP_Vehicle
The beacon object now lives in AP_Vehicle; remove it from g2 and convert the stored BCN parameters across from the old g2 location.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 10:28:56 +10:00
Hunter McClelland d08351559e Copter: fail-to-init on either high-mag roll or pitch input
pre-commit / ci (push) Has been cancelled
test scripts / build (astyle-cleanliness) (push) Has been cancelled
test scripts / build (check_autotest_options) (push) Has been cancelled
test scripts / build (logger_metadata) (push) Has been cancelled
test scripts / build (param-file-validation) (push) Has been cancelled
test scripts / build (param_parse) (push) Has been cancelled
test scripts / build (python-cleanliness) (push) Has been cancelled
test scripts / build (shellcheck) (push) Has been cancelled
test scripts / build (validate_board_list) (push) Has been cancelled
New subfunction for ModeFlip to define high-mag input
Remove incorrect comments
2026-06-17 09:05:58 +09:00
George Zogopoulos d4a483cd95 Copter: 4.7.0-beta7 release notes 2026-06-16 08:20:06 +09:00
bnsgeyer f3d99e3509 Copter: fix tradheli stick armingbehavior 2026-06-12 20:37:17 +09:00
Hunter McClelland d84f4dca15 Copter: Fix file docstring for mode_flip.cpp
pre-commit / ci (push) Has been cancelled
test scripts / build (astyle-cleanliness) (push) Has been cancelled
test scripts / build (check_autotest_options) (push) Has been cancelled
test scripts / build (logger_metadata) (push) Has been cancelled
test scripts / build (param-file-validation) (push) Has been cancelled
test scripts / build (param_parse) (push) Has been cancelled
test scripts / build (python-cleanliness) (push) Has been cancelled
test scripts / build (shellcheck) (push) Has been cancelled
test scripts / build (validate_board_list) (push) Has been cancelled
2026-06-10 09:37:17 +10:00
Peter Barker 1b7026ae61 Copter: correct initialisation issue in SITL
the truncation is not going to be a problem on a real vehicle, but the SITL-only sanity check where we go to use it in change_alt_frame is a problem.
2026-06-09 11:30:49 +10:00
George Zogopoulos 3f5aae1575 Copter: 4.7.0-beta6 release notes 2026-06-05 15:43:32 +09:00
Peter Barker cfdc56dc5e ArduCopter: adjust for clarification of method name 2026-06-03 17:30:24 +10:00