Commit Graph

155 Commits

Author SHA1 Message Date
Andrew Tridgell 33f17588b2 Plane: added auto fence enable on VTOL takeoff
fixes issue#724
2016-08-29 18:04:42 +10:00
Andrew Tridgell a5f20d8c44 Plane: fix for AP_FrSky_Telem API change 2016-08-25 10:16:19 +10:00
floaledm 43006a31a3 Plane: compatibility with revised AP_Frsky_Telem class 2016-08-25 10:16:18 +10:00
floaledm 71921f3aa4 Plane: removed frsky_telemetry_send scheduled task 2016-08-25 10:16:17 +10:00
Tom Pittenger b187e1f9a6 Plane: add reason to set_mode() 2016-08-17 22:38:54 -07:00
Tom Pittenger 285e41bac6 Plane: add avoidance_adsb framework for object avoidance 2016-08-17 22:38:54 -07:00
Tom Pittenger c4460a285c Plane: remove adsb sensor library based avoidance
adsb based avoidance has been moved to AP_Avoidance library
2016-08-17 22:38:54 -07:00
Tom Pittenger fa326de7fa Plane: add adsb to failsafe structure and report in heartbeat to GCS 2016-08-17 22:38:54 -07:00
Andrew Tridgell adb5a3ee1f Plane: re-work AFS for new AP_AdvancedFailsafe API 2016-08-16 12:55:51 +10:00
Andrew Tridgell 5d6dfd927b Plane: changes for AP_AdvancedFailsafe naming 2016-08-16 12:55:50 +10:00
Tom Pittenger e0136dc545 Plane: remove AP_Vehicle::FixedWing dependency in ap_airspeed 2016-08-08 00:02:42 -07:00
Tom Pittenger fc50f145ce Revert "ArduPlane: Convert references to AP_Airspeed. Added automatic migration of ARSPD_FBW_MIN and ARSPD_FBW_MAX (plane parameter) to ARSPD_FBW_MIN and ARSPD_FBW_MAX (library parameter)."
This reverts commit da1b18d918.
2016-08-07 17:54:24 -07:00
Tom Pittenger 8dad05d12e Revert "Airspeed: store reference in libraries and populate it"
This reverts commit c090ba2257.
2016-08-07 17:54:24 -07:00
Tom Pittenger c090ba2257 Airspeed: store reference in libraries and populate it
- also had to move the initial definition in plane.h so it happened before the others.
2016-08-04 11:06:44 -07:00
AndersonRayner da1b18d918 ArduPlane: Convert references to AP_Airspeed. Added automatic migration of ARSPD_FBW_MIN and ARSPD_FBW_MAX (plane parameter) to ARSPD_FBW_MIN and ARSPD_FBW_MAX (library parameter). 2016-08-04 10:09:04 -07:00
Tom Pittenger f90957e7ed Plane: remove all threat logic in adsb lib in favor of avoidance lib 2016-08-01 15:27:41 -07:00
Andrew Tridgell 327a057ee0 Plane: added internal combustion engine support
this allows for automatic engine start and restart
2016-07-25 10:06:03 +10:00
Andrew Tridgell 02babb71b3 ArduPlane: adjust for 16 channels in SERVO_OUTPUT_RAW 2016-07-25 10:06:02 +10:00
Andrew Tridgell 3f0a8d1761 Plane: added AP_Button support for plane
this also adds the g2 parameter table
2016-07-22 15:01:20 +10:00
Tom Pittenger 26efd90603 Plane: allow landing height adjustment on wp before land (aka approach wp) 2016-07-20 22:29:31 -07:00
Andrew Tridgell 4da3236c07 Plane: separate out landing height adjustment from barometer changes
this stores a landing height adjustment for an aborted landing
without adjusting barometer readings, applying them only on landing
2016-07-20 22:04:21 -07:00
Tom Pittenger 7751bee3be Revert "Plane: coverity scan - variables not initialized in constructor"
This reverts commit 9b807fa8a5.
2016-07-11 22:02:30 -07:00
Tom Pittenger 9b807fa8a5 Plane: coverity scan - variables not initialized in constructor 2016-07-05 13:31:51 -07:00
Andrew Tridgell 96d785f1c6 Plane: added auto_navigation_mode flag
this fixes a problem where modes like loiter and auto would allow for
rudder stick mixing even with STICK_MIXING=0
2016-07-05 12:52:13 +10:00
Tom Pittenger 0597dbd033 Plane: allow SET_ATTITUDE_TARGET to set rpy and throttle 2016-07-01 08:28:53 -07:00
Tom Pittenger 85afd9e245 Plane: remove guided roll flag, handle it with timer=0 2016-06-30 07:48:37 -07:00
Michael Day 8ac433f991 Plane: Can now command roll from a companion computer. 2016-06-30 10:27:44 -04:00
Andrew Tridgell ec367d4a09 Plane: re-order channel initialisation
this fixes a problem with spurious throttle output during board
startup. Many thanks to Marco for finding this!
2016-06-30 16:48:30 +10:00
Andrew Tridgell bf2e30f858 Plane: removed demo_servos()
this really didn't help much and slows down startup
2016-06-27 10:19:26 +10:00
Tom Pittenger b3f182157c Plane: take advantage of rangefinder support in relative_ground_altitude() 2016-06-03 23:43:43 -07:00
Tom Pittenger 4db5b80b37 Plane: add flag for auto_state.land_in_progress 2016-05-31 09:46:51 -07:00
Peter Barker af5a52e2aa Plane: subclass GCS_MAVLink in place of defining its functions for it 2016-05-29 16:21:21 +10:00
Andrew Tridgell d3494d1369 Plane: don't stall EKF during baro cal 2016-05-24 17:00:56 +10:00
Tom Pittenger 36a1054f77 Plane: remove Tom Pittenger as an author since he's now listed as a lead 2016-05-17 19:16:02 -07:00
Tom Pittenger c9167f89eb Plane: add Tom Pittenger as co-lead developer 2016-05-17 19:03:38 -07:00
Tom Pittenger 6746b4227a Plane: handle large negative baro offsets (corner case) to self-trigger a land-abort go-around
new param: LAND_ABORT_DEG
@Description: This parameter is used when using a rangefinder during landing for altitude correction from baro drift (RNGFND_LANDING=1) and the altitude correction indicates your altitude is higher than the intended slope path. Steeper slopes can result in crashes so this allows the option to remember the baro offset and self-abort the landing and come around for a another landing with the correct baro offset applied for a perfect slope. An auto-abort go-around will only happen once, next attempt will not auto-abort again. This operation happens entirely automatically in AUTO mode. This value is the delta degrees threshold to trigger the go-around. Example: if set to 5 deg and the mission planned slope is 15 deg then if the new slope is 21 then it will go-around. Set to 0 to disable. Requires LAND_SLOPE_RCALC > 0.
2016-05-17 15:41:09 -07:00
Tom Pittenger f048aafb76 Plane: store auto land slope
- also changed order of landing slope calc but is functionally the same
2016-05-17 15:39:05 -07:00
Tom Pittenger 034cd2413e Plane: re-calc landing glide slope to gracefully handle baro offset during long flights
New param: LAND_SLOPE_RCALC
@Description: This parameter is used when using a rangefinder during landing for altitude correction from baro drift (RNGFND_LANDING=1) and the altitude correction indicates your altitude is lower than the intended slope path. This value is the threshold of the correction to re-calculate the landing approach slope. Set to zero to keep the original slope all the way down and any detected baro drift will be corrected by pitching/throttling up to snap back to resume the original slope path. Otherwise, when a rangefinder altitude correction exceeds this threshold it will trigger a slope re-calculate to give a shallower slope. This also smoothes out the approach when flying over objects such as trees. Recommend a value of 2m.

default value is 2 (so, enabled by default)
2016-05-17 15:39:04 -07:00
Tom Pittenger 8a58f5a5eb Plane: convert airspeed_error_cmd to airspeed_error (in meters) 2016-05-13 17:21:59 -07:00
Andrew Tridgell 2a0476483b Plane: make takeoff less noisy with zero timeout 2016-05-14 08:26:10 +10:00
Andrew Tridgell 574ba71ef3 Plane: update for AP_TECS API change 2016-05-14 08:26:10 +10:00
Andrew Tridgell 12e0012b16 Plane: allow for NAV_LOITER_UNLIM and NAV_LOITER_TIME in quadplane 2016-05-11 15:57:41 +10:00
Andrew Tridgell 3fc43b94f9 Plane: separate out auto and guided VTOL states
this prevents a switch to AUTO from using VTOL mode incorrectly
2016-05-11 15:14:43 +10:00
Andrew Tridgell 691d4b6ca7 Plane: added local reached_loiter_target()
this distinguishes between VTOL and fixed wing loiter targets
2016-05-11 05:55:26 +10:00
Andrew Tridgell eab42c5740 Plane: fixed attitude logging with fast logging off 2016-05-11 05:55:24 +10:00
skyscraper 7f29903287 ArduPlane: Fix up after refactoring RC_Channel class
Further to refactor of RC_Channel class which included
adding get_xx set_xx methods, change reads and writes to the public members
to calls to  get and set functionsss

old public member(int16_t)   get function -> int16_t     set function (int16_t)
(expression where c is an object of type RC_Channel)
c.radio_in                     c.get_radio_in()           c.set_radio_in(v)
c.control_in                   c.get_control_in()         c.set_control_in(v)
c.servo_out                    c.get_servo_out()          c.set_servo_out(v)
c.pwm_out                      c.get_pwm_out()            // use existing
c.radio_out                    c.get_radio_out()          c.set_radio_out(v)
c.radio_max                    c.get_radio_max()          c.set_radio_max(v)
c.radio_min                    c.get_radio_min()          c.set_radio_min(v)
c.radio_trim                   c.get_radio_trim()         c.set_radio_trim(v);

c.min_max_configured() // return true if min and max are configured

Because data members of RC_Channels are now private and so cannot be written directly
 some overloads are provided in the Plane classes to provide the old functionality

new overload Plane::stick_mix_channel(RC_Channel *channel)
which forwards to the previously existing
void stick_mix_channel(RC_Channel *channel, int16_t &servo_out);

new overload Plane::channel_output_mixer(Rc_Channel* , RC_Channel*)const
which forwards to
(uint8_t mixing_type, int16_t & chan1, int16_t & chan2)const;

Rename functions

 RC_Channel_aux::set_radio_trim(Aux_servo_function_t function)
    to RC_Channel_aux::set_trim_to_radio_in_for(Aux_servo_function_t function)

 RC_Channel_aux::set_servo_out(Aux_servo_function_t function, int16_t value)
    to RC_Channel_aux::set_servo_out_for(Aux_servo_function_t function, int16_t value)

 Rationale:

        RC_Channel is a complicated class, which combines
        several functionalities dealing with stick inputs
        in pwm and logical units, logical and actual actuator
        outputs, unit conversion etc, etc
        The intent of this PR is to clarify existing use of
        the class. At the basic level it should now be possible
        to grep all places where private variable is set by
        searching for the set_xx function.

        (The wider purpose is to provide a more generic and
        logically simpler method of output mixing. This is a small step)
2016-05-10 16:21:16 +10:00
Andrew Tridgell db5f50e08e Plane: convert tuning to use AP_Tuning library 2016-05-07 18:34:15 +10:00
Lucas De Marchi baa287e5e5 ArduPlane: use separate header for version macro
Having the version macro in the config.h and consequently in the main
vehicle header means that whenever the version changes we need to
compiler the whole vehicle again. This would not be so bad if we weren't
also appending the git hash in the version. In this case, whenever we
commit to the repository we would need to recompile everything.

Move to a separate header that is include only by its users. Then
instead of compiling everything we will compile just a few files.
2016-05-06 13:11:28 -03:00
Rimvydas Naktinis 9fdf39baf0 Plane: Added a method that returns current altitude relative to terrain, if available, or home otherwise. 2016-05-05 09:02:20 -07:00
Michael du Breuil 0fcfcdc169 Plane: Broadcast POSITION_TARGET_GLOBAL_INT as part of the EXTENDED_STATUS stream 2016-05-01 07:38:23 +10:00