Commit Graph

77 Commits

Author SHA1 Message Date
Andrew Tridgell c787f4c56f Plane: initial support for tailsitter transitions 2017-02-18 17:26:43 +11:00
Michael du Breuil 29b16dbafd Plane: Refactor to request relative altitudes from AHRS
Removes the need for plane to do the math for finding the relative height.

Also caches the value at the same time we update current_loc, which is a
non behaviour change as that was the only time you could see a change in
the relative height propegate through the system anyways
2017-02-13 09:23:14 +11:00
Tom Pittenger e709705ab8 Plane: describe flight stages without using specific stage name 2017-01-26 13:11:43 -08:00
Andrew Tridgell 081909bf6a Plane: removed use of pwm_to_angle() 2017-01-12 17:39:37 +11:00
Andrew Tridgell b83f50be0f Plane: use new SRV_Channels API 2017-01-12 17:39:37 +11:00
Tom Pittenger 063f517424 Plane, TECS, AP_Landing: rename stage LAND_ABORT to ABORT_LAND
this will reduce confusion when searching for FLIGHT_LAND_* and you get a bunch of takeoff related hits. It will also make more sense when the landing library fully manages the FLIGHT_LAND stage entirely because it will not mange FLIGHT_LAND_ABORT
2016-12-30 23:50:03 -08:00
Tom Pittenger c286ceba43 Plane: move enum FlightStages to AP_Vehicle::FixedWing 2016-12-30 23:50:03 -08:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Andrew Tridgell 6aa3ded666 Plane: split main servo output functions into a separate file 2016-10-15 16:59:34 +11:00
Andrew Tridgell d6890495aa Plane: added swapped channel version of elevon/vtail/flaperon output
this makes it possible to setup an elevon plane without changing the
transmitter reversals
2016-09-14 11:48:05 +10:00
Tom Pittenger ca32bcc58d Plane: add new flight mode AVOID_ADSB to mimic GUIDED 2016-08-17 22:38:54 -07:00
Andrew Tridgell c4c7a3051a Plane: added support for secondary throttles 2016-08-16 16:14:48 +10: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 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
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
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 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 bf2e30f858 Plane: removed demo_servos()
this really didn't help much and slows down startup
2016-06-27 10:19:26 +10:00
E Thomas 7d824247af Differential spoilers support, elevon offset
Fixed differential spoilers support, added elevon offset
See PR #2935
2016-06-06 21:55:50 -07:00
Tom Pittenger ee29f38cdf Plane: moved takeoff flap check to NORMAL checks.
TODP: add new flight stage FLIGHT_PRE_TAKEOFF to put this sort of thing into
2016-06-06 14:51:24 -07:00
Samuel Rosenstein 296b279f0d Plane: fixed issue with preflight flaps. Flaps now go down in preflight mode 2016-06-06 14:18:44 -07:00
Michael du Breuil 41bb237799 Plane: remove throttle surpressed message 2016-06-06 15:24:18 +10:00
Andrew Tridgell 835235127c Plane: prevent divide by zero in SITL
harmless on PX4
2016-06-04 19:20:18 +10:00
Tom Pittenger af1407a155 Plane: disable parachute code when not enabled via compile option 2016-06-01 17:38:51 -07:00
Andrew Tridgell da5ce37bbc Plane: fixed gain on -ve stick mixing past 50%
fixed a sign error in calculating gain on -ve stick mixing beyond 50%
input

thanks to Doug Weibel for a log that showed this effect
2016-06-02 08:07:55 +10:00
Andrew Tridgell eee06da1b5 Plane: use HAVE_PAYLOAD_SPACE() 2016-05-21 15:25:14 +10:00
Andrew Tridgell e0a9a8196c Plane: fixed throttle failsafe with THR_PASS_STAB=1
this prevents using pass-thru throttle when in throttle failsafe
2016-05-21 07:39:02 +10:00
Ricardo de Almeida Gonzaga 1fad971851 ArduPlane: Fix typos 2016-05-13 19:20:07 -03:00
skyscraper e9e2f9020d ArduPlane: RC_Channel refactor, reimplement stick_mix_channels
reimplement the new overload of Plane::stick_mix_channel so
that it calls the existing overload
2016-05-10 16:21:17 +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 4666b25258 Plane: initial implementation of QRTL for quadplane RTL 2016-04-30 14:34:47 +10:00
Andrew Tridgell 07168c3db4 Plane: fixed places that assumed mission command IDs are 8 bit 2016-04-23 21:03:46 +10:00
Tom Pittenger c238645e53 Plane: limit roll before calculating load factor 2016-04-21 21:30:56 -07:00
Rimvydas Naktinis df922dacfa Plane: Suppress throttle when parachute release initiated, not after release. 2016-04-21 09:53:22 -07:00
Andrew Tridgell e9e43dc016 Plane: added Q_VFWD_GAIN for forward motor in VTOL modes
this allows for velocity control using the forward motor in VTOL modes
2016-04-20 16:25:19 +10:00
Andrew Tridgell 97a7192f76 Plane: make it more obvious that AUTO_FBW_STEER is not for normal use 2016-04-06 07:58:23 +10:00
Andrew Tridgell f4ccf94dfc Plane: added QLAND mode
for VTOL landing. Use for failsafe as well
2016-03-09 18:20:41 +11:00
Tom Pittenger 75be40ea59 Plane: add LAND_THR_SLEW 2016-03-02 10:54:19 -08:00
Tom Pittenger ed6aa4ed17 Plane: added throttle limiting via max power (current*voltage) 2016-03-02 10:20:44 -08:00
Tom Pittenger 993e5b438c Plane: add to LAND_NEUTRL behavior
offer netrual vs disabled outputs
2016-02-25 05:51:44 -08:00
Tom Pittenger 0b26a34f22 Plane: new param LAND_THEN_NEUTRL
// @Description: When enabled, after an autoland and auto-disarm via LAND_DISARMDELAY happens then set all servos to neutral. This is helpful when an aircraft has a rough landing upside down or a crazy angle causing the servos to strain.
2016-02-16 23:40:44 -08:00
Andrew Tridgell 8ecf54bf75 Plane: use throttle slew when in quadplane assisted flight
this prevents a sudden throttle change on a petrol motor when
transitioning
2016-02-13 11:38:33 +11:00
Tom Pittenger fa53263ca9 Plane: make throttle_percentage() signed 2016-02-11 18:46:01 +11:00
Tom Pittenger 2e92089ce6 Plane: Reverse Thrust
Reverse thrust for controlled landings, even with much steeper approach slopes. This is achieved by allowing throttle demand to go negative to maintain a target airspeed. A Pre-Flare stage was added, triggered by an altitude, to allow for a slower airspeed just before land. That lower airspeed can be near stall.
new params LAND_PF_ALT, LAND_PF_SEC, LAND_PF_ARSPD, USE_REV_THRUST
2016-02-09 14:18:02 +11:00
Tom Pittenger 1cb094f12e Plane: make throttle signed (pos and neg) 2016-02-09 14:18:02 +11:00
Tom Pittenger b8d5369ebd Plane: add flight stage LAND_PREFLARE 2016-02-09 14:18:02 +11:00