Commit Graph

64 Commits

Author SHA1 Message Date
Tom Pittenger 7cde90553d Plane: new param CRASH_ACC_THRESH
@Description: X-Axis deceleration threshold to notify the crash detector that there was a possible impact which helps disarm the motor quickly after a crash. This value should be much higher than normal negative x-axis forces during normal flight, check flight log files to determine the average IMU.x values for your aircraft and motor type. Higher value means less sensative (triggers on higher impact). For electric planes that don't vibrate much during fight a value of 25 is good (that's about 2.5G). For petrol/nitro planes you'll want a higher value. Set to 0 to disable the collision detector.
2016-01-02 09:58:32 +11:00
Tom Pittenger 21205f8b41 Plane: improved crash detection logic and agility
- inhibit crash detection warnings when disabled by param so now it can be completely disabled
- reset is_crashed when disabled by param
- fixed pre-takeoff detection bug by adding in_preLaunch_flight_stage() where we are actually in FLIGHT_NORMAL instead of FLIGHT_TAKEOFF during setup of bungee launches. This now detects if we're in that state
- simplified the use of been_auto_flying to check across all flight stages. before it was excluded to handle hand-launches which can now be detected with in_preLaunch_flight_stage()
- added impact detector timer to clamp is_flying a few seconds after an impact
- logging new impact detector as "STAT.Hit"
2016-01-02 09:58:31 +11:00
Luis Vale Gonçalves b7f3782e4e Plane: Text revisions
text revisions
2015-11-26 07:56:52 +11:00
Caio Marcelo de Oliveira Filho c8888329e1 Plane: use millis/micros/panic functions 2015-11-20 12:26:40 +09:00
lvale e18181e5c2 Plane: Uniformization of severities
Plane uniformization of severities
2015-11-09 09:38:25 +11:00
Lucas De Marchi 84da1f5039 Rename gcs_send_text_P to gcs_send_text 2015-10-30 14:35:07 +09:00
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Lucas De Marchi bd0f0a7536 ArduPlane: convert dos linefeeds to unix 2015-10-30 14:35:02 +09:00
Tom Pittenger 4f46c5331a Plane: added time for flying in any mode
- previously we only kept track of starting flying while in auto which gets reset when switching in and out of auto and on takeoff/land. Now we keep track of a "global" one that will track the is_flying flag regardless of the flight mode.
2015-09-09 09:14:59 +10:00
Tom Pittenger 25da4ec0ea Plane: added flight stage FLIGHT_LAND_ABORT and abort mechanism
- enabled via new param LAND_ABORT_THR default is 0 (disabled)
- Triggered via 95% throttle during landing, a landing abort will take place.
- This copies all takeoff params for right now, we can make this better later if needed
- added mission item command to NAV_LAND which is the abort takeoff altitude. If 0 then use last takeoff if available, else use 30m
- hold heading, just like takeoff, until altitude is reached
- pitch is constrained to takeoff pitch, or else 10deg if not available
- After abort altitude is reached, the normal landing restart happens (DO_LAND_START or decrement mission)
- restart landing by jumping to DO_LAND_START or decrement mission on mode change
2015-09-09 09:04:24 +10:00
squilter 583c087eca Plane: update severities 2015-08-28 10:04:35 +10:00
Tom Pittenger fed50aa5c5 Plane: is_crashed flag gets reset too easily
This behavior is excessively paranoid about clearing the flag so now it's extra sticky. You can only clear the is_crashed flag when:
- changing modes
- starting to execute a takeoff wp (if mission/index gets reset while still in auto)
- while in takeoff and throttle is suppressed it's held false

behavior that was removed:
- clear flag when starting to execute any nav cmd (reached next wp)
- if while crashed, you "start flying again" (non-sticky)
2015-08-24 20:00:12 +10:00
Tom Pittenger e1d566f9e7 Plane: simulator sets is_crashed
due to zero-ish vibration in SITL, the is_flying check thinks you're not flying, and this thinks you crashed. This is a SITL specific problem but it brings to light that *if* someone actually had a very low vibration aircraft we don't want to crash them. So, the vibe test has been removed for now. A better test is a variance on the accel
2015-08-24 00:32:41 -07:00
Tom Pittenger 37336bbbe1 Plane: moved is_flying related code to its own file 2015-08-23 10:34:19 +10:00