Commit Graph

82 Commits

Author SHA1 Message Date
Iampete1 c0cf814d3e Copter: disable hover throttle learn in standby mode 2021-05-18 15:59:52 +09:00
Peter Barker dc793e916f Copter: move implementation of get_pilot_desired_yaw_rate into mode.cpp 2021-03-24 20:46:08 +11:00
Tatsuya Yamaguchi 0cce5699b2 Copter: change from control_mode to flightmode 2021-03-23 22:48:20 +11:00
Ryan Birmingham c2cdb00f85 Copter: constrain throttle before setting deadband 2021-03-17 09:10:08 +09:00
Patrick José Pereira ad82e01270 ArduCopter: Add missing const in member functions
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2021-02-03 18:45:14 +11:00
bnsgeyer 42b4fd6e0a Copter: change heli integrator management and add hover coll learning 2020-12-21 23:33:48 -05:00
Peter Barker afa153fb6f Copter: remove wrapper for get_avoidance_adjusted_climbrate
Only the modes are interested in this - there's no point having it on
the Copter object.
2020-08-22 08:31:25 +09:00
Peter Barker d87986ecdd Copter: move set_throttle_takeoff implementation into Mode
No callers except the mode objects, so move it.
2020-08-05 08:23:03 +09:00
Leonard Hall 1a4e96b4ba Copter: Fix Rate expo calculation
This fixes a bug in the yaw rate expo and makes these changes consistent with roll and pitch rate expo.
2020-04-06 09:41:39 +09:00
Andy Piper 4c1816a983 Copter: port betaflight in-flight fft analysis to arducopter and expose as a log message
add harmonic notch tracking mode
call AP_GyroFFT::update_freq_hover() from update_throttle_hover()
move gyrofft configuration and control to AP_Vehicle
move fft logging to fft library
2020-02-22 11:15:37 +11:00
Randy Mackay d41e7dcbee Copter: move surface tracking implementation to surface_tracking.cpp 2019-09-28 11:13:14 +09:00
Andrew Tridgell 328fff8585 Copter: fixed RC failsafe handling for no RC receiver
this stops us using uninitialised values in modes like circle which
can operate either with or without RC input. If we didn't have a RC
receiver attached then they would use a maximum yaw rate (which
produces quite a spectacular result for a tuned up racing quad)
2019-09-24 10:00:36 +10:00
Peter Barker 0031deb175 Copter: correct abs vs fabsf usage in Attitude 2019-09-18 12:57:02 +10:00
Peter Barker b4537bebd8 Copter: move control_mode_t into being Mode::Number enum class
Fixes this compiler error:

In file included from ../../ArduCopter/sensors.cpp:1:
In file included from ../../ArduCopter/Copter.h:195:
../../ArduCopter/mode.h:1291:9: fatal error: declaration shadows a variable in the global namespace [-Wshadow]
        AUTO,           // after A and B defined, pilot toggle the switch from one side to the other, vehicle flies autonomously
        ^
../../ArduCopter/defines.h:38:5: note: previous declaration is here
    AUTO =          3,  // fully automatic waypoint control using mission commands
    ^
1 error generated.
2019-09-13 13:12:08 +09:00
Peter Barker c0e8d319c6 Copter: make surface tracking adjust_climb_rate take a float
Its callers all pass in floats and we return a float, so stop going via
an int16_t
2019-08-06 14:09:09 +09:00
Peter Barker b0428f0fe8 Copter: make surface_tracking a class, various functions methods 2019-08-06 14:09:09 +09:00
Randy Mackay 01909cf4c8 Copter: zigzag mode gets terrain following support 2019-04-19 07:45:52 +09:00
Randy Mackay 89eb876faf Copter: move surface tracking variables into structure 2019-04-19 07:45:52 +09:00
Randy Mackay 33a57361bd Copter: reduce args passed to get_surface_tracking_climb_rate
The same arguments are always passed in
2019-04-19 07:45:52 +09:00
Randy Mackay a732dfed6d Copter: minor format fixes to get_pilot_desired_cilmb_rate 2019-04-19 07:45:52 +09:00
Peter Barker 8441542a52 Copter: remove climb_rate cache of inertial_nav.get_velocity_z
There were only two users of it and dozens of places using
get_velocity_z
2019-03-28 12:10:31 +11:00
Peter Barker c1c71fec23 Copter: move Mode functions into mode.cpp from Attitude.cpp (NFC) 2019-03-27 14:02:31 +11:00
Peter Barker 34d9ce27af Copter: make get_pilot_desired_throttle a method on Mode 2019-03-26 20:57:15 +11:00
Michael du Breuil 7e1ed948f5 Copter: Cope with AC_PosControl renaming 2018-09-20 15:15:45 -07:00
Randy Mackay b5d722245a Copter: minor comment fix 2018-09-10 13:50:31 +09:00
Peter Barker 4e3bbe9311 Copter: move sanity check for rangefinder alt to within protected func
get_surface_tracking_climb_rate can do an additional check....
2018-06-06 08:33:56 +09:00
Peter Barker ab68e4fe8b Copter: log quiet-nan for rangefinder-desired-alt when not using it 2018-06-06 08:33:56 +09:00
Peter Barker 8648db06b4 Copter: create autoyaw.cpp from all the bits of Copter::Mode::AutoYaw 2018-04-18 13:27:43 +09:00
Peter Barker 948b90ed97 Copter: rename roi_WP to just roi
A Vector3f is not a waypoint.

This should really be "Point Of Interest" rather than "Region Of
Interest"
2018-04-18 13:27:43 +09:00
Peter Barker ba8b3e2415 Copter: create an AutoYaw helper object to hold auto-yaw state 2018-04-18 13:27:43 +09:00
Leonard Hall 9544b1763b Copter: replace smoothing gain with AC_AttitudeControl::set_input_tc 2018-03-16 13:50:57 +09:00
Ebin 20995b909f Copter: Moved get_pilot_desired_lean_angles to mode.cpp 2018-03-14 09:33:39 +09:00
Andrew Tridgell af4f0c29ba Copter: enable TMODE (ToyMode) support
this is for the skyviper button based transmitter control
2018-02-08 17:36:33 +11:00
Randy Mackay 8d6f8e4d9c Copter: move pos-control pids to pos-control library 2018-01-23 12:00:43 +09:00
Randy Mackay e85b1ac740 Copter: pass dt to avoidance calls 2018-01-16 12:13:48 +09:00
Peter Barker 7b637334f4 Copter: eliminate mode_has_manual_throttle 2017-12-06 10:09:58 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas bd027e4fcb Copter: Move some common functions to AP_Math (NFC) 2017-12-05 08:54:49 +09:00
ChrisBird caaeae3d0a Copter: Separate max ascent and descent speeds
Added equivalent parameters to WPNAV_SPEED_UP and WPNAV_SPEED_DN

New parameters named:
PILOT_SPEED_UP (technically renamed PILOT_VELZ_MAX)
PILOT_SPEED_DN

Removed parameter PILOT_VELZ_MAX (technically renamed to PILOT_SPEED_UP).

Flight Modes impacted:
ALTHOLD
AUTOTUNE
CIRCLE
LOITER
POSHOLD
SPORT
TAKEOFF

Update a section in GUIDED mode but I don't think it is ever used but update just in case.

It will use the PILOT_SPEED_UP for ascending max velocity.  For down it will check if
it is 0, if so then it will PILOT_SPEED_UP instead, if non zero it will use PILOT_SPEED_DN.
This retains current behavior and gives the flexibility to change it if desired.
2017-11-09 09:03:54 +09:00
Peter Barker 1d70a337dd Copter: remove unused desired_climb_rate variable 2017-03-09 19:52:58 +11:00
Randy Mackay cb1f7ba4bb Copter: remove setting position control's altitude max
AC_Avoid now takes responsibility for enforcing the alt limit and accesses inertial nav's limit directly
2017-01-18 09:35:47 +09:00
Randy Mackay b15d341850 Copter: add avoidance adjusted climb rate 2017-01-18 09:35:47 +09:00
Andrew Tridgell 0f6d0c5ba9 Copter: combined tri, single, coax and multicopter into a single build
this allows copter to be just 2 builds, one for heli, and one for
everything else
2017-01-12 17:39:37 +11:00
Andrew Tridgell bcea3ac8d4 Copter: handle rangefinder glitches in alt tracking
this handles glitches from the rangefinder when tracking the
ground. It requires 3 readings in a row to settle on a new target
altitude

thanks to discussions with Leonard and Randy
2016-11-28 17:36:01 +11:00
Leonard Hall 0a6714f4ae Copter: rename variable ROLL_PITCH_YAW_INPUT_MAX
No functional change
2016-10-26 20:59:43 +09:00
Leonard Hall 2698f14d39 Copter: apply yaw expo to all modes 2016-10-26 20:59:33 +09:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Leonard Hall fec24437f2 Copter: load accel throttle I term from attitude controller input
Previously we loaded up the I term from the pilot's input but a more reliable method is to get what was passed into the attitude controller.  In particular the addition of the acro-thr-mid parameter means the pilot's input must be interpreted differently for different flight modes.
2016-10-15 11:27:53 +09:00
Leonard Hall 5c47f3f9e5 Copter: add acro throttle and yaw expo and smoother manual pilot throttle 2016-10-15 11:27:53 +09:00
Randy Mackay 35864c6226 Copter: move check_ekf_reset to ekf_check.cpp
No functional change
2016-10-10 16:40:08 +09:00
Randy Mackay f4fee69f29 Copter: add div-by-zero check to get_pilot_desired_throttle
This divide by zero is only possible if there was a coding error in the setup of the throttle channel but added to make Covarity happy
2016-08-08 12:14:02 +09:00