Commit Graph

98 Commits

Author SHA1 Message Date
Michael du Breuil f9b4e81702 Copter: Add ignore pilot yaw to guided, auto and RTL options 2020-11-19 07:22:54 +09:00
Randy Mackay 7a90ed4bb5 Copter: auto allows arming casts param to uint32_t 2020-10-20 23:04:45 +09:00
Randy Mackay c1c9d87efe Copter: move auto allows_arming in mode_auto.cpp
this should be a non-functional change
2020-10-20 23:04:45 +09:00
Randy Mackay 8b3cc0b255 Copter: fixup auto options 2020-10-01 08:48:06 +09:00
Michael du Breuil 50dfe3f197 Copter: Add AUTO_OPTIONS and support arming and throttle bypass
This allows you to arm the copter without any extra GCS commands while
in auto, and can be done from both the GCS, or the RC Tx. This is useful
for creating a simpler workflow.

This also allows you to set the auto_armed flag internally, which
bypasses the need to raise the throttle stick for the copter to start a
takeoff.

This exposed a problem where we would start running the controllers
before the EKF was at all initialized, if you switched into auto to
early. This now has a check that prevents us from running the mission
state machine until after the origin has been set. This was a suggestion
from @rmackay9.

When combined these options allow you to have the vehicle on the ground,
disarmed in auto with a takeoff waypoint loaded, then just arm the
aircraft and watch it takeoff. This is a feature we've had on quadplanes
for quite awhile now, and it has proven to be very nice for operators.
2020-10-01 08:46:29 +09:00
Randy Mackay 29a2be2d63 Copter: minor comment fix 2020-09-09 15:32:37 +09:00
Randy Mackay 925f76c048 Copter: integrate winch changes
includes the following changes
winch_update called at 50hz
removed ability to set winch rate from ch6 tuning
remove wheel encoder
call winch library to log at 10hz
fix winch param prefix
2020-08-07 21:55:07 +09:00
Andy Piper 54c3d07547 Copter: make make/gimbal configurable on a per-board basis 2020-08-04 09:18:14 +10:00
Randy Mackay d2b94bd45d Copter: verify_circle removes redundant setting of circle center
the circle center is already set in circle_movetoedge_start
2020-06-03 10:08:52 +09:00
Andrew Tridgell e673bd8909 Copter: implement disarm on land based on MIS_OPTIONS
only continue with mission if MIS_OPTIONS bit is set
2020-06-02 09:12:22 +09:00
murata 520782d7f2 Copter: Correction of spelling errors (NFC) 2020-05-18 13:26:11 +10:00
Randy Mackay d9ecf51457 Copter: auto mode loiter-turns accepts pilot yaw input 2020-04-27 09:39:46 +09:00
Randy Mackay c4b5d47e1f Copter: white space fixes 2020-04-23 13:17:11 +09:00
Rishabh 1edf1d265c Copter: Set correct yaw for circle in Mode Auto 2020-04-21 20:12:38 +09:00
Randy Mackay 71cbedb178 Copter: support circle with terrain altitude 2020-04-16 17:30:29 +09:00
Randy Mackay 8d99f204b0 Copter: integrate landing gear option and make edge based
also guided mode now retracts landing gear after takeoff
previously landing gear deployment was "level based" meaning the pilot could not override the gear's position
2020-02-26 08:01:00 +09:00
Peter Barker ce5f23810b ArduCopter: log disarm method 2020-02-22 12:16:29 +11:00
Randy Mackay 495c4ad6b6 Copter: remove unused ModeAuto::wp_start
this version accepts an offset from the ekf origin which is not required.  All callers provide a Location
2020-02-17 14:30:18 +09:00
Randy Mackay 39a6b104dd Copter: move RTLState to ModeRTL 2019-12-17 20:02:01 +09:00
Peter Barker 2296448027 Copter: make private enum class for LAND mode's state 2019-12-03 07:38:22 +08:00
Randy Mackay de5945bea5 Copter: use const reference when retrieving wpnav destination 2019-11-12 08:50:05 +08:00
Randy Mackay d0d07776ec Copter: auto stays in takeoff submode after reaching altitude 2019-11-12 08:50:05 +08:00
Peter Barker e6c6189fe5 Copter: cope with change in namespace of LogEvent enum
Also move Acro Trainer types into an enum class as the global defines
interfere with the Event names.

Also eliminate the Log_Write_Event wrappers.
2019-11-05 08:19:26 +08:00
Michael du Breuil b42b1c08c4 Copter: Support new AP_Vehicle::set_mode 2019-10-25 08:48:22 +08: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 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