Commit Graph

59 Commits

Author SHA1 Message Date
Andy Piper 8d2f2443a2 Copter: add air mode aux function 2020-06-16 20:30:26 +10:00
Peter Barker d5b1f1651e Copter: remove unneeded set_range calls on RC Aux channels
This isn't an exhaustive list of channels used for auxillary input, so
that makes this wrong.

RC_Channel goes off the raw get_radio_in values, so setting these is a
pointless and potentially confusing state change.

Also, Plane and Rover don't do this - so things are more consistent
after this.
2020-01-07 08:41:36 +09:00
Randy Mackay 8724e2f160 Copter: minor comment change 2019-10-22 07:15:48 +08:00
Andrew Tridgell 328fff8585 Copter: fixed RC failsafe handling for no RC receiver
this stops us using uninitialised values in modes like circle which
can operate either with or without RC input. If we didn't have a RC
receiver attached then they would use a maximum yaw rate (which
produces quite a spectacular result for a tuned up racing quad)
2019-09-24 10:00:36 +10:00
Randy Mackay eb433508f1 Copter: esc cal startup check moved outside rc output init
this ensures we don't accidentally enter esc calibration during motor test
2019-07-22 14:53:36 +09:00
Peter Barker cd2ec1f57f Copter: remove set_default_dead_zone statement with no effect
This is immediately undone in the unconditional code below the #if
2019-07-08 09:26:02 +09:00
Peter Barker 3b33f4ca4d Copter: add floating-point-constant designators 2019-04-05 23:04:17 -07:00
Peter Barker c7e21d95ef Copter: move Log_Write_Error into library 2019-03-27 12:36:40 +11:00
IamPete1 ba3d1bc6c7 Copter: move E-stop state to SRV_Channel 2019-02-27 08:51:24 +09:00
Randy Mackay f5208b1664 Copter: minor format fix 2018-12-05 20:12:34 +09:00
Peter Barker 450052aa80 Copter: rewrite read_radio for clarity 2018-09-05 11:54:32 +10:00
Peter Barker a30cdf6806 Copter: eliminate failsafe.rc_override_active
Use RC_Channels::has_active_overrides() instead
2018-09-05 11:54:32 +10:00
Peter Barker ec6c59faa3 Copter: move handling of disable-gcs-rc-overrides-channel-option up 2018-09-05 11:54:32 +10:00
Peter Barker e7e56dde7a Copter: move handling of RC switches into RC_Channel 2018-08-01 12:11:30 +09:00
Michael du Breuil 5825222818 Copter: Remove redundant throttle channel setting 2018-08-01 09:19:20 +10:00
Andrew Tridgell 2425c65e74 Copter: implement 'air-mode' for copter
this implements what betaflight calls 'air-mode'. This gives attitude
control when throttle is at zero, allowing for zero-throttle maneuvers,
plus keeping the copter level on the ground.

This was already implemented if an interlock switch was setup, but it
should also work with an arming switch. If using an arming switch then
throttle should not be considered zero as long as the arming switch
hasn't gone low.
2018-05-29 10:27:14 +09:00
Michael du Breuil 91a48a5040 Copter: Support new RC_Channels::read_input() 2018-04-26 08:00:09 +10:00
Michael du Breuil d96919ed21 Copter: Use RC_Channels instead of hal.rcin 2018-04-11 21:47:07 +01:00
Pierre Kancir 50c3ed1460 Copter : allow rc_override input at start
found by chobitsfan
2018-03-02 16:23:11 +00:00
Andrew Tridgell af4f0c29ba Copter: enable TMODE (ToyMode) support
this is for the skyviper button based transmitter control
2018-02-08 17:36:33 +11:00
Andrew Tridgell 0d0f1d264b Copter: fixed order of motor setup 2017-10-22 15:52:50 +11:00
Andrew Tridgell c4b0d7bc35 Copter: removed calls to motors->enable() 2017-10-22 15:52:50 +11:00
Andrew Tridgell 8cf8f3a288 Copter: fixed collective input with H_SV_MAN=1 for heli
when H_SV_MAN=1 we do direct pass-thru so the user can test swash
range. The problem is that it uses norm_input() for throttle, which
depends on RC3_TRIM. Nowhere else in heli or copter do we depend on
RC3_TRIM, so the user gets a misleading idea of behaviour when testing
their swash.
2017-09-21 08:52:50 +10:00
Randy Mackay 010dc103be Copter: increase RC input deadzones for roll pitch and yaw
Copter-3.5 testing resulted in a significant number of users reporting various issues like poshold and autotune were not functioning because their RC inputs were straying out of the deadzones
2017-06-01 10:10:57 +09:00
Pierre Kancir 436d0f8c84 ArduCopter: radio fix passthrough range on heli/coax/single 2017-05-13 10:19:20 +09:00
Randy Mackay caa2148e45 Copter: move esc calibration startup check to after servo function initialisation 2017-05-11 11:30:05 +09:00
Andrew Tridgell 2ba6e7af35 Copter: fixed aux servos in RC failsafe
we should always output to channels
2017-05-01 14:32:18 +10:00
Randy Mackay 032bfad79f Copter: move rc input check to esc_calibration_startup_check
No functional change
2017-04-18 09:29:55 +09:00
Randy Mackay 1bfbf0d43f Copter: enable motors at end of initialisation 2017-04-18 09:29:51 +09:00
Lucas De Marchi a589a84e32 ArduCopter: just call set_throttle_range()
Now set_throttle_range in AP_Motors does the right thing, calling out
the RCOutput method.
2017-02-26 13:38:24 +11:00
Randy Mackay a25f51c893 Copter: delay up to 2sec for first radio pulse
Pixracer boards can take 1 second (or possibly longer) to start reading RC input.  This ensure we see the user's high throttle to indicate the user wants to perform the ESC calibration
2017-01-27 12:14:56 +09:00
Peter Barker ab13b3beaf Copter: make rc checks verbose on failure 2017-01-20 13:02:53 +09:00
Peter Barker bd6ffc025e Copter: start conversion to AP_Arming_Copter 2017-01-17 11:45:08 +09:00
Andrew Tridgell 0f6d0c5ba9 Copter: combined tri, single, coax and multicopter into a single build
this allows copter to be just 2 builds, one for heli, and one for
everything else
2017-01-12 17:39:37 +11:00
Andrew Tridgell 5a87ae3f01 Copter: use new SRV_Channels API 2017-01-12 17:39:37 +11:00
Randy Mackay 12d024e0c6 Copter: rename FRAME to FRAME_TYPE
This unifies the plane and copter parameter names
2016-12-31 10:55:23 +09:00
Randy Mackay 217757fdc8 Copter: default FRAME_CLASS 2016-12-31 10:55:23 +09:00
Randy Mackay 0ac00dbfd6 Copter: add FRAME_CLASS parameter 2016-12-31 10:55:23 +09:00
Leonard Hall 0523570c5f Copter: reduce dead zone for roll, pitch and yaw input 2016-10-26 21:00:32 +09:00
Leonard Hall 0a6714f4ae Copter: rename variable ROLL_PITCH_YAW_INPUT_MAX
No functional change
2016-10-26 20:59:43 +09: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 9205416695 Copter: setup default safety mask based on motor mask 2016-10-21 11:53:59 +11:00
Andrew Tridgell f18e0dadc9 Copter: added optional AdvancedFailsafe for copter and heli 2016-08-25 14:14:18 +10:00
Leonard Hall e9d8a28ec0 Copter: AP_Motor's throttle_hover replaces throttle_average 2016-06-18 11:55:49 +09:00
Leonard Hall dec9323127 Copter: remove THR_MIN
Equivalent is AP_Motors SPIN_MIN
2016-06-18 11:55:49 +09:00
Randy Mackay 6a1bdebf25 Copter: remove THR_MAX definition for changing throttle input range
We do not support changing the throttle input range from it's expected 0 ~ 1000
2016-06-18 11:55:49 +09:00
Andrew Tridgell 86d8450666 Copter: use loop rate for copter
this allows for SCHED_LOOP_RATE below 400 in SITL for copter
2016-06-17 15:01:18 +10:00
Andrew Tridgell 146a59eed3 Copter: fixed ESC calibration on PixRacer
we need to set the ESC scaling before we go into the calibration loop
or the outputs will never arm
2016-05-25 19:35:17 +10:00
Ricardo de Almeida Gonzaga ce241dd97a ArduCopter: Fix typos 2016-05-13 19:20:07 -03:00
skyscraper 6f200fa923 ArduCopter: 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