Commit Graph

5379 Commits

Author SHA1 Message Date
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 7222380598 Copter: populate system status bits for fence 2017-12-13 10:04:50 +09:00
Peter Barker 377466ddda Copter: fence no longer requires AP_InertialNav 2017-12-13 10:04:50 +09:00
Peter Barker d09b0696db Copter: correct checking of heli mode change
init() may have changed all sorts of things about the
vehicle - wp navigation, position controllers, attitude controllers...

Do the heli check before doing any of that so we don't change state and
then fail to change mode
2017-12-13 08:49:01 +09:00
Randy Mackay 7504237fbb Copter: rename flight_mode.cpp to mode.cpp 2017-12-12 20:39:48 +09:00
Randy Mackay 99bafb0df1 Copter: rename heli_control_xx to mode_xx_heli 2017-12-12 10:39:26 +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 6e9de7e609 Copter: flight_mode formatting changes
non-functional change
2017-12-12 10:39:26 +09:00
Randy Mackay 2e71a641c3 Copter: FlightMode allow_arming format changes
non-functional change
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 7494eb2e77 Copter: alphabetise flight mode header file 2017-12-12 10:39:26 +09:00
Randy Mackay a90979ec8e Copter: remove FlightMode_Avoid_ADSB.h file 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
Randy Mackay 20d7216179 Copter: remove comments
non-functional change
2017-12-12 10:39:26 +09:00
Randy Mackay ac8c2b3f03 Copter: resolve compiler warning from flight-mode declaration 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 adf4140b9b Copter: fix heli-flags compilation issue 2017-12-06 08:24:24 +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 0ca5605b8d Copter: FlightMode: remove virtual from many methods 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 1de99c737e Copter: remove unimplemented heli desired_yaw_rate 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