Commit Graph

74 Commits

Author SHA1 Message Date
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 c0774e74e0 Copter: fix format-string compilation warning
../../ArduCopter/mode_auto.cpp: In member function 'void ModeAuto::do_nav_delay(const AP_Mission::Mission_Command&)':
../../ArduCopter/mode_auto.cpp:1372:84: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
     gcs().send_text(MAV_SEVERITY_INFO, "Delaying %u sec",nav_delay_time_max_ms/1000);
                                                                                    ^

This is with a mini-pix build.
2019-08-21 18:48:45 +09:00
Tom Pittenger 0983a04d52 Copter: NAV_Delay variable timers to be all unsigned and labeled as _ms 2019-08-19 15:24:06 -07:00
Randy Mackay 709c874d8b Copter: integrate AP_OAPathPlanner 2019-08-17 09:42:43 +09:00
liang e422f2b2fd Copter: mode_auto: retract the landing gear automatically 2019-07-30 09:46:18 +09:00
Leonard Hall c56acb49d6 Copter: Add missing Loiter initialisation lines.
This command is missing to define the desired acceleration that loiter will initalise to.
loiter_nav->clear_pilot_desired_acceleration();
2019-07-20 16:40:51 +09:00
Randy Mackay b7a748df88 Copter: auto's wp_start accepts terrain alts 2019-07-18 09:01:09 +09:00
Peter Barker e3da6d69d5 Copter: mode_auto: don't set takeoff dest from bad current location 2019-06-18 09:07:56 +09: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 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
Randy Mackay 791b6effdd Copter: fix wp distance and bearing reporting during LOITER_TURNS 2019-05-07 13:54:31 +09:00
Pierre Kancir caf925eda5 Copter: factorize arm or land check 2019-04-16 10:17:47 +09:00
Peter Barker 46a6f45e4a Copter: adjust for desired spool state and spool state renames 2019-04-14 12:18:03 +09:00
bnsgeyer 94738c3f86 Copter: change make_safe_shut_down to make_safe_spool_down 2019-04-08 09:42:21 +09:00
bnsgeyer f96da56ad6 Copter: Allow safe shutdown before disarming 2019-04-08 09:42:21 +09:00
Leonard Hall 593925567b Copter: formatting fixes 2019-04-08 09:42:21 +09:00
Randy Mackay a6bfafefb0 Copter: move loiter and wpnav init out of make_safe_shut_down
resolves autotest RTLSpeed test failure
2019-04-08 09:42:21 +09:00
Leonard Hall 38cc5a817f Copter: consolidate mode state decisions
bnsgeyer and rmackay9 contributed to these changes

make_safe_shut_down waits for spool down before disarming
remove use of attitude_control::set_throttle_out_unstabilized to consolidate logic between multicopters and tradhelis
2019-04-08 09:42:21 +09:00
Peter Barker c7e21d95ef Copter: move Log_Write_Error into library 2019-03-27 12:36:40 +11:00
Peter Barker 366051c39f Copter: use enum class for AltFrame enumeration 2019-03-19 10:31:18 +11:00
Randy Mackay e57ec068f0 Copter: remove duplicate guided limit-init-time-and-pos
this is called from nav_guided_start()
2019-03-15 14:51:35 +09:00
Randy Mackay 8d66c5f547 Copter: move do_payload_place handler
commands are placed in numerical order
2019-03-15 14:51:35 +09:00
Peter Barker 281dbfcef8 Copter: support send_extended_sys_state 2019-03-12 09:16:13 +09:00
Peter Barker fab2d59a1c Copter: move check for position up 2019-03-01 13:43:20 +09:00
Randy Mackay 384bca9482 Copter: stop at waypoint depending upon next command 2019-02-27 13:30:40 +09:00
Arjun Vinod d02d897928 Copter: make LOITER_TIME send "Reached command" message to GCS 2019-02-26 10:19:37 +09:00
Arjun Vinod 8044d98382 Copter: do an early-return if the time hasn't been reached 2019-02-26 10:14:56 +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 228d7b676d Copter: move responsibility for parachute deployment up 2019-02-13 09:25:27 +09:00
Peter Barker 587e02e92e Copter: remove pv_ functions that duplicate Location functions 2019-02-06 11:02:50 +09:00
Randy Mackay 42c7f5ceb4 Copter: integrate WPNAV::set_speed_z split to set_speed_up and set_speed_down 2019-01-31 19:34:32 +09:00
Randy Mackay 717fb4d823 Copter: integrate AC_WPNav::get_speed rename to get_default_speed 2019-01-31 19:34:32 +09:00
Peter Barker 6fc76a32af GLOBAL: use AP::logger() and strip redundant Log_ from methods 2019-01-18 18:08:20 +11: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
Peter Barker 73940df48e Copter: move mission into mode_auto 2018-11-09 13:35:40 +09:00
Peter Barker 7e581da1cf Copter: implement misson LOITER_TO_ALT 2018-10-30 17:50:46 +09:00
Peter Barker a339d77f08 Copter: let AP_Mission handle common camera commands 2018-10-30 15:37:18 +11:00
Peter Barker f97281eb48 Copter: move servorelayevents mission handling into AP_Mission 2018-10-30 15:37:18 +11:00
Peter Barker 1eec264d6c Copter: mission library handles gripper 2018-10-30 15:37:18 +11:00
Dr.-Ing. Amilcar Do Carmo Lucas b74ae2d912 Copter: Obey and preserve DO_SET_ROI commands when executing LOITER_TURNS mission commands 2018-10-23 10:19:05 +09:00
Peter Barker 7af119b497 Copter: factor out loc_from_cmd from three functions 2018-10-16 10:17:12 +11:00
Peter Barker 5f552a6ce3 Copter: stop shadowing members of Copter
These references were taken to make the breaking out of Modes in Copter.

A lot of other code has already caused these sorts of things to go away,
but these particular ones seem reasonable to fix by pointing the users
at the copter object directly.
2018-10-16 10:17:12 +11:00
Peter Barker e02a645354 Copter: use fabsf() instead of labs()
wrap_180_cd returns a float

substracting a float from an int32 returns a float
2018-10-16 10:17:12 +11:00
chobitsfan d94663d5af Copter: support changing vertical speed in DO_CHANGE_SPEED 2018-10-13 13:16:26 +09:00
Peter Barker 26ca75efae Copter: make libraries get EKF control limits themselves 2018-10-09 10:47:38 +11:00
Leonard Hall 1b5b46dab5 Copter: Missing Loiter Init on accel 2018-09-19 17:29:55 +09:00
Michael du Breuil 470548a100 Copter: Allow starting mission commands to fail 2018-09-11 06:42:00 +10:00
Pierre Kancir 17c12dab2a Copter: correct payload_place flytolocation 2018-08-17 21:14:57 +09:00
Pierre Kancir 84ff9c6928 Copter: switch to pos control when takeoff finish 2018-07-31 10:40:57 +10:00