Commit Graph

12086 Commits

Author SHA1 Message Date
Randy Mackay 0665cf6b28 Copter: RTL alt should not be above fence alt
Resolves issue #435
If the altitude fence is enabled, when the vehicle RTLs it will return
at the lower of the RTL_ALT and the FENCE_ALT_MAX
2014-04-27 15:41:37 +09:00
Randy Mackay 4686eef266 Copter: GPS failsafe ensures LAND is pilot-controlled
This resolves issue #880 in which if a GPS failsafe occurred while the
vehicle was already in LAND mode, the LAND would continue to be GPS
controlled LAND instead of pilot-controlled LAND
2014-04-27 15:11:47 +09:00
Andrew Tridgell 2acddb9696 Replay: fixed ahrs.set_fly_forward() in Replay for copter 2014-04-27 15:37:02 +10:00
Andrew Tridgell cf9b67d8fc GCS_MAVLink: prevent uninitialised bytes being written to a serial port 2014-04-27 15:34:30 +10:00
Andrew Tridgell 0306dbf5f1 Plane: moved auto mode variables to auto_state 2014-04-27 15:34:30 +10:00
Randy Mackay dba8fac515 Copter: remove unused variables from fence.pde
saves 2 bytes
2014-04-27 11:11:12 +09:00
Randy Mackay 1aeaa5955b Copter: integrate 10sec manual recovery after fence breach 2014-04-27 11:11:09 +09:00
Randy Mackay e855cfec02 AC_Fence: add 10sec manual recovery
This resolves issue #461 by giving the pilot a minimum of 10 seconds to
attempt to manually recover before the autopilot will attempt to retake
control to bring the copter home or land.
2014-04-27 11:11:07 +09:00
Randy Mackay 20de5b3006 Copter: Loiter clears out pilot acceleration when failsafe occurs
This ensures invalid pilot desired accelerations are cleared from the
loiter controller.  This is probably not strictly necessary because the
vehicle should switch out of Loiter and into RTL during failsafe.
2014-04-25 14:45:19 +09:00
Randy Mackay 05d9dc5cba Copter: RTL always land if in radio failsafe
Resolves issue in which vehicle would get stuck at RTL_ALT_FINAL if
failsafe occured.
Also clear out pilot acceleration from loiter controller if failsafe
occurs during the final descent.
2014-04-25 14:45:16 +09:00
Randy Mackay db51d37071 AC_WPNav: add clear_pilot_desired_acceleration
This allows quickly clearing out the pilot desired acceleration for
loiter contoller.
2014-04-25 14:45:14 +09:00
Randy Mackay 40650aeb68 Copter: roll and pitch nudging in RTL descent 2014-04-25 14:17:03 +09:00
Michael Oborne 68f439acbe Fix auto doc group names 2014-04-25 07:53:03 +08:00
Randy Mackay 06bef6e3b8 Parachute: clear release time when enabled
This resolves an issue in which the parachute could be suddenly released
when the user enabled the parachute.  The sequence that could have
caused this bad behaviour were (1) the parachute is triggered (2) the
user disables the parachute in the 0.5sec between the trigger and the
actual release, (3) the user re-enables the parachute and the old
release time from (1) is used.
2014-04-24 19:22:11 +09:00
Randy Mackay 19f1e7fec4 Copter: disable Parachute by default
This saves 1k of flash and we are desperately low on the APM1/APM2.
Hopefully we can find savings somewhere and re-enable it by default.
2014-04-24 19:02:32 +09:00
Randy Mackay ea64438ef9 Copter: RTL ensures heading is back to initial heading
This fixes the issue in which a short RTL_LOIT_TIME could cause the
vehicle's heading to be caught between it's heading when it arrived at
home and the initial armed heading.  With this fix it now waits above
home until the timer has run out AND the heading is within 2degrees of
the initial armed heading.
2014-04-24 18:54:49 +09:00
Randy Mackay e23115516d Copter: disarm after completing RTL
Note that an RTL command executed in AUTO mode will also disarm when it
lands and pilot's throttle is put to zero and no further commands will
be executed.  This is normally not an issue because missions generally
end with an RTL (instead of having the RTL in the middle) and a work
around is available in that the LAND command could be used instead of
RTL.
2014-04-24 17:27:30 +09:00
Randy Mackay ad99918fee AC_WPNav: recalc leash lengths if set_horizontal_velocity is called
Resolves bug in which do-set-speed allowed reducing the speed during the
mission but not increasing it.
Slow down distance is also recalculated.
Unnecessary call to calc_wp_leash_length removed from
set_spline_origin_and_destination.
2014-04-24 13:16:08 +09:00
Randy Mackay 46fba47c8e AC_WPNav: slow target point's speed near destination 2014-04-24 13:16:00 +09:00
Randy Mackay a5602c5f14 Copter: updated contributors list
Add JulianD and SandroT and replaced tabs with spaces
2014-04-24 11:28:41 +09:00
Ju1ien 78a3e0f5a2 Copter: Hybrid removed Wind_comp_estimate filter
Removed useless call of function
hybrid_get_wind_comp_lean_angles(hybrid.wind_comp_roll,
hybrid.wind_comp_pitch);
Removed 10Hz filter for hybrid_update_wind_comp_estimate()
2014-04-24 11:28:37 +09:00
Andrew Tridgell 08412391f5 Plane: fixed a bug when switching to another mode from auto takeoff
when you exit auto and a takeoff is still in progress the flight stage
was not updated, which led to the throttle staying at maximum

Many thanks to Marco for finding this!
2014-04-23 21:18:11 +10:00
Linus Penzlien 85b28fbaee test: Linus was here 2014-04-23 17:53:44 +09:00
priseborough ecc8e45eda AP_NavEKF: Fix bug in position reset logic 2014-04-23 18:16:02 +10:00
Andrew Tridgell b0fd94f18e AP_GPS: initialise a variable in uBlox driver 2014-04-23 18:15:53 +10:00
Randy Mackay 287af8f66e Copter: disable optical flow by default
We have run out of flash on the APM2, it was a choice between Hybrid
flight mode and OF_Loiter
2014-04-23 15:27:08 +09:00
Randy Mackay 55e7e1eb3e Copter: allow HYBRID to be disabled to save flash
Hybrid flight mode costs 4.5k of flash which currently puts us over the
limit for APM1 and APM2 unless optical flow or other features are
disabled
2014-04-23 15:27:05 +09:00
Randy Mackay 7c02a02bd8 AC_WPNav: reset_I flag moved to position controller 2014-04-23 15:00:14 +09:00
Randy Mackay 098f8169b0 AC_PosControl: add keep_xy_I_terms method
Stops horizontal PID's I terms from being reset when the controller is
next updated
2014-04-23 15:00:12 +09:00
Randy Mackay ba94fc9796 Copter: Hybrid move reset_I into structure
Saves 1 byte of RAM
2014-04-23 15:00:09 +09:00
Randy Mackay 4d5b73b968 AC_WPNav: add reset_I to set_loiter_target 2014-04-23 15:00:07 +09:00
Ju1ien ff532a06ec Copter: Hybrid fixes to wind_comp, brake pitch timer, thr peaks
There was an error in the velocity axis used to update
brake_timeout_pitch (vel_right instead of vel_fw)

The wind_comp was not enough filtered for the Pixhawk (400Hz), so I
added a specific time constant (TC_WIND_COMP) to have the expected
filter with 400Hz controllers.

About throttle peaks, after some tests and from logs, they happen when
hybrid switches to loiter.
There is always a difference between Alt and DesiredAlt (DAlt), but,
when loiter engages, it initializes DAlt = Alt and the copter tries
immediatelly to reach that new setpoint. So the solution would be to
init_loiter_target() just as it was in pre-onion code : only x/y and not
z. and to be able to pass parameters like that
wp_nav.init_loiter_target(inertial_nav.get_position(), Vector3f(0,0,0));

Well, from this new code structure, it seems not possible with current
functions so I've used set_loiter_target that init position passed as
parameter and velocity to 0 (as expected).
BTW, I think there was something wrong with set_loiter_target function,
the "Vector3f& position" parameter was not used at all...
I moved the reset flag from init_loiter_target to set_loiter_target.
2014-04-23 15:00:04 +09:00
Ju1ien 14cbb09804 Copter: hybrid add Brake or Loiter to Pilot override transition
Corrected a little mistake in get_wind_comp...()
Mixed transition not only from loiter but as well from brake to manual
override
2014-04-23 15:00:01 +09:00
Ju1ien 43b1dd748b Copter: hybrid init brake roll and pitch at loiter exit 2014-04-23 14:59:59 +09:00
Ju1ien d745060c80 Copter: fix Hybrid flight mode in Parameter description 2014-04-23 14:59:56 +09:00
Ju1ien f8e8d4024d Copter: Hybrid's max brake angle to 30deg 2014-04-23 14:59:53 +09:00
Ju1ien 6c71569775 AC_PosControl: update_xy_controller allows not resetting I term 2014-04-23 14:59:49 +09:00
Ju1ien 5d0476e522 AC_WPNav: add reset_I to init_loiter_target 2014-04-23 14:59:47 +09:00
Ju1ien b3e8112d24 Copter: Hybrid fix wind_comp time constant
Corrected timer init values and wind_comp time constant to get the best
behaviour

Check if wider deadband required (current is 30).
We were using a comparison to a 70-100 cdeg deadband in our initial
code. The deadband was there to avoid unwanted switches in case of
inaccurate fingers/radio

Adjusted timers to 100/400Hz

I_term does not init when in hybrid loiter
2014-04-23 14:59:43 +09:00
Randy Mackay 4778c73de2 Copter: Hybrid 10hz updates to wind comp lean angles 2014-04-23 14:59:40 +09:00
Randy Mackay f87ab21063 Copter: Hybrid estimates wind when speed under 10cm/s 2014-04-23 14:59:38 +09:00
Randy Mackay d36f137bf8 Copter: allow arming, disarming in Hybrid mode 2014-04-23 14:59:35 +09:00
Randy Mackay e2aaafe40b Copter: hybrid works for 100hz and 400hz 2014-04-23 14:59:33 +09:00
Randy Mackay 705ff3f44f Copter: add hybrid_mix_controls
Allow wind comp estimate to run when vehicle travelling up to 30cm/s
(was 10cm/s)
2014-04-23 14:59:30 +09:00
Randy Mackay e48c93d93c Copter: restructure hybrid into more states 2014-04-23 14:59:28 +09:00
Randy Mackay f467d7bc20 Copter: add Hybrid parameters 2014-04-23 14:59:25 +09:00
Randy Mackay 754bae5748 Copter: refactor and split out wind compensation 2014-04-23 14:59:23 +09:00
Randy Mackay d9c685323a Copter: add hybrid state struct, formatting changes 2014-04-23 14:59:20 +09:00
Randy Mackay b5ed23f592 Copter: integrate skeleton Hybrid mode 2014-04-23 14:59:17 +09:00
Ju1ien 832fc62016 Copter: control_hybrid initial version 2014-04-23 14:59:15 +09:00