Commit Graph

118 Commits

Author SHA1 Message Date
Tatsuya Yamaguchi c42681f4f2 Copter: add exit() method to Mode class 2021-04-26 09:56:34 +09:00
Randy Mackay 6a98ad5a29 Copter: loiter-turns fix 2021-04-12 08:30:19 +09:00
Randy Mackay 96267553cf Copter: auto detects mission changes 2021-04-03 12:07:59 +09:00
Randy Mackay 238d102a56 Copter: auto's wp_start skips submode change on terrain failsafe 2021-04-03 12:07:59 +09:00
Leonard Hall 328c0655e3 Copter: support for SCurves and position controller changes
wp_start provides next_dest_loc
send next_destination to wp_nav instead of setting fast_waypoint
fixup zigzag for S-curve changes
fixup guided
auto spline fixes
smart rtl rename of next_point to dest_NED
loc_from_cmd accepts default location
auto mode stops before starting land command
auto do_next_wp accepts default location
rename do_next_wp to set_next_wp
also rename get_spline_from_cmd argument
also improve failure to set next waypoint due to missing terrain data
also fixup comment in set_next_wp
also auto stops when moving from straight to spline segments
also auto mode spline fix
also auto mode calls AC_WPNav::set_spline_destination_next

Copter: AutoYaw provides rate from WPNav
2021-04-03 12:07:59 +09:00
Peter Barker d387ad9921 Copter: have allows_arming take a AP_Arming::Method rather than bool from_gcs
This API predates us having the arming methods being passed around.

This makes the calls look like Plane
2021-03-30 09:00:26 +09:00
Josh Henderson f65c4df358 ArduCopter: make Location(Vector3f) require ALTFRAME 2021-03-30 08:56:35 +09:00
Tatsuya Yamaguchi 0cce5699b2 Copter: change from control_mode to flightmode 2021-03-23 22:48:20 +11:00
Randy Mackay 1c350514ca Copter: auto mode starts or updates mission from run method 2021-03-23 10:12:08 +09:00
Tatsuya Yamaguchi ed8384b45a Copter: add option to disable LANDING_GEAR 2021-03-17 10:41:11 +09:00
Randy Mackay be29b23195 Copter: do-mount-control ignored if no mount
Co-authored-by: srirajshukla <srirajshukla@gmail.com>
Co-authored-by: Yash Vadi <yvadi9274@yahoo.com>
2021-03-16 10:07:16 +09:00
James O'Shannessy d055d7a581 ArduCopter: Cleanup - removes autoenabling of fence with AC_Fence parameter 2021-03-05 14:52:46 +11:00
James O'Shannessy f14e1c2799 ArduCopter: Ensure fence has opportunity to auto disable for landing 2021-03-05 14:52:46 +11:00
James O'Shannessy a88f2721a8 ArduCopter: Use auto enable and auto disable from AC_Fence 2021-03-05 14:52:46 +11:00
James O'Shannessy f228adfa75 ArduCopter: Improve auto-enable/disable of fence 2021-03-05 14:52:46 +11:00
Dr.-Ing. Amilcar do Carmo Lucas 92122e5133 Copter: automatically enable and disable floor fence on automated takeoff and landing 2021-03-05 14:52:46 +11: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
Leonard Hall 5efe94a771 Copter: use AP_Math control functions 2021-01-20 18:19:40 +11:00
Randy Mackay 0b83d45163 Copter: verify land and payload place record flow-of-control internal error 2021-01-20 09:12:02 +09:00
Randy Mackay b8c58bd900 Copter: payload place fixups 2020-12-05 08:35:03 +09:00
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