Commit Graph

733 Commits

Author SHA1 Message Date
Randy Mackay 7b0da89708 Copter: add vibration check 2019-10-18 11:15:25 +09:00
Leonard Hall 50a098c359 Copter: Standby functions 2019-10-17 14:57:18 +09:00
Leonard Hall c11f2247eb Copter: System ID mode 2019-10-16 08:17:09 +09:00
Randy Mackay 36327d56de Copter: reject reboot request from GCS if auto esc cal on next reboot
this resolves an edge case in which the motors could spin up on the next reboot because the user didn't unplug the battery to reboot the flight controller
2019-10-15 07:41:44 +09:00
Andy Piper 8ce7f02167 ArduCopter: add functions to update dynamic notch frequency. Periodically log the frequency.
tradheli- make RPM sensor input to harmonic notch in hertz
2019-10-10 20:26:02 +09:00
Peter Barker 9e5d5c023c Copter: move many members up to base class 2019-10-08 11:26:04 +11:00
Peter Barker 95f81297d9 Copter: become an AP_Vehicle 2019-10-08 11:26:04 +11:00
murata abb91fc33a Copter: Change external button specification to option
Copter: Change the definition name from BUTTON to BUTTON_ENABLED.
2019-10-08 08:09:19 +09:00
Randy Mackay 1c4f47f882 Copter: add upward facing surface tracking 2019-09-28 11:13:14 +09:00
Randy Mackay d5d7fbe761 Copter: rangefinder glitch detection moved to read_rangefinder 2019-09-28 11:13:14 +09:00
Randy Mackay 808efa4c79 Copter: surface tracking format fixes 2019-09-28 11:13:14 +09: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
Randy Mackay 709c874d8b Copter: integrate AP_OAPathPlanner 2019-08-17 09:42:43 +09:00
Peter Barker 4fa83ed40d Copter: move automatic declination setting into AP_Compass itself 2019-08-13 10:02:13 +10: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
Peter Barker 97bb846310 Copter: RangeFinder uses AP_SerialManager singleton 2019-07-16 09:29:48 +10:00
Peter Barker 9412075b9c Copter: avoidance no longer takes ahrs in constructor 2019-07-16 09:29:48 +10:00
Peter Barker e977fce3ad Copter: stop passing relay and ahrs into camera constructor 2019-07-09 09:32:39 +10:00
Peter Barker 05925b57ad Copter: mark position_ok methods as const 2019-07-09 09:26:45 +10:00
Peter Barker eb82126758 Copter: ServoRelayEvents uses Relay singleton 2019-07-03 23:59:24 -07:00
Peter Barker cf45108efb Copter: set Heli frame default at compile-time 2019-07-04 10:05:01 +09:00
Peter Barker bb3d2a0b37 Copter: pass GCS_MAVLink object rather than channel number in motortest 2019-07-02 10:04:56 +10:00
Peter Barker f3c1791341 Copter: stop passing gcs chan into method which wants an object 2019-06-25 09:45:54 +10:00
Michael du Breuil df37a3d603 Copter: Remove wrapper around MAVLink send heartbeat 2019-06-18 13:59:52 +01:00
Peter Barker 676d75c391 Copter: correct namespacing of Copter modes
This makes us look like Rover and Plane in terms of namespacing for the
Mode classes, and removes a wart where we #include mode.h in the middle
of the Mode class.

This was done mechanically for the most part.

I've had to remove the convenience reference for ap as part of this.
2019-06-11 09:18:22 +09:00
Peter Barker 9f6b48b743 Copter: remove unneeded initialisation 2019-06-03 16:48:38 +09:00
Peter Barker 6dce39cbe1 Copter: use AP_Arming methods to arm and disarm vehicle
Really just changing the namespace of init_arm_motors
2019-05-30 07:37:30 +09:00
Peter Barker 3ef84d2b96 Copter: stop passing references to AC_Avoid constructor 2019-05-22 07:48:02 -06: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
Pierre Kancir 4f29d2e5a6 Copter: factorize esc calibration setup 2019-04-09 08:44:46 +09:00
Randy Mackay a5bdd12bfa Copter: replace TUNE_LOW/HIGH params with TUNE_MIN/MAX
change from uint16 to floats to ease setup
also add check that no function assigned to rc6
2019-04-08 15:24:00 +09:00
bnsgeyer d949c80d54 Copter: tradheli replaces rotor_runup_complete with spool state 2019-04-08 09:42:21 +09:00
Michael du Breuil d1246f5868 Copter: Fix RangeFinder init 2019-04-06 09:15:22 +11:00
Michael du Breuil 0e8c3dc485 Copter: include FWversion 2019-04-05 20:12:53 +11:00
Peter Barker 2040580ce7 Copter: move enabled parameter into compass library 2019-04-02 10:24:49 +11:00
Tom Pittenger 7824b64ad6 Copter: rename dataflash to logger 2019-03-28 16:40:57 +11: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 c7e21d95ef Copter: move Log_Write_Error into library 2019-03-27 12:36:40 +11:00
Peter Barker 34d9ce27af Copter: make get_pilot_desired_throttle a method on Mode 2019-03-26 20:57:15 +11:00
Patrick José Pereira 33764d6c3b Copter: Fix typo
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2019-03-26 15:39:23 +11:00
bnsgeyer 2fc942ac24 Copter: tradheli-convert swash parameters on firmware upgrade 2019-03-20 10:40:20 +10:00
Peter Barker 451f5f17ce Copter: move devo telemetry handling to GCS 2019-03-19 14:39:14 +11:00
Peter Barker e22b29bce4 Copter: FrSky support has moved to GCS 2019-03-19 14:39:14 +11:00
Peter Barker 85d9dd6f64 Copter: move sending of RPM message up 2019-03-16 10:33:01 +09:00
Peter Barker f189860162 Copter: use enum class for ArmingMethod and ArmingRequired 2019-03-12 19:48:14 +11:00
Peter Barker 4f69eefd4a Copter: remove unused includes 2019-03-05 13:19:29 +09:00
Michael du Breuil cac4b91671 Copter: Allow scripting to run 2019-03-05 08:45:54 +11:00
IamPete1 ba3d1bc6c7 Copter: move E-stop state to SRV_Channel 2019-02-27 08:51:24 +09:00
Peter Barker a48f461158 Copter: remove position-vector methods
Both were used in just one place
2019-02-26 14:09:21 +11:00
Peter Barker 4187243e5c Copter: Rally no longer takes ahrs in constructor 2019-02-20 18:03:38 +11:00
Peter Barker 5ff80e06d1 Copter: move update_sensor_status_flags into GCS subclasses 2019-02-19 14:09:59 +11:00
Peter Barker f759c7ac7e Copter: GCS_MAVLink takes care of mavlink capabilities 2019-02-19 13:14:52 +11:00
Peter Barker 9bc23d3f28 Copter: move try_send_message of nav_controller_output up 2019-02-19 10:08:00 +11:00
Peter Barker f64ad2f433 Copter: move visual odometry update function into AP_VisualOdom 2019-02-16 15:13:59 +11:00
Peter Barker 31f796f0c5 Copter: remove unused scaleLongDown member 2019-02-15 11:45:13 +09:00
Peter Barker 5ae52038fa Copter: make setting of home boolean in preparation for sanity checks 2019-02-15 08:28:45 +11:00
Peter Barker 8de7f4a520 Copter: devo telemetry no long requires singleton classes to be passed in 2019-02-13 19:24:07 +00:00
Peter Barker a0189d6060 Copter: AP_Frsky_Telem uses singletons 2019-02-12 17:53:23 +00:00
Peter Barker 587e02e92e Copter: remove pv_ functions that duplicate Location functions 2019-02-06 11:02:50 +09:00
Peter Barker 7197cf9e5c Copter: move sending of sys_status message up 2019-02-05 11:07:39 +11:00
Peter Barker 3521d98b52 Copter: move handling Write_Event into AP_Logger 2019-02-04 09:30:07 +09:00
Peter Barker 1412921561 Copter: move sending of fence_status message up 2019-01-31 13:44:29 +09:00
Peter Barker 5dc743f1ba Copter: fence no longer takes reference to ahrs in constructor 2019-01-31 11:25:38 +09:00
Peter Barker b47733142f GLOBAL: rename DataFlash_Class to AP_Logger 2019-01-18 18:08:20 +11:00
Peter Barker 845f015648 Copter: adjust for Location_Class and Location unification 2019-01-16 11:45:29 +11:00
Randy Mackay 50c5ad7076 Copter: TradHelis force spool up before takeoff 2019-01-15 11:41:44 +09:00
Peter Barker f50418f72a Copter: Terrain uses rally singleton 2019-01-09 10:14:16 +11:00
Michael du Breuil ec8a82e8a0 Copter: Remove unneeded AP_Buffer include 2018-12-31 11:41:43 +09:00
Andrew Tridgell 89d54767b1 Copter: convert to use AC_AutoTune library
this maintains existing behaviour
2018-12-18 10:34:42 +09:00
Francisco Ferreira a2fa63bcf7 Copter: fix Cygwin build
Static initialization doesn't have an exact order, we can't rely on it
2018-12-13 09:28:44 +09:00
Peter Barker 75fb9780f7 Copter: rename send_extended_status1 to send_sys_status 2018-12-10 12:52:41 +09:00
murata b252eae404 Copter: Flip mode is an option.
Copter: Flip mode is an option.
2018-11-26 09:29:47 +09:00
Peter Barker d49431488e Copter: remove pointless wrappers around RC_Channels functions 2018-11-23 10:56:17 +11:00
Peter Barker ee5339f931 Copter: remove pointless wrappers around gcs functions 2018-11-23 10:56:17 +11:00
Peter Barker 33ca577653 Copter: OpticalFlow takes care of its own logging 2018-11-13 10:40:23 +11:00
Peter Barker ee456e8870 Copter: do not pass ahrs to opticalflow constructor 2018-11-13 10:40:23 +11:00
Andrew Tridgell 2f79932611 Copter: auto-convert landing gear PWM parameters 2018-11-10 21:24:19 +11:00
Peter Barker 73940df48e Copter: move mission into mode_auto 2018-11-09 13:35:40 +09:00
Peter Barker bf1c82ffe1 Copter: don't pass ahrs to terrain constructor 2018-11-08 20:59:45 +11:00
Peter Barker f598cff99c Copter: stop passing ahrs to Mission constructor 2018-11-08 10:01:16 +09:00
Peter Barker 1d322046b0 Copter: tidy up send_pid_tuning 2018-11-06 08:19:15 +09:00
Peter Barker 859f4828a1 Copter: move handling of gimbal messages up
Copter: move handling of mav_cmd_do_mount_control up

Copter: move handling of deprecated mount messages up

Copter: move handling of command_do_set_roi up

Copter: move handling of command_do_set_roi up

Copter: mount no longer takes ahrs in constructor
2018-10-30 17:19:14 +11:00
Leonard Hall 54a59f581f Copter: add motor thrust lost check 2018-10-16 00:44:50 +09:00
Peter Barker 26ca75efae Copter: make libraries get EKF control limits themselves 2018-10-09 10:47:38 +11:00
CAO MUQING 71beab7502 Copter: create and update Zigzag flight mode 2018-10-05 10:05:45 +09:00
Peter Barker a30cdf6806 Copter: eliminate failsafe.rc_override_active
Use RC_Channels::has_active_overrides() instead
2018-09-05 11:54:32 +10:00
Peter Barker ec6c59faa3 Copter: move handling of disable-gcs-rc-overrides-channel-option up 2018-09-05 11:54:32 +10:00
SergeyBokhantsev af6303c82b Copter: User parameters implementation 2018-08-31 08:42:03 +09:00
Randy Mackay 920300899e Copter: rename gcs_check_input to gcs_update
this makes the names consistent with Rover and Plane
2018-08-24 15:30:50 +09:00
Peter Barker 09d8a33aaf Copter: stop passing ahrs to PrecLand constructor 2018-08-17 21:14:57 +09:00
Alexander Malishev f5c540a127 Copter: publish navigation info to OSD 2018-08-16 10:26:34 +10:00
Randy Mackay 346e9e36db Copter: remove compass accumulate 2018-08-06 11:05:34 +10:00
Peter Barker e7e56dde7a Copter: move handling of RC switches into RC_Channel 2018-08-01 12:11:30 +09:00
Peter Barker 22f7f29045 Copter: move all of waypoint-takeoff into Mode namespace 2018-07-27 13:08:27 +10:00
SergeyBokhantsev ea3de59107 Copter: implement user auxswitch functions 2018-07-26 20:27:49 +09:00
Peter Barker f06637d48e Copter: update servorelayevents @50Hz rather than 3Hz
One of the functions we allow for is toggling the servo at a set
frequency.  3Hz - the old rate - doesn't allow for precise triggering of
the servo.  This patch increases that rate to 50Hz - somewhat better.
2018-07-20 09:42:58 +09:00
Michael du Breuil 3755b2ac0f Copter: Remove unused ADC include 2018-07-17 09:29:50 +10:00
Peter Barker c2f9b857a4 Copter: remove unused baro_climbrate variable 2018-07-04 21:08:47 +01:00
Peter Barker df83cb034e Copter: use ArmingMethod enumeration 2018-07-03 15:16:38 +10:00
Peter Barker a1f29e92d1 Copter: use singletons in AP_Arming 2018-07-03 13:44:11 +10:00
Andrew Tridgell 20dea6df45 Copter: moved OSD to top level params
this gives us plenty of param depth for a complex param tree
2018-06-27 14:55:00 +10:00
Alexander Malishev f63b3c044a Copter: added OSD support 2018-06-27 14:55:00 +10:00
Peter Barker 7883582c65 Copter: move takeoff state into Mode class 2018-06-26 09:11:21 +09:00
Peter Barker cff1969a29 Copter: make do_user_takeoff a member of Mode 2018-06-26 09:11:21 +09:00
Peter Barker cb26ff64b3 Copter: current_mode_has_user_takeoff -> Mode::has_user_takeoff 2018-06-26 09:11:21 +09:00
Peter Barker 70d159cb38 Copter: raise EKF failure even if USB is connected
This will let EKF go bad if your PixHawk is connected to your laptop.
This doesn't seem to be a problem for the other vehicles.

This also allows the EKF to go bad in-flight if you happen to have
connected (against AP's recommendations) your companion computer to your
flight controller via USB.  Since people do this, it is better to have
the checks than not.
2018-06-26 10:07:55 +10:00
Peter Barker fd9ce90b8e Copter: option to force arm, bypassing checks 2018-06-20 11:43:38 +10:00
murata a970eacf49 Copter: Do not use the Delay method wrapper. 2018-06-16 09:40:47 +09:00
Peter Barker 078d90132c Copter: use AP_RTC
Co-authored-by: patrickelectric@gmail.com

Copter: AP_GPS now sets the system time directly

Copter: use AP_RTC for mission delays

Copter: Remove ap_t bits counter (Patrick José Pereira)

Change bits in ap_t to bool and add a static assert
2018-06-15 08:01:22 +10: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 e3ddf7dadd Copter: rename SPRAYER-enabled-define to SPRAYER_ENABLED 2018-06-01 15:13:05 +09:00
Peter Barker 5f2221fe74 Copter: move handling of VFR_HUD into GCS_MAVLink_Copter 2018-05-29 13:00:40 +10:00
Andrew Tridgell 2425c65e74 Copter: implement 'air-mode' for copter
this implements what betaflight calls 'air-mode'. This gives attitude
control when throttle is at zero, allowing for zero-throttle maneuvers,
plus keeping the copter level on the ground.

This was already implemented if an interlock switch was setup, but it
should also work with an arming switch. If using an arming switch then
throttle should not be considered zero as long as the arming switch
hasn't gone low.
2018-05-29 10:27:14 +09:00
Andrew Tridgell 0d56526400 Copter: added de-bouncing of aux switches
this prevents a crash with a switch such as arm/disarm getting a
single frame RC glitch
2018-05-29 08:26:46 +09:00
Peter Barker 81e9edd80a Copter: move sending of sim state up 2018-05-23 18:36:50 +10:00
Peter Barker 33582107b6 Copter: move sending of GLOBAL_POSITION_INT up to GCS_MAVLINK 2018-05-17 15:48:06 +01:00
Peter Barker da1b2579c4 Copter: move send_attitude up to GCS_MAVLINK 2018-05-17 18:28:43 +10:00
Peter Barker 9dce133938 Copter: handle setting of ekf origin in GCS_MAVLink 2018-05-17 10:13:42 +10:00
Peter Barker 0dc0e54767 Copter: move Log_Write_Home_And_Origin into AP_AHRS 2018-05-17 10:13:42 +10:00
Leonard Hall 656892cd88 Copter: ekf failsafe disabled for acro and stabilize
Also restructure to combine ekf_over_threshold and ekf_check_position_problem
2018-05-10 08:59:37 +09:00
Peter Barker dee40f3fe5 Copter: make scheduler track whether it has called the delay callback 2018-05-09 16:15:38 +10:00
Peter Barker 6dd9f50f7c Copter: move try_send_message handling of RC_CHANNELS up 2018-05-08 12:33:32 +01:00
night-ghost 51a189e906 ArduCopter: devo telemetry support (RX705/707) 2018-04-24 10:44:28 +10:00
Peter Barker ba8b3e2415 Copter: create an AutoYaw helper object to hold auto-yaw state 2018-04-18 13:27:43 +09:00
Pierre Kancir 70805d61f2 ArduCopter: remove inertial_nav from precland constructor 2018-04-17 17:21:35 +09:00
Peter Barker 80549a479e Copter: move throw logging into ModeThrow 2018-04-17 17:16:52 +09:00
Peter Barker c95ff96263 Copter: Baro does its own dataflash logging 2018-04-12 19:12:12 +01:00
Peter Barker d9ab8d6569 Copter: sprayer now uses ahrs singleton; stop passing reference 2018-04-12 14:23:33 +09:00
Pierre Kancir 9e298b3b2f Copter: sprayer uses ahrs in constructor 2018-04-11 09:41:33 +09:00
Randy Mackay 59e4749fd0 Copter: integrate AC_Loiter
includes param conversion
2018-04-04 10:45:10 +09:00
Peter Barker 0c8110ecb2 Copter: factor vehicle's mavlink send_heartbeat 2018-04-03 13:05:19 +01:00
Peter Barker d58e2214d2 Copter: tidy handling of barometer calibrations 2018-04-02 23:25:05 +01:00
Peter Barker cca4d5136e Copter: move common calibration functions up 2018-04-02 23:25:05 +01:00
Dr.-Ing. Amilcar do Carmo Lucas d633ba8c46 Copter: Add option to disable RPM module 2018-03-30 09:36:48 +09:00
Ebin 1ff4019ddf ArduCopter: moved landing control fns from Copter to Mode
land_run_horizontal_control(),land_run_vertical_control(),get_alt_above_ground() moved to Mode
2018-03-29 16:50:00 +01:00
Michael du Breuil 291531e056 Copter: Support new battery failsafes 2018-03-27 22:12:21 +01:00
priseborough 4b00f399b4 Copter: Clarify definition for gps_glitching flag 2018-03-27 20:28:55 +09:00
Peter Barker 45f2312bfe Copter: move home state into AP_AHRS 2018-03-19 10:32:37 +09:00
Peter Barker 2749ee9060 Copter: use ins singleton 2018-03-16 00:37:35 -07:00
Randy Mackay 4a74b1b5e5 Copter: replace NTUN with PSC logging 2018-03-16 13:50:57 +09:00
Leonard Hall 9544b1763b Copter: replace smoothing gain with AC_AttitudeControl::set_input_tc 2018-03-16 13:50:57 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas ed36ec3c29 Copter: add option to disable THROW mode 2018-03-15 07:38:14 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas b27c00dc5f Copter: add option to disable ACRO mode 2018-03-15 07:38:14 +09:00
Randy Mackay af207caa1f Copter: move get_pilot_desired_lean_angles higher in cpp
this makes the definition in the .h and implementation in .cpp files appear in the same order
2018-03-14 09:33:39 +09:00
Ebin 20995b909f Copter: Moved get_pilot_desired_lean_angles to mode.cpp 2018-03-14 09:33:39 +09:00
Peter Barker d88bd52a53 Copter: use baro singleton 2018-03-08 21:20:05 -08:00
Peter Barker bc4f021516 Copter: use AP::ahrs() for ADSB 2018-03-07 12:34:39 +00:00
Peter Barker af56826107 Copter: follow mode fixups
add follow to FLTMODEx param descriptions
remove follow's set_velocity method
10hz logging of desired velocity in follow mode
follow mode uses pos error P gain
add send-debug-via-mavlink option
don't enter follow if follow lib is disabled
follow debug slowed to 1hz
disable follow on min-features builds
2018-03-05 15:08:08 +09:00
Randy Mackay 6ee101ca98 Copter: rename chase to follow 2018-03-05 15:08:08 +09:00
Randy Mackay 053983eb70 Copter: integrate AP_Follow into chase mode 2018-03-05 15:08:08 +09:00
Peter Barker 199455dc56 Copter: add chase mode 2018-03-05 15:08:08 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas bc86ca0e3c Copter: simplify Log_Write_Proximity 2018-03-03 17:13:34 +00:00
Dr.-Ing. Amilcar Do Carmo Lucas bbd1aa1cab Copter: Improve interoperation of AC_AVOID_ENABLED and BEACON_ENABLED 2018-03-03 17:10:26 +00:00
Peter Barker b8e1f03599 Copter: add define for disabling beacon 2018-02-27 07:43:13 +09:00
Peter Barker 5b355214fd Copter: add option to disable CIRCLE flight mode
Saves about 2.4kB of flash
2018-02-27 07:43:13 +09:00
Peter Barker e4898e1d60 Copter: add option to disable GUIDED_NOGPS flight mode
Saves about 6.3kB of flash
2018-02-27 07:43:13 +09:00
Peter Barker 86b162e32f Copter: add option to disable BRAKE flight mode 2018-02-27 07:43:13 +09:00
Peter Barker a7fe242e31 Copter: add option to disable RTL flight mode 2018-02-27 07:43:13 +09:00
Peter Barker b8c432b1a1 Copter: add option to disable GUIDED flight mode
Saves about 6kB of flash
2018-02-27 07:43:13 +09:00
Peter Barker 0ddeb56a05 Copter: add option to disable DRIFT flight mode
Saves about 1kB of space
2018-02-27 07:43:13 +09:00
Peter Barker e5056f8d40 Copter: add option to disable SPORT flight mode
Saves about 1,500 bytes
2018-02-27 07:43:13 +09:00
Peter Barker 7154f4dea4 Copter: add option to disable LOITER mode 2018-02-27 07:43:13 +09:00
Peter Barker 9b440d6b25 Copter: add option to disable SmartRTL mode
Saves 5.5k of Flash
2018-02-27 07:43:13 +09:00
Peter Barker 3a61b86e65 Copter: add option to disable POSHOLD mode
Saves about 4k of Flash
2018-02-27 07:43:13 +09:00
Peter Barker b9ad2bc8db Copter: add option to disable AUTO mode
Saves ~12k of flash
2018-02-27 07:43:13 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas b24e5c3991 Copter: Obey MOUNT == DISABLED 2018-02-22 20:58:51 +10:00
Peter Barker 846506230d Copter: remove pointless initialisations
Also reduce storage size of gps primary
2018-02-22 17:51:35 +10:00
Dr.-Ing. Amilcar Do Carmo Lucas def098bd8a Copter: obey ADSB_ENABLED == DISABLED 2018-02-21 22:11:34 +09:00
Randy Mackay f0534a35d1 Copter: format change for includes
non-functional change
2018-02-21 21:56:01 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas 137de0fea5 Copter: conditionaly include more header files
this should help catch missing macros
2018-02-21 21:55:59 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas 002494c048 Copter: Obey CAMERA == DISABLED 2018-02-21 17:03:28 +10:00
Peter Barker 730adc3f7c Copter: eliminate perf_update scheduler table shim 2018-02-13 17:15:05 +11:00
Peter Barker bfc373aeff Copter: move logging of PM messages to AP_Scheduler 2018-02-13 17:15:05 +11:00
Peter Barker 80a3d63264 Copter: use AP_Scheduler's loop() function 2018-02-13 17:15:05 +11:00
Peter Barker 7f69c5d26d Copter: use scheduler ticks in place of mainloop_count 2018-02-13 17:15:05 +11:00
Andrew Tridgell 7938bd08bb Copter: make flowhold mode conditional
reduces build size on px4-v2 by 4k
2018-02-12 13:34:47 +09:00
murata c31c2a4cf1 Copter: optionalize the winch 2018-02-12 12:16:57 +09:00
Peter Barker 40d74584ac Copter: remove shims used in scheduler 2018-02-12 11:19:34 +09:00
Andrew Tridgell 0ed75052f8 Copter: enable parameters inside mode objects
this adds FHLD_* parameters for FlowHold mode. It is a large patch as
it needs to disentagle the mode class to enable it to be used in
Parameters.h
2018-02-08 17:36:33 +11: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
Andrew Tridgell f442b91ea5 Copter: added FLOWHOLD flight mode
This flight mode allows for position hold with optical flow without
needing a rangefinder for height. It can estimate its height from the
flow data and IMU
2018-02-08 17:36:33 +11:00
Andrew Tridgell 15166eff2e Copter: enable temperature calibration library 2018-02-08 17:36:33 +11:00
Michael du Breuil 69da4041ac Copter: Move logging battery logging code to AP_BattMonitor 2018-02-06 00:11:32 +00:00
Pierre Kancir 10e6fe43dd Copter: Add a switch option to enable/disable RC_Override 2018-01-24 21:37:41 +09:00
Randy Mackay 6546ccbb3f Copter: velocity pi moved to position control library 2018-01-23 12:00:43 +09:00
Dylan Herman 20fe5bb98f Copter: add SmartRTL failsafe action
Adds SmartRTL or RTL and SmartRTL or Land failsafe options for batt, throttle, and GCS failsafes
2018-01-22 10:54:28 +09:00
Peter Barker dda38d65eb Copter: AP_AHRS no longer requires GPS in constructor 2017-12-27 00:58:02 +00:00
Randy Mackay 2c0df87585 Copter: Copter.h method reordering 2017-12-15 08:26:45 +09:00
Peter Barker 6c82f7671d Copter: move all commands logic into AUTO flightmode 2017-12-14 14:08:01 +09:00
Andrew Tridgell 8ab0ac8a16 Copter: removed create() method for objects
See discussion here:

  https://github.com/ArduPilot/ardupilot/issues/7331

we were getting some uninitialised variables. While it only showed up in
AP_SbusOut, it means we can't be sure it won't happen on other objects,
so safest to remove the approach

Thanks to assistance from Lucas, Peter and Francisco
2017-12-14 08:12:28 +11:00
Peter Barker 377466ddda Copter: fence no longer requires AP_InertialNav 2017-12-13 10:04:50 +09:00
Randy Mackay 2d23e1f7c7 Copter: rename flightmode_ objects to mode_ 2017-12-12 10:39:26 +09:00
Randy Mackay c3fbf2671c Copter: rename control_xx.cpp files to mode_xx.cpp 2017-12-12 10:39:26 +09:00
Randy Mackay 06fbe8f3a7 Copter: rename FlightMode class to Mode
also remove unused print_FlightMode method
2017-12-12 10:39:26 +09:00
Randy Mackay 0ac708b5a0 Copter: remove ability to disable PosHold flight mode
This flight mode is stable and regularly used so it is unlikely that we ever want to disable it
2017-12-12 10:39:26 +09:00
Randy Mackay 8870897847 Copter: FlightMode objects use lower case 2017-12-12 10:39:26 +09:00
Peter Barker 5d33cf08e1 Copter: eliminate calc_home_distance_and_bearing
Calling update_simple_mode_bearing calls get-heading
rather than the other way around

This will have the advantage of not calculating home bearing
when we stop calling update_simple_mode_bearing unnecesarily
2017-12-09 16:26:09 +09:00
khancyr b44ba29a05 AC_Avoidance: replace AP_InertialNav by AHRS 2017-12-08 11:27:37 +09:00
Peter Barker 103e2cc711 Copter: calculate wp bearing and distance on demand
Move responsibility for calculating wp bearing/distance
into the FlightMode object doing the navigation

Calculating these variables was being done at 50Hz where they
were used at 10Hz max.
2017-12-07 07:43:08 +09:00
Peter Barker 4ae2be55aa Copter: fix up autotune namespacing
This moves static variables into the autotune flightmode object.

It also adjusts namespacing on everything to take advantage of
having everything encapsulated in the AutoTune object
2017-12-07 07:35:37 +09:00
Peter Barker 7b637334f4 Copter: eliminate mode_has_manual_throttle 2017-12-06 10:09:58 +09:00
Peter Barker 4fd61ed6dc Copter: make exit_mode take FlightMode objects as arguments 2017-12-06 10:09:58 +09:00
Peter Barker 477ae8f7be Copter: pass heli_flags into flightmode constructor 2017-12-06 08:24:24 +09:00
Peter Barker 83d0a71e10 Copter: FlightMode - simplify flight mode initialization 2017-12-06 08:24:24 +09:00
Peter Barker ef1489e87a Copter: eliminate mode_requires_gps 2017-12-06 08:24:24 +09:00
Peter Barker a4859e13c1 Copter: eliminate mode_allows_arming 2017-12-06 08:24:24 +09:00
Peter Barker 9c60c1de58 Copter: FlightMode - convert SMARTRTL flight mode 2017-12-06 08:24:24 +09:00
Peter Barker b0e34bd307 Copter: FlightMode - convert GUIDED_NOGPS flight mode 2017-12-06 08:24:24 +09:00
Peter Barker cf423ce681 Copter: FlightMode - convert THROW flight mode 2017-12-06 08:24:24 +09:00
Peter Barker 37c706c24e Copter: FlightMode - convert AVOID_ADSB flight mode 2017-12-06 08:24:24 +09:00
Peter Barker 51cd143012 Copter: FlightMode - convert BRAKE flight mode 2017-12-06 08:24:24 +09:00
Peter Barker cafce01357 Copter: FlightMode - convert POSHOLD flight mode 2017-12-06 08:24:24 +09:00
Peter Barker 67063d6b1e Copter: FlightMode - convert AUTOTUNE flight mode 2017-12-06 08:24:24 +09:00
Peter Barker 018c70d224 Copter: FlightMode - convert FLIP flight mode 2017-12-06 08:24:24 +09:00
Peter Barker 5e3e831152 Copter: FlightMode - convert SPORT flight mode 2017-12-06 08:24:24 +09:00
Peter Barker 6a38664ff4 Copter: FlightMode - convert DRIFT flight mode 2017-12-06 08:24:24 +09:00
Peter Barker 682f3c0e7e Copter: FlightMode - convert RTL flight mode 2017-12-06 08:24:24 +09:00
Peter Barker 3b1ca99b95 Copter: FlightMode - convert LAND flight mode 2017-12-06 08:24:24 +09:00
Peter Barker 2db09ba0f7 Copter: FlightMode - convert GUIDED flight mode 2017-12-06 08:24:24 +09:00
Peter Barker f2495b2d08 Copter: FlightMode - convert LOITER flight mode 2017-12-06 08:24:24 +09:00
Peter Barker 871ba5630f Copter: FlightMode - convert CIRCLE flight mode 2017-12-06 08:24:24 +09:00
Peter Barker e2b70c3a0a Copter: FlightMode - convert AUTO flight mode 2017-12-06 08:24:24 +09:00
Peter Barker a95a35c134 Copter: FlightMode - convert STABILIZE flight mode 2017-12-06 08:24:24 +09:00
Peter Barker 79c06974b7 Copter: FlightMode - convert ALT_HOLD flight mode 2017-12-06 08:24:24 +09:00
Peter Barker d74f0c72da Copter: FlightMode - convert ACRO flight mode 2017-12-06 08:24:24 +09:00
Peter Barker 527a536b78 Copter: FlightMode - remove function parameters
Use current control_mode in place of parameters

Once conversion is complete these functions will disappear
2017-12-06 08:24:24 +09:00
Peter Barker 99a22a263d Copter: a FlightMode base class 2017-12-06 08:24:24 +09:00
Peter Barker e0233f1dc4 Copter: create a takeoff_state_t type 2017-12-06 08:24:24 +09:00
Peter Barker b828fa4ffc Copter: Create an ap_t type 2017-12-06 08:24:24 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas c7a2fcdc37 Copter: Also use fence in Guided_PosVel mode 2017-12-05 08:57:55 +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
Peter Barker 398d07a68a Copter: tighten return types of mavlink functions and variables 2017-12-01 17:01:10 +00:00
Dr.-Ing. Amilcar Do Carmo Lucas 9773365237 Copter: NFC spell in comments 2017-11-27 23:13:34 +09:00
Andrew Tridgell a644cff921 Copter: support testing multiple motors with motortest
this matches the quadplane behaviour, allowing a sequence of motors to
be tested
2017-11-27 10:15:31 +09:00
Randy Mackay 9a03ba1bfb Copter: move barometer_accumulate to sensors.cpp
non-functional change
2017-11-22 17:13:14 +09:00
Peter Barker 04c9e966e0 Copter: use AP::PerfInfo library 2017-11-16 15:31:53 +00:00
Peter Barker d959e4b42b Copter: AP_Camera uses GPS singleton 2017-11-16 15:28:37 +00: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 5b793252ed Copter: stop disarming as part of running rtl as mission item
Fixed #6324

Note that the land-as-mission-item code is duplicated from the
rtl-as-mode code but omits the disarm part, so doesn't suffer from the
same bug.
2017-11-06 19:07:28 +00:00
Peter Barker c7216a2740 Copter: call ins periodic function 2017-10-27 16:33:45 +11:00
Randy Mackay 787954fa37 Copter: integrate winch library
fixes after peer review:
rename winch-disable to winch-relaxed
add DO_WINCH to do-verify
winch release-length accepts rate
2017-10-27 09:20:38 +09:00
Andrew Tridgell 951ed95eb9 Copter: support inverted flight CH7 option 2017-10-03 10:16:41 +11:00
Lucas De Marchi beabae6a98 global: use static method to construct AP_AHRS_NavEKF 2017-09-26 03:01:21 +01:00
Lucas De Marchi c9fbf7b722 global: use static method to construct AP_NavEKF3 2017-09-26 03:01:21 +01:00
Lucas De Marchi e2fe36357a global: use static method to construct AP_NavEKF2 2017-09-26 03:01:21 +01:00
Lucas De Marchi 6781a44046 global: use static method to construct AP_Avoidance_* 2017-09-26 03:01:21 +01:00
Lucas De Marchi 6d009cdf6e global: use static method to construct AP_ADSB 2017-09-26 03:01:21 +01:00