Commit Graph

248 Commits

Author SHA1 Message Date
Rob Ratcliff 5c388507d4 RC_Channel: fix handling of rc_override_time of -1 2020-01-27 19:21:54 +09:00
Andrew Tridgell 32221e2207 RC_Channel: use HAL_SPRAYER_ENABLED 2020-01-18 13:48:48 +11:00
Peter Barker ac25b90dda RC_Channel: factor out a do_aux_function_armdisarm method 2020-01-08 18:36:02 +11:00
Peter Barker 10976344b8 RC_Channel: let RC_Channel indicate AUX_FUNC::ARMDISARM needs no initialisation
All users set this.
2020-01-08 18:36:02 +11:00
Peter Hall df3ffb215e RC_Channel: add Flap input 2020-01-01 08:11:01 +11:00
Andy Piper fcc7b58b5f RC_Channel: add runcam osd control option 2019-12-30 13:02:04 +11:00
Andy Piper 3cba76123b RC_Channel: add support for RunCam camera control
make read_3pos_switch and enum public
2019-12-30 13:02:04 +11:00
giacomo892 1763be2c03 RC_Channel: added LOITER switch for plane 2019-12-17 16:14:53 +11:00
Randy Mackay 93e1f7d46a RC_Channel: init aux function cases in alphabetical order 2019-11-12 18:56:13 +11:00
Henry Wurzburg 1238d4b3e6 RC_Channel: add ADSB Avoidance enable option to RC options for plane 2019-11-12 13:48:09 +11:00
Peter Barker e12a841eb5 RC_Channel: move support for ADSB avoidance switch enable up 2019-11-12 13:48:09 +11:00
Peter Barker 3fb596d5ae RC_Channel: don't enter the config error loop on unknown options
... unless we are in SITL

Users moving backwards and forwards between versions can hit this case
too easily.

We probably need a better story around this error loop so it's less
confusing to the user about what's going on.
2019-11-12 09:20:03 +08:00
Mark Whitehorn 285901f57c RC_Channel: enter config_error loop for invalid RC option 2019-11-08 10:14:34 +11:00
Mark Whitehorn 7f6e89bee8 RC_Channel: enter error loop on invalid RC option 2019-11-08 10:14:34 +11:00
Mark Whitehorn c5abcb5584 RC_Channel: don't panic on unsupported RCn_OPTION in SITL 2019-11-08 10:14:34 +11:00
Henry Wurzburg f1efc957fc RC_Channel: OPTION:Copter re-order,add STANDBY, rmv winch,Rover rename Simple 2019-11-05 11:30:43 +11:00
Peter Barker 8686fb30f8 RC_Channel: remove old comments to do with gripper grab/release 2019-11-05 08:19:26 +08:00
Peter Barker daf071f7f6 RC_Channel: cope with change in namespace of LogEvent enum 2019-11-05 08:19:26 +08:00
Henry Wurzburg 119f0a95ad RC_Channel: added RC option for new takeoff mode 2019-10-21 08:41:58 +11:00
Henry Wurzburg 4a42a3a23a Rover: implement steering trim save in armed/manual mode only 2019-10-08 07:41:57 +09:00
Randy Mackay 6be4adbe02 RC_Channels: define surface tracking auxiliary function 2019-09-28 11:13:14 +09:00
Peter Hall 2f3c0447eb RC_Channel: add fence and value for rover 2019-09-02 11:03:27 +09:00
Peter Hall fdb6da0793 RC_Channel: define sailboat mainsail and motor input channels
The unusual use of 207 is in preparation for Peter Barker's RCMAP replacement PR which uses 200 to 206
2019-09-01 09:11:25 +09:00
SergeyBokhantsev c73a4fd227 RC_Channel: unify debounce code 2019-08-02 12:34:02 +01:00
Randy Mackay 00cc4ace8a RC_Channel: resolve gcs::send_text compiler warning 2019-07-30 09:02:39 +09:00
Peter Barker f85bad752e RC_Channel: add both clear and reset options to Rover and Plane docs 2019-07-16 09:24:18 +10:00
Peter Barker aab787b08b RC_Channel: move mission reset in from Copter 2019-07-16 09:24:18 +10:00
Andrew Tridgell a38b030c41 RC_Channel: disable kill IMU with HAL_MINIMIZE_FEATURES 2019-07-07 19:03:01 +10:00
Andrew Tridgell 30d27147a8 RC_Channel: added RC switch for killing IMUs 2019-07-07 19:03:01 +10:00
Peter Barker 8f8851271a RC_Channel: add mode-changing options to Plane RC channel options 2019-06-18 10:48:47 +10:00
Michael du Breuil 6317355390 RC_Channel: Fix AP_GPS include 2019-06-18 10:02:05 +10:00
Peter Barker c38e5ba4fc RC_Channel: handle AUX_FUNC::ARMDISARM 2019-05-30 07:37:30 +09:00
Andrew Tridgell 19ace7cace RC_Channel: guarantee logging of RCIN on switch changes 2019-05-22 07:37:56 +10:00
Tom Pittenger fc710d8a81 RC_Channel: remove UINT16_MAX check, moved to mavlink handler 2019-05-10 15:30:54 -07:00
Tom Pittenger fbe43dba5c RC_Channel: refactor stick_mixing to library 2019-05-03 13:14:11 -07:00
Randy Mackay c2318503db RC_Channel: fix-up OPTION param docs 2019-04-16 10:56:23 +09:00
Arjun Vinod 66bdabfa26 RC_Channel: updated the parameter docs 2019-04-16 10:47:26 +09:00
Arjun Vinod 77a7c1bdf7 RC_Channel: fixed typo 2019-04-12 09:23:42 +10:00
Michael du Breuil 125f9bd806 RC: Fix includes 2019-04-05 20:12:53 +11:00
Tom Pittenger dce484685b RC_Channel: fix compiler warning. %u should be cast as unsigned 2019-04-04 10:19:50 +11:00
Patrick José Pereira 3a0ac4bb09 RC_Channel: Move aux_func to class enum
aux_func declaration shadows enums of mavlink ardupilotmega
RC_Channel declares `PARACHUTE_ENABLE = 21`
ardupilotmega defines it as `PARACHUTE_ENABLE=1`

This fix a compilation error with clang-8

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2019-04-03 09:53:58 -07:00
Peter Barker e869eaeda4 RC_Channel: make has_new_overrides non-static 2019-04-02 10:16:30 +11:00
Peter Barker 2331232bdd RC_Channel: remove static override_timeout 2019-04-02 10:16:30 +11:00
Peter Barker bc2ede5582 RC_Channel: tidy RC option flag handling 2019-04-02 10:16:30 +11:00
Tom Pittenger 961085fbd1 RC_Channel: rename dataflash to logger 2019-03-28 16:40:58 +11:00
IamPete1 8f9f572489 RC_Channel: add global E-stop function 2019-02-27 08:51:24 +09:00
Peter Barker c235b1ccc2 RC_Channel: correct comment 2019-02-15 08:15:45 +11:00
Tom Pittenger ece8580c1d RC_Channel: unify singleton naming to _singleton and get_singleton() 2019-02-10 19:09:58 -07:00
Peter Barker e7e51d6f49 RC_Channel: indicate gripper available on an RC Channel 2019-02-09 11:02:22 +09:00
ChrisBird fad02bf55a AP_Relay: Adding a 5th and 6th Relay as per issue #8979 2019-01-16 13:26:25 +00:00
Peter Barker bb0a4f3c78 RC_Channel: avoid using out-of-range aux switch values
We already use these ranges for the mode switch
2019-01-08 12:56:32 +09:00
Andrew Tridgell ee78374513 RC_Channel: added GPS_DISABLE option on a switch 2018-11-29 08:49:23 +11:00
Andrew Tridgell 285935f8b3 RC_Channel: added reverse throttle RC option
used in plane for reverse on a switch
2018-11-16 08:33:35 +11:00
Andrew Tridgell 7fad72dacf RC_Channel: moved LANDING_GEAR to common library 2018-11-09 14:35:14 +11:00
Andrew Tridgell eac7c28005 RC_Channel: allow landing gear control for plane 2018-11-09 14:35:14 +11:00
IamPete1 e42c3c6fab RC_Channel: add Sailboat Tack to aux switch 2018-11-01 18:04:19 +09:00
Randy Mackay 2c29f0d45a RC_Channel: handle AC_Avoid enable and disable
Also change Copter's option from Object Avoidance to Proximity Avoidance
due to impending AP_Avoidance stuff

RC_Channel: update aux switch param docs to add object avoidance
2018-10-30 12:10:42 +11:00
Andrew Tridgell 5fe9334a18 RC_Channel: allow compass learning to be triggered on option
this allows for RCn_OPTION=62 to trigger compass learning, so you can
enable in-flight without using the GCS
2018-10-24 07:25:42 +10:00
Peter Barker c7d052eec8 RC_Channel: add const keyword to many methods 2018-10-23 12:30:35 +11:00
CAO MUQING 09030b1b13 RC_Channel: add aux switch options for ZigZag mode and ZigZag SaveWP 2018-10-05 10:05:45 +09:00
Ammarf 2beb3a278a RC_Channel: add simple mode to aux functions 2018-09-11 16:43:17 +09:00
Peter Barker 0cf12ad47e RC_Channel: add aux option to fly inverted for Plane 2018-09-07 09:07:40 +10:00
Peter Barker bd5cdf9e64 RC_Channel: update aux options for planes to include arm/disarm 2018-09-06 08:26:50 +10:00
Peter Barker 10d7cc6bf4 RC_Channel: add Plane support for channel options 2018-09-05 13:47:19 +10:00
Peter Barker 9650846497 RC_Channel: treat UINT16_MAX as a value of 0 in set_override
This shouldn't really in in RC_Channels - when we move the mavlink
packet handling up to the GCS_MAVLink base class we should move this
into there.
2018-09-05 11:54:32 +10:00
Peter Barker 1c527df084 RC_Channel: note that Rover now has disable-gcs-overrides channel option 2018-09-05 11:54:32 +10:00
Peter Barker 047689981b RC_Channel: honour gcs_overrides_enabled as part of set_override
This will stop situations like we currently have where the
MANUAL_CONTROL GCS mavlink packets can still affect the vehicle

Also resolves an issue where has_new_overrides may not be set
appropriately
2018-09-05 11:54:32 +10:00
Peter Barker 7bdd9b1aea RC_Channel: move handling of disable-gcs-rc-overrides-channel-option 2018-09-05 11:54:32 +10:00
Peter Barker 3c8738b4d8 RC_Channel: add clear-waypoints option 2018-09-04 10:32:26 +10:00
Peter Barker a7acc92663 RC_Channel: move rc-channel option for lost-vehicle sound up to base class 2018-09-03 16:57:25 +09:00
Michael du Breuil 80597d5cba RC_Channel: Fix accidental quantization of override_timeout to 1 second 2018-08-28 14:18:54 +10:00
Peter Barker f2b8c9e501 RC_Channel: improve debug when failing to initialise RC channel 2018-08-21 20:34:01 +09:00
Peter Barker e4d3ed7e39 RC_Channel: move handling of sprayer and gripper in from Copter 2018-08-17 15:33:35 +09:00
Michael du Breuil e7ebea55d2 RC_Channel: Fix possible user induced out of bounds write
CID 308348
2018-08-09 10:27:10 +10:00
Peter Barker e4ff937c96 RC_Channel: remove min-max-configured pre-arm checks
These are really, really expensive to run while your RC isn't
configured.

We now have a split between inputs (RC) and servos (SRV), so these
aren't as critical as they were.  We also have range checks to ensure
they're roughly good enough to fly with.
2018-08-07 09:45:09 +10:00
Peter Barker f2b1387c1c RC_Channel: add AUTOTUNE to init_aux_function routine
Also, cark it in SITL if we fail to initialise an aux function
2018-08-05 07:52:28 +10:00
Peter Barker 61c34ea98c RC_Channel: move handling of auxillary switches into RC_Channel
RC_Channel: move handling of Rover's functions into RC_Channel

RC_Channel: move auxsw handling for camera to base RC_Channel

RC_Channel: add responsibility for servorelay events

RC_Channel: move mode switch handling to base class
2018-08-01 12:11:30 +09:00
Michael du Breuil 60f19bbf02 RC_Channel: Allow an input to be ignored 2018-08-01 09:19:20 +10:00
Michael du Breuil 16b6201195 RC_Channel: Allow a RC_OVERRIDE_TIMEOUT of -1 to use the overrides
forever
2018-07-19 07:53:43 +10:00
Michael du Breuil 95eda5d9b7 RC_Channel: Remove unneeded interfaces 2018-06-11 16:29:36 -07:00
Michael du Breuil 0fcf07fde7 RC_Channel: Remove input() method from individual channels 2018-06-05 09:51:09 +10:00
Michael du Breuil 4253c7f74d RC_Channel: Move overrides out of the HAL 2018-06-05 09:51:09 +10:00
Michael du Breuil c8fdb90ab5 RC_Channel: Rework set_pwm_no_deadzone() to a recompute function 2018-04-14 14:05:20 +10:00
Andrew Tridgell e5813effff RC_Channel: improved efficiency of min_max_configured
this is quite a costly function due to scan in AP_Param. It takes
about 4 to 5 milliseconds when done as part of AP_Arming
2018-01-10 16:42:51 +09:00
Andrew Tridgell 0155434057 RC_Channel: fixed bug in manual with TRIM == MIN
This fixes the bug described here:

https://discuss.ardupilot.org/t/arduplane-reverse-thrust-setup/18324/5

which otherwise would prevent output with TRIM == MIN or TRIM == MAX
2017-08-26 20:30:54 +10:00
Dr.-Ing. Amilcar Do Carmo Lucas ed07d5b5c9 RC_Channel: Improve the PWM parameters descriptions 2017-06-06 11:06:26 +10:00
Dr.-Ing. Amilcar Do Carmo Lucas 8661bdda8a RC_Channel: Use SI units conventions in parameter units
Follow the rules from:
http://physics.nist.gov/cuu/Units/units.html
http://physics.nist.gov/cuu/Units/outside.html
and
http://physics.nist.gov/cuu/Units/checklist.html
one further constrain is that only printable (7bit) ASCII characters are allowed
2017-05-17 18:07:25 +10:00
Andrew Tridgell d6d94bd26c RC_Channel: improved doc string 2017-02-07 16:32:57 +11:00
Andrew Tridgell 11afd0c7d4 RC_Channel: split RC_Channels.cpp out to separate cpp file
this is needed for automatic parameter documentation generation
2017-02-06 15:12:32 +11:00
Andrew Tridgell 0791186cd2 RC_Channel: split SRV_Channel into separate directory 2017-01-12 17:39:37 +11:00
Andrew Tridgell 64aa13e7f4 RC_Channel: 2nd stage of SRV_Channels conversion
allow for 16 output channel objects
2017-01-12 17:39:37 +11:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02: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 73b9123495 RC_Channel: added set_trim() API to SRV_Channels object 2016-10-15 16:59:35 +11:00
Andrew Tridgell fea7903aa8 RC_Channel: added get_radio_out_normalised() 2016-10-15 16:59:35 +11:00
Andrew Tridgell 96c7d9dde8 RC_Channel: make output_trim() go via _radio_out
this ensures that _radio_out always contains the value that would be
output to the channel. This will be used by the SRV_Channels object
2016-10-15 16:59:35 +11:00
Andrew Tridgell 934d2b6ae4 RC_Channel: added setup_failsafe_trim_mask() 2016-06-30 16:46:57 +10:00
skyscraper d9ab3baf84 RC_Channel: Refactor to make data members private
rename all public data members of RC_Channnels with
leading underscore and make all data members private.
Provide get_xx and set_xx methods for access

 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)

add function to save radio trim
(expression where c is an object of type RC_Channel)
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);
// other
c.min_max_configured() // return true if min and max are configured
c.save_radio_trim()    // save radio trim to eeprom
2016-05-10 16:21:15 +10:00
skyscraper 134ea338da RC_Channel: remove unused control_mix method 2016-05-05 18:58:17 -03:00
Ricardo de Almeida Gonzaga 5bd034a5a8 Global: start using cmath instead of math.h 2016-04-05 21:06:19 -07:00