Commit Graph

646 Commits

Author SHA1 Message Date
Arjun Vinod 54302d4943 RC_Channel: added left out copter flight modes as auxiliary switch options 2019-04-16 10:47:25 +09:00
Arjun Vinod 77a7c1bdf7 RC_Channel: fixed typo 2019-04-12 09:23:42 +10:00
Andrew Tridgell 4b0339d940 RC_Channel: fixed crash in RC_ProtocolTest example test 2019-04-09 12:50:17 +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
Peter Barker 8808991638 RC_Channel: remove unused enumeration 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
Andrew Tridgell 59082a0833 RC_Channel: added RC_OPTIONS flag for failsafe ignore
this is useful for SBUS with a receiver setup for HOLD on failsafe to
not trigger a RC failsafe
2019-03-15 14:38:57 +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
Pierre Kancir c81ddd85b6 RC_Channel: fix receiver typos 2019-01-25 10:01:00 +09:00
Randy Mackay 413bceda9d RC_Channel: minor format fix 2019-01-21 14:47:32 +09:00
Peter Barker a800395742 RC_Channel: remove use of never-set AP_HAL_PX4 and AP_HAL_VRBRAIN 2019-01-18 09:53:44 +11: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 87aeaf7315 RC_Channel: adjust type for auxillary switch position 2019-01-09 17:21:00 +11: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
Randy Mackay aa7c9ec89e RC_Channel: minor format fixes 2018-12-05 19:18:31 +09:00
Andrew Tridgell ee78374513 RC_Channel: added GPS_DISABLE option on a switch 2018-11-29 08:49:23 +11:00
Peter Barker c9714ae962 RC_Channel: read_aux_all is no longer overrridden by any class 2018-11-23 10:56:17 +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
Randy Mackay e6b8607baf RC_Channel: formatting and comment fix 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
Peter Barker ea426a3d45 RC_Channel: fix erroneous comment on RC relay options 2018-10-23 11:42:47 +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
Michael du Breuil 20c56f3e06 RC_Channel: Add an accessor for a channels range and type 2018-09-11 09:07:00 +10: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
Peter Barker c54c2a2930 RC_Channel: fix and tidy example 2018-08-31 21:08:11 +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 87e7cc7ef0 RC_Channels: zero all channels before populating
Fix for CID 308365
2018-08-07 09:12:43 +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 ff36eb3aca RC_Channel: remove old members objects 2018-08-03 13:07:50 +10:00
Peter Barker 5df70cf93a RC_Channel: update examples for new rc() method 2018-08-01 12:11:30 +09:00
Peter Barker 0f084ed5bf RC_Channel: add compatability static functions
Just to avoid churn in Sub, Plane and Tracker
2018-08-01 12:11:30 +09:00
Peter Barker 747fc3814d RC_Channel: rename in_rc_failsafe to has_valid_input 2018-08-01 12:11:30 +09: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 c8a93f9b76 RC_Channel: Remove set_overrides() method 2018-05-11 12:13:39 +01:00
Michael du Breuil 30554d0de0 RC_Channels: Collapse has_new_input() with set_pwm_all() 2018-04-26 08:00: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
Michael du Breuil a6afc69c13 RC_Channel: Support most hal.rcin functions in RC_Channels 2018-04-11 21:47:07 +01:00
Andrew Tridgell ac4017e2ae RC_Channel: added set_and_save_radio_trim()
# Conflicts:
#	libraries/RC_Channel/RC_Channel.h
2018-02-08 17:36:33 +11: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
Andrew Tridgell 64f722876f RC_Channel: use set_and_save_ifchanged 2017-07-03 11:17:42 +10:00
Andrew Tridgell b50ab75f4c RC_Channel: added set_and_save_trim() 2017-07-03 11:17:42 +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
Pierre Kancir 90661c528a RC_Channel: example fix travis warning
missing function declaration
implicit cast
some style fix
2017-04-13 19:56:16 +01: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
murata 836c8aa684 RC_Channel: Unify from print or println to printf. 2017-01-27 18:20:22 +11:00
Peter Barker d2b2ddcb02 RC_Channel: make min_max_configured const 2017-01-20 13:02:53 +09:00
Andrew Tridgell 77a7e7ca01 RC_Channel: give access to internals to SRV_Channel
needed for parameter upgrade
2017-01-12 17:39:37 +11:00
Andrew Tridgell b6aa4205b4 RC_Channel: cleanup API and comments a bit 2017-01-12 17:39:37 +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
Peter Barker 319cfa766b RC_Channel: add method to get current radio out for a function 2016-12-02 12:04:05 +11:00
Peter Barker 7200692137 RC_Channel: make EPM a subclass of AP_Gripper_Backend 2016-11-05 10:20:41 +09:00
Peter Barker d2e798d549 RC_Channel: alias k_epm to k_kgripper 2016-11-05 10:20:31 +09: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 f9dd31b6e5 RC_Channel: support automatic servo trimming 2016-10-16 15:20:47 +11:00
Andrew Tridgell 992bf2368e RC_Channel: cope with SERVO_RNG_ENABLE changing while booted
this prevents a one second throttle up on scaled ESCs when
enabling/disabling the servo output mapping
2016-10-15 16:59:37 +11:00
Andrew Tridgell 4a9ddf52e0 RC_Channel: constrain output to servo range
don't allow servos past configured range in any mode
2016-10-15 16:59:36 +11:00
Andrew Tridgell 2ceddddd3b RC_Channel: don't call output() in SRV_Channel
we may need to run another mixer
2016-10-15 16:59:36 +11:00
Andrew Tridgell 78ef3b77c6 RC_Channel: added disable_passthrough() method 2016-10-15 16:59:36 +11:00
Andrew Tridgell 2ec439d7e3 RC_Channel: added set_esc_scaling() to SRV_Channels 2016-10-15 16:59:36 +11:00
Andrew Tridgell 73b9123495 RC_Channel: added set_trim() API to SRV_Channels object 2016-10-15 16:59:35 +11:00
Andrew Tridgell c7f8b255e7 RC_Channel: added SRV_Channels object for remapping output channels
this allows for decoupling RC input ranges from servo output ranges
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
Lucas De Marchi ae53920e5b build: don't build examples with old build system
We currently check examples are buildable with waf which doesn't need
the libraries to be specified in a make.inc file.  Having the makefiles
there is misleading since people try to build and realize the build is
broken.
2016-10-11 13:03:08 +11:00
Andrew Tridgell 38fff6d43d RC_Channel: expanded docs for RCn_FUNCTION 2016-08-16 16:16:09 +10:00
Andrew Tridgell 62f3818b83 RC_Channel: added k_throttle
for secondary throttle on planes
2016-08-16 16:14:34 +10:00
Andrew Tridgell be2b6e47aa RC_Channel: added output types for choke, ignition and starter 2016-07-25 10:06:03 +10:00
Andrew Tridgell 7ea68f8f80 RC_Channel: fixed function indexes above 64 2016-07-24 19:46:01 +10:00
Andrew Tridgell 3377714300 RC_Channel: fixed typo 2016-07-01 15:35:55 +10:00
Andrew Tridgell 934d2b6ae4 RC_Channel: added setup_failsafe_trim_mask() 2016-06-30 16:46:57 +10:00
Andrew Tridgell 120564f094 RC_Channel: set_radio() should not constrain values
caller is supplying direct PWM value. The MIN/MAX should not apply
2016-06-14 13:08:35 +10:00
Andrew Tridgell 4e3dd315cb RC_Channel: fixed double channel assignment
this fixes RC_Channel_aux::set_aux_channel_default from assigning
k_heli_rsc twice, once at default channel and once at user designated
channel
2016-06-05 05:54:56 +10:00
Andrew Tridgell 2094cb2d88 RC_Channel: fixed example for MAVLink2 2016-05-21 15:25:17 +10:00
Ricardo de Almeida Gonzaga 099fc69032 RC_Channel: Fix typos 2016-05-13 19:20:05 -03:00
Andrew Tridgell a41ffc176c RC_Channel: added motor tilt auxillary channel 2016-05-11 05:55:23 +10:00
skyscraper c0c8f1a5cc RC_Channel: RC_Channel refactor
Fix up RC_Channel examples.

Change direct access to data members
to access via member functions
2016-05-10 16:21:17 +10:00
skyscraper d16659331f RC_Channel_aux: Rename static member functions
Further to refactor of RC_Channel class which included
adding get_xx set_xx methods, some methods names are now
in conflict with those in the derived RC_Channel_aux class.
To keep a uniform naming convention in RC_Channel where
functions are most used and most numerous, the offending
functions in RC_Channel__aux are renamed as follows

 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:15 +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
Andrew Tridgell 50908edc91 RC_Channel: added parameter docs for missing RCn_FUNCTION values 2016-05-09 17:33:21 +10:00
Andrew Tridgell ab0b76764f RC_Channel: added set_servo_failsafe_pwm() 2016-05-07 07:25:27 +10:00
skyscraper 134ea338da RC_Channel: remove unused control_mix method 2016-05-05 18:58:17 -03:00
Andrew Tridgell 54f7aeed83 RC_Channel: extend channel mapping to 16 channels
this gives more flexibility, no reason to limit it to 8
2016-04-23 21:03:46 +10:00
Andrew Tridgell ed2f26d7b8 RC_Channel: allow for pass-thru from low channels to any channel
this makes it easier to setup things like ignition cut or bottle drop
with a 8 channel radio
2016-04-10 20:33:12 +10:00
Ricardo de Almeida Gonzaga 5bd034a5a8 Global: start using cmath instead of math.h 2016-04-05 21:06:19 -07:00
Andrew Tridgell 1ecfa6b487 RC_Channel: fixed example in SITL 2016-03-25 21:35:33 +11:00
Andrew Tridgell 4deb01b8d5 RC_Channel: set AP_PARAM_NO_SHIFT 2016-03-18 12:33:34 +11:00
Lucas De Marchi 08cc7b2472 RC_Channel: replace header guard with pragma once 2016-03-16 18:40:44 +11:00
Gustavo Jose de Sousa c2e3f05dbf waf: ardupilotwaf: prefix build context methods with ap_
It helps to distinguish between things from waf and things from ardupilotwaf.
2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa 3d22490397 waf: examples: use methods from bld instead of ardupilotwaf 2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa d281067bcc waf: make example binaries be placed in 'examples' dir
This commit makes examples' wscripts use ardupilotwaf.example() instead of
ardupilot.program().
2016-01-15 16:46:41 -02:00
Andrew Tridgell a07a8aece1 RC_Channel: added pwm_to_angle_dz_trim() 2016-01-06 22:47:21 +11:00
Andrew Tridgell 9941c91d36 RC_Channel: prevent a warning message for assigned RC channels 2016-01-06 19:16:12 +11:00
Andrew Tridgell b6155d2cb6 RC_Channel: fixed output for k_motor* 2016-01-05 06:41:51 +11:00
Andrew Tridgell 238e912000 RC_Channel: allow find_channel() to be called early
and fix a bug!
2016-01-05 06:40:48 +11:00
Andrew Tridgell 9123ef9f38 RC_Channel: added find_channel() and channel numbers 2016-01-04 17:06:57 +11:00
Andrew Tridgell 6a58264c6b RC_Channel: added set_aux_channel_default() API
this will allow for a default channel for aux functions. Also adds
heli_rsc and heli_tail_rsc functions
2016-01-04 16:14:09 +11:00
Andrew Tridgell 7cc53b6449 RC_Channel: setup only in or out part of channels for aux channels
this allows separate use of input and output
2016-01-04 11:23:36 +09:00
Andrew Tridgell 48b774bc63 RC_Channel: allow more complete separation of input and output of channels
this allows for the type and range of channels to be different on
input and output
2016-01-04 11:23:30 +09:00
Jonathan Challinger 027e622a3c RC_Channel: fix example build 2015-12-29 10:46:35 -08:00
Lucas De Marchi a096703b06 Global: don't link with AP_Progmem
AP_Progmem is not used anymore.
2015-12-27 15:58:12 -02:00
Andrew Tridgell e1c890eb58 RC_Channel: added RC_UART example
useful for UART -> ESCs
2015-12-27 16:12:27 +11:00
Lucas De Marchi e8e48fd8e0 RC_Channel: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +11:00
Caio Marcelo de Oliveira Filho 6e7b73610d waf: add waf support 2015-12-03 07:54:30 +11:00
Lucas De Marchi 2591261af6 Global: rename min and max macros to uppercase
The problem with using min() and max() is that they conflict with some
C++ headers. Name the macros in uppercase instead. We may go case by
case later converting them to be typesafe.

Changes generated with:

	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)max(/\1MAX(/g'
	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)min(/\1MIN(/g'
2015-12-01 16:28:09 -02:00
Andrew Tridgell 52f2fce1d5 RC_Channel: prevent float exception with bad RCn_MIN/MAX/TRIM
thanks to Michael for finding this
2015-11-30 21:53:54 +11:00
Andrew Tridgell 8f4ce7f20b build: removed all nocore.inoflag files
these were APM2 specific
2015-11-16 08:05:17 +11:00
Robert Lefebvre 58e918341d RC_Channel: Add motor_run_enable aux function 2015-11-12 19:37:27 +09:00
Andrew Tridgell ea5cd99651 RC_Channel: use is_bounded_int32() 2015-11-11 13:45:09 +11:00
Grant Morphett 7edf8c0e0a RC_Channel: New method to detect if channel is in trim location
This is a new method which will return true if an RC_Channel has a PWM
value that is at its TRIM value plus or minus the allowed dead zone
around the TRIM.
2015-11-11 13:39:38 +11:00
Lucas De Marchi 2a91d2169e RC_Channel: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 2847af905e RC_Channel: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:13 +11:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Jonathan Challinger 21e7d46944 RC_Channel: use set_default for runtime param defaults 2015-10-26 11:15:54 +11:00
Caio Marcelo de Oliveira Filho e36728d1db RC_Channel: make example compile again
By adding a missing library dependency. Also remove unnecessary
includes, in particular including each board HAL file is not needed
anymore.
2015-10-21 09:16:09 +11:00
Caio Marcelo de Oliveira Filho ec52df991c build: compile only the HAL files needed by the board
Instead of requiring every program to specify the HAL related modules,
let the build system do it (in practice everything we compiled depended
on HAL anyway). This allow including only the necessary files in the
compilation.
2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 2e464a53c2 AP_HAL: make code not depend on concrete HAL implementations
The switching between different AP_HAL was happening by giving different
definitions of AP_HAL_BOARD_DRIVER, and the programs would use it to
instantiate.

A program or library code would have to explicitly include (and depend)
on the concrete implementation of the HAL, even when using it only via
interface.

The proposed change move this dependency to be link time. There is a
AP_HAL::get_HAL() function that is used by the client code. Each
implementation of HAL provides its own definition of this function,
returning the appropriate concrete instance.

Since this replaces the job of AP_HAL_BOARD_DRIVER, the definition was
removed.

The static variables for PX4 and VRBRAIN were named differently to avoid
shadowing the extern symbol 'hal'.
2015-10-21 09:16:07 +11:00
Grant Morphett 122e88dbed RC_Channel: remove the unused test function get_failsafe 2015-09-09 10:28:02 +10:00
Andrew Tridgell 1162503199 RC_Channel: fixed example build 2015-08-11 17:00:13 +10:00
Gustavo Jose de Sousa d2780623f7 RC_Channel: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:38:25 +10:00
Andrew Tridgell c86ff1ac25 RC_Channel: prevent floating exception on bad MIN/MAX/TRIM values 2015-07-27 12:04:03 +10:00
Randy Mackay 03a336d496 RC_Channel: update_aux_servo_function made public 2015-06-10 16:47:06 +09:00
Andrew Tridgell e234844905 RC_Channel: fixed example sketch 2015-06-01 18:05:50 +10:00
Andrew Tridgell 6c1c2dd8bd RC_Channel: convert example from .pde to .cpp 2015-06-01 17:07:08 +10:00
Randy Mackay b121d83beb RC_Channel: add EPM, LandingGear to FUNCTION param description 2015-05-27 18:05:01 +09:00
Randy Mackay 1b13250fd8 RC_Channel: small parameter description change 2015-05-14 10:33:08 +09:00
Andrew Tridgell fa688a7b14 RC_Channel: fix for HAL_SITL rename 2015-05-05 09:45:57 +10:00
Randy Mackay 5b15c07d47 RC_Channel: fix example sketch 2015-05-01 21:02:57 +09:00
Andrew Tridgell 6959cdbf15 RC_Channel: fixed usage of _reverse to be consistent
users could set RCn_REV to 0 and get very confusing results
2015-02-18 12:47:56 +11:00
Robert Lefebvre 4935a42054 RC_Channel_Aux: Add new landing gear control to Aux_servo_function_t enum.
Conflicts:
	libraries/RC_Channel/RC_Channel_aux.h
2015-01-07 11:58:17 +09:00
Andrew Tridgell 86bf02d64c RC_Channel: update example sketch to copy input to output 2014-12-02 16:27:33 +11:00
Kirill A. Kornilov 33e4f44434 RC_Channel: added set_radio_trimmed()
take into account trim value in set_radio()
2014-11-25 08:19:27 +11:00
Randy Mackay 73f3b50e2f RC_Channel: make get_control_mid const 2014-11-17 18:16:12 -08:00
Jonathan Challinger 9375fc8947 RC_Channel: add get_control_mid function 2014-11-17 18:16:09 -08:00
Jonathan Challinger 4d7988b302 RC_Channel: replace long with int32_t 2014-11-17 18:16:08 -08:00
Andrew Tridgell 6b0c15b70f RC_Channel: added norm_input_dz()
normalised input, taking into account dead zone
2014-11-18 12:44:05 +11:00
Andrew Tridgell 2270a904ce RC_Channel: make flaperson range from -4500 to 4500 2014-11-14 11:23:52 +11:00
Andrew Tridgell 16fd113020 RC_Channel: added channel_function()
this is used in the plane mixing code
2014-11-07 10:39:07 +11:00
Randy Mackay 79f95efb71 RC_Channel_aux: add epm to servo function enum 2014-09-17 21:13:30 +09:00
Andrew Tridgell e1a13edf3d RC_Channel: fixed example build 2014-08-13 22:12:30 +10:00
Andrew Tridgell 2e5913df93 RC_Channel: fixed k_manual for set_servo_limit()
this allows for failsafe takeover of k_manual channels, which fixes
the behaviour for ignition failsafe
2014-08-09 22:50:14 +10:00
Andrew Tridgell 0d4985079e RC_Channel: added support for LimitValue settings
this allows you to set a channel failsafe or radio_out to a limit
value
2014-04-21 11:52:41 +10:00
Andrew Tridgell 7f4178d967 RC_Channel: added setup_failsafe_trim_all() function
sets all channels to output trim values on FMU failure
2014-04-21 08:37:24 +10:00
Randy Mackay 8600b9d4f1 RC_Channel: add parachute_release to function enum 2014-04-07 13:36:33 +09:00
Andrew Tridgell 11f196318e RC_Channel: added static functions to simplify operations on all channels
this avoids vehicle code having to loop over all channels for common
operations
2014-04-03 12:18:56 +11:00
Andrew Tridgell 8c0c9c317e RC_Channel: prevent a numerical exception with bad mount parameters 2014-03-26 17:38:27 +11:00
Andrew Tridgell 6039eab442 RC_Channel: support up to 12 aux channels on PX4
this allows RC13 and RC14 to work correctly as aux outputs on Pixhawk
2014-03-25 15:42:48 +11:00
Andrew Tridgell 68462025ba RC_Channel: constrain norm_input() to -1 to 1
if RC is not properly calibrated we could get a value beyond 1, which
could cause some flight modes to exceed the roll/pitch limits of the
aircraft
2014-03-15 20:43:13 +11:00
Andrew Tridgell dd502e98b4 RC_Channel: added support for separate wheel steering channels on planes 2014-03-05 12:57:50 +11:00
Andrew Tridgell a788405c8b RC_Channel: added percent_input() function
useful for plane flaps
2014-03-05 09:17:50 +11:00
Mike McCauley be34e0358a RC_Channel: Removed duplicate defines from RC_Channel.h 2014-03-03 06:34:34 +11:00
Andrew Tridgell e11ada7bf0 RC_Channel: fixed comment on enable_aux_servos()
thanks to Mike McCauley for spotting
2014-02-18 09:25:07 +11:00
Andrew Tridgell 00d2d5946c RC_Channel: added disable_aux_channel()
this will be used by copter to ensure motor channels are not enabled
for aux functions
2014-02-06 21:30:55 +11:00
Andrew Tridgell b4208c7fc0 RC_Channel: added flaperon1 and flaperon2 function outputs 2014-02-06 12:35:32 +11:00
Andrew Tridgell 698736b66d RC_Channel: simplify the setup of aux channels
avoid the nasty mess of #if lines, as the info is in the constructor
anyway
2014-02-06 10:17:16 +11:00
Andrew Tridgell f6d888e0da RC_Channel: added disable_out() method 2013-12-20 11:58:53 +11:00
Andrew Tridgell e245bb07c2 RC_Channel: improved docs for RCn_FUNCTION=0 2013-12-16 11:17:26 +11:00
Randy Mackay f8e2947823 RC_Channel: parameter @Units to pwm 2013-11-26 22:34:28 +09:00
Randy Mackay 330687a754 RC_Channel: formatting 2013-10-31 15:23:52 +09:00
Andrew Tridgell 97b7130bb9 libraries: update license header to GPLv3
we switched to GPLv3 a long time ago, but neglected to update the
per-file license headers
2013-08-30 13:01:39 +10:00
Andrew Tridgell a12991923e RC_Channel: prevent overwrite of memory on high RC_Channel constructor 2013-08-18 11:42:23 +10:00
Randy Mackay e4ca7d2fdf AC_Sprayer: first implementation 2013-08-05 21:11:09 +09:00
Andrew Tridgell fef6a76078 RC_Channel: rename 'Manual' to RCPassThru
this should make it clearer what it does
2013-07-26 16:07:00 +10:00
Andrew Tridgell 21859f9364 RC_Channel: fixed dead_zone for range channels
The dead_zone was being used inconsistently, used in PWM space in one
place, and in control output space in another.

The fix required us to move the index number of the RC channel eeprom
value for RCn_DZ, as users will have a throttle deadzone of 3 set in
their eeprom due to a bug that Randy just fixed that caused the value
to always be saved to eeprom. In plane we then need to fix the
deadzone for the throttle to be 30

this fixes issue #303

Thanks to Soren Kuula for spotting this!
2013-07-13 13:18:54 +10:00
Randy Mackay fb5ada38c0 RC: example sketch uses set_default_dead_zone 2013-07-12 11:44:58 +09:00
Randy Mackay 47437b9ddf RC: set dead zone only if parameter has not been set by user 2013-07-12 11:44:16 +09:00
Andrew Tridgell 6b7b69a048 RC_Channel: added secondary rudder support
this is used when nose wheel steering needs different reverse/range
from rudder
2013-06-29 17:31:03 +10:00
Andrew Tridgell 02252b5387 RC_Channel: removed reference to dip switches 2013-06-03 17:49:56 +10:00
Andrew Tridgell c0058bbb03 RC_Channel: added output_trim() and read() functions
these make using rcmap in the plane code easier
2013-06-03 16:23:48 +10:00
Andrew Tridgell 0438952a8b RC_Channel: removed global rc_ch[] array
hide it as a object static instead
2013-06-03 16:23:47 +10:00
Andrew Tridgell c96ac5edbb RC_Channel: fixed indent-tabs-mode 2013-05-30 09:48:45 +10:00
Andrew Tridgell b71f36ee34 RC_Channel: support 8 auxillary RC channels
needed for full 12 channel support on PX4
2013-04-25 20:10:53 +10:00
Andrew Tridgell a093926b04 Revert "RC_Channel: removed pwm_out variable from RC_Channel"
This reverts commit 8e4a003d8d.

It is used by MotorsMatrix
2013-03-29 22:36:29 +11:00
Andrew Tridgell 8e4a003d8d RC_Channel: removed pwm_out variable from RC_Channel
saves 16 bytes
2013-03-29 19:32:52 +11:00
Michael 5d91b06de3 RC_Channel: added secondary elevator support 2013-02-05 08:57:28 +11:00
Andrew Tridgell 9b4c75c66b RC_Channel: don't change trim if radio in is zero 2013-01-25 20:44:36 +11:00
James Bielman 5631f865b2 Update floating point calculations to use floats instead of doubles.
- Allows use of hardware floating point on the Cortex-M4.
- Added "f" suffix to floating point literals.
- Call floating point versions of stdlib math functions.
2013-01-16 13:52:01 +11:00
Andrew Tridgell 374af1cd14 build: change from Arduino.mk to apm.mk 2013-01-02 17:29:37 +11:00
Andrew Tridgell cd430cb6a8 RC_Channel: added no_deadzone version of set_pwm() 2012-12-20 22:41:58 +11:00
Andrew Tridgell ceb3f577d8 libraries: use new math functions 2012-12-20 14:53:22 +11:00
Andrew Tridgell 22ada8b9c3 RC_Channel: fixed example build 2012-12-20 14:52:36 +11:00
Pat Hickey eb530b86e8 move Arduino.mk to /mk/Arduino.mk 2012-12-20 14:52:35 +11:00
Andrew Tridgell 7d27e420ae AP_HAL: remove unnecessary Arduino.h includes 2012-12-20 14:52:30 +11:00
Pat Hickey a28c614fbe remove RC_Channel2 test sketch: deprecated by AP_HAL 2012-12-20 14:51:40 +11:00
Andrew Tridgell 4aa16303ed RC_Channel: updates for new AP_Param API 2012-12-20 14:51:39 +11:00
Pat Hickey 475da4eca4 CONFIG_HAL_BOARD - test sketches fixed up, build all passes 2012-12-20 14:51:37 +11:00
Pat Hickey afa1143506 RC_Channel: ported to AP_HAL
* keeping everyone honest
* remove second unmaintained unit test:  No idea wtf is going on in there.
2012-12-20 14:51:26 +11:00
Pat Hickey 3f1d9d7f69 AP_Param: #include <AP_Param.h> fixups for libraries & sketches
* I mostly went through with grep and added an #include <AP_Param.h> below
  every #include <AP_Common.h>. Not all of these example sketches might
  strictly need AP_Param.
2012-12-20 14:51:19 +11:00
rmackay9 49619b15dd RC_Channel: move RC_CHANNEL_ANGLE, RANGE, ANGLE_RAW type definitions to .h file so they can be used by the main sketch 2012-12-09 16:42:58 +09:00
rmackay9 eac26b2313 RC_Channel_aux: immediately send output to servos when set_radio, set_radio_to_min, set_radio_to_max, set_radio_to_trim or set_servo_out functions are called. 2012-12-06 17:41:42 +09:00
Andrew Tridgell 1059ef2a54 Plane: fixed secondary aileron and manual aux servos in failsafe
the servo value wasn't being written to APM_RC while in failsafe for
these aux channels
2012-11-26 23:32:57 +11:00
Andrew Tridgell 9c3865b924 RC_Channel: fixed example build 2012-11-24 21:09:00 +11:00
Andrew Tridgell d2170230f4 RC_Channel: added aileron_with_input aux function 2012-11-21 13:34:26 +11:00
Andrew Tridgell f58abb7550 RC_Channel: added pwm_to_angle_dz() function
will be used by k_aileron in APM
2012-11-05 23:37:25 +11:00
Andrew Tridgell d57566ad0e RC_Channel: removed set_filter() and scale_output
these unused options were costing 5 bytes per channel, for a total of
50 bytes on ArduCopter
2012-11-05 20:49:42 +11:00
Andrew Tridgell 024e5c3cc7 RC_Channel: added set_radio() and set_radio_to_trim() functions 2012-10-31 12:43:53 +11:00
Xichen Shi 8c46fced16 APM: Added functionality to use differential spoilers in elevon mode
spoiler 1 and 2 are connected to 2 auxiliary channels, functions are
set to 16 on left wing and 17 om right wing respectively. Worked in
FBW + mode (auto etc.). No manual mode supported yet (need more
channels in my case).
2012-10-31 12:43:42 +11:00
Andrew Tridgell 5642922ca7 RC_Channel: simplify the example
use an array of channels
2012-10-16 15:50:54 +11:00
Andrew Tridgell 86b509a609 RC_Channel: ensure _reverse is not 0
this caused the example to fail
2012-10-16 15:50:29 +11:00
Pat Hickey 2936dbb9de RC_Channel unit test: fixed build, functionality still wrong 2012-10-15 10:37:29 -07:00
Andrew Tridgell 7b4dc246f8 RC_Channel: don't force radio_out in enable_aux_servos()
this is called regularly, and causes the servo to twitch
2012-09-20 17:34:32 +10:00
Andrew Tridgell 8620a036de RC_Channel_aux: minor cleanups
remove unused enable_out_ch() and enable k_manual channels. This
ensures k_manual channels used for bottle drop are initialised
correctly to trim output
2012-09-16 15:50:13 +10:00
Andrew Tridgell bd31f340a7 RC_Channel: support channel reversal on range channels
this makes it possible to have a reverse throttle in ArduPlane
2012-09-16 15:06:26 +10:00
Andrew Tridgell 3b97339104 RC_Channel: simplified RC_Channel_aux and fixed issue 725
it is perfectly valid to configure two RC channels with the same
function, especially when that function is manual output (ie. copy
input to output)

This removes the g_rc_function[] indirection array
2012-09-08 15:12:28 +10:00
rmackay9 5994117f6f RC_Channel_aux: bug fix which could cause channel to be assigned to the wrong function and miss others 2012-09-02 12:46:04 +09:00
uncrustify b1cf3f7f91 uncrustify libraries/RC_Channel/RC_Channel_aux.h 2012-08-21 19:04:32 -07:00
uncrustify 5564e0c440 uncrustify libraries/RC_Channel/RC_Channel.h 2012-08-21 19:04:31 -07:00
uncrustify fb2df43984 uncrustify libraries/RC_Channel/RC_Channel_aux.cpp 2012-08-21 19:04:31 -07:00
uncrustify e9fb7cfd92 uncrustify libraries/RC_Channel/RC_Channel.cpp 2012-08-21 19:04:31 -07:00
uncrustify 02877cfe28 uncrustify libraries/RC_Channel/examples/RC_Channel2/RC_Channel2.pde 2012-08-21 19:04:31 -07:00
uncrustify b2ade84dbb uncrustify libraries/RC_Channel/examples/RC_Channel/RC_Channel.pde 2012-08-21 19:04:31 -07:00
Amilcar Lucas c7d1974741 RC_Channel_aux: cycle thru all functions except k_none and k_nr_aux_servo_functions
Probably makes no difference because g_rc_function[k_none] == NULL
2012-08-11 13:43:21 +02:00
Amilcar Lucas 0b0b9c29a2 Allow fully independent operation of two AP_Mount instances 2012-08-08 23:11:23 +02:00
Andrew Tridgell 518d6365ff AP_Param: update remaining libraries for new constructor syntax 2012-08-08 12:11:57 +10:00
Amilcar Lucas 107155fa1a AP_Mount: Allow using any RC channel to control any of the mount axes.
This has the added benefit of saving 60 bytes and simplifying Mission Planner gui.
Moved some code from RC_Channel_aux to AP_Mount class
The servos get written by the update_mount_position() function, this simplifies main()
PS: The beauty of using libraries: I did not have to touch a single line of ArduPlane's code!
2012-08-05 23:48:57 +02:00
Amilcar Lucas b8c7b8a786 RC_Channel: Allow each channel to know who they are, this simplifies the enabling and output function calls. 2012-08-05 23:08:31 +02:00
Amilcar Lucas 9c1ac2d9e6 More work on ch9, 10 and 11 2012-08-04 19:44:41 +02:00
Amilcar Lucas bbc4bdb729 More flexible RC support 2012-08-04 18:39:20 +02:00
Amilcar Lucas 3de23220ed RC_Channel parameters: Fix a typo 2012-07-18 22:39:49 +02:00
Amilcar Lucas 22d2f9ea15 Support up to 7 aux servo outputs 2012-07-18 21:58:22 +02:00
Amilcar Lucas 461098b289 Replace long with int32_t 2012-07-18 02:12:31 +02:00
Amilcar Lucas 724c5f6490 Use ascending order in the values 2012-07-18 02:11:49 +02:00
Amilcar Lucas 1da0ce20ce Improve parameter documentation, it still does not work, but is an improvement.
I just do not understand why these parameters do not appear in Mission planner :(
2012-07-17 23:32:30 +02:00
rmackay9 669ffb5ef8 RC_Channel_aux: added enable_out method to help stop servos from moving before the mount has initialised.
changed parameter names of "update_aux_servo_function" to make it more clear that any 4 servos can be passed in (not just servos 5~8).
Also allowed NULL servos to be passed in as parameters because we only need 3 in ArduCopter.
2012-07-15 16:28:53 +09:00
Amilcar Lucas cc02d85cdf AP_Mount: add support for non-spring-loaded joysticks 2012-07-11 00:07:33 +02:00
Amilcar Lucas 9a41cbffdf RC_Channel: improve parameter documentation 2012-07-11 00:07:10 +02:00
Amilcar Lucas af338939be RC_Channel: Improve documentation 2012-07-07 21:57:30 +02:00
Amilcar Lucas e9c72822dc Remove unused function 2012-07-05 00:33:10 +02:00
Amilcar Lucas 78ccb9d37f Add linebreaks to increase readability. 2012-06-21 00:36:10 +02:00
Amilcar Lucas b072a59843 Improve parameters descriptive text 2012-06-21 00:20:37 +02:00
Amilcar Lucas 594cedd324 Documentation improvements, no functional changes (only comments) 2012-06-17 22:53:54 +02:00
Amilcar Lucas 1906e06b69 Added camera trigger functionality 2012-06-13 21:00:20 +02:00
Amilcar Lucas a32b7c200b Add "3 axis camera stabilization" and "point camera to 3D point" functionality
Patch by Gregory Fletcher and reviewed by me
2012-06-13 20:55:19 +02:00
rmackay9 c3b1a79f6a RC_Channel library: change all "int" types to "int16_t".
Fixes SITL compile error due to type mismatch of set_pwm between .h and .cpp file (this only occurs because on the SITL, "int" is actually "int32_t"
2012-06-02 14:20:58 +09:00
rmackay9 d9f124afbb RC_Channel.pde: fixed compile errors so that it actually works! 2012-06-02 14:00:44 +09:00
Jason Short c2d14a5cad RC_Channel fix for throttle output.
throttle was outputting incorrectly and allowing the user to max out the throttle leaving nothing for attitude control
2012-05-31 14:59:03 -07:00
Jason Short 0adb5cb396 Issue 416: RC_Channel – Fix to make dead_zones still output 0 2012-05-31 12:05:47 -07:00
Jason Short 1c690b44de removed never used filter, and fixed a constrain that could make range calcs go bad 2012-05-31 11:45:07 -07:00
Jason Short 862b374d19 Channel rage fix - low output was always 0 vs _low 2012-05-31 11:31:48 -07:00
rmackay9 82f81295a7 RC_Channel - fixed small compiler warning 2012-02-29 22:44:29 +09:00
Jason Short 1e37a0ec17 added a limit to range output 2012-02-18 21:08:17 -08:00
Andrew Tridgell 085cc00c33 RC_Channel_aux: fixed a uninitialied variable error, and save a bit of stack space 2012-02-15 08:50:45 +11:00
Andrew Tridgell 37cabb4cfa fixed dead zone load/save 2012-02-13 16:22:53 +11:00
Andrew Tridgell 47807ec68d RC_Channel_aux: catch invalid function settings
a bad function setting would overwrite the heap
2012-02-13 16:22:53 +11:00
Andrew Tridgell 9c5a5473ab added indexes to group info structures 2012-02-13 16:22:52 +11:00
Andrew Tridgell 84aef17bb0 fixed initialisation of RC_Channel class 2012-02-13 16:22:51 +11:00
Andrew Tridgell bf4a77da81 convert libraries to new typesafe macros 2012-02-13 16:22:51 +11:00
Andrew Tridgell 12dac42174 modify RC_Channel for AP_Param 2012-02-13 16:22:51 +11:00
analoguedevices 0ea6ecf8d1 Removed outdated comment:
"	// deadzone moved to
		//control_in = (abs(control_in) < _dead_zone) ? 0 : control_in;"
2012-02-11 16:51:02 +00:00
Michael Oborne 8ec192cf45 fix uint > int issue - for hil 2012-02-11 11:35:59 +08:00
Randy Mackay ed19c25a97 Arduino 1.0 - changed all #includes of "WProgram.h", "wiring.h" and "WConstants.h to "Arduino.h".
Modified FastSerial's write function to return size_t (number of bytes written).
2012-01-28 12:25:47 +09:00
Michael Oborne 6b949511ca change rc norm_output to scale evenly across the entire range 2012-01-20 16:24:55 +08:00
Pat Hickey c9f7618ccc purple: rework the RC_Channel library for the APM_RC changes 2011-11-25 20:00:16 -08:00
Amilcar Lucas ab730ff919 Added camera and/or antenna mount support.
It is fully configurable with the mission planner, there is no need to change
the source code to adapt to your setup.
It needs more testing, but the SIL is not working for me.
2011-10-31 22:55:58 +01:00
Michael Oborne d18bb1cc7e prevent div by 0 2011-10-30 21:28:39 +08:00
Andrew Tridgell 0211fc2f09 move g_rc_function[] to RC_Channel library
libraries should not rely on data declared in the main program. This
caused a build error for the Desktop build for ArduCopter under cygwin
2011-10-29 18:42:18 +11:00
Jason Short 76bf784f8c RC_Channel Dead zone
Added APVar dead_zone to the RC_Channel library so you could edit it in the Mission planner
Made CH filtering off by default.
2011-10-27 11:34:00 -07:00
James Goppert 0c7c508541 Optional recursion added. 2011-09-30 17:17:51 -04:00
James Goppert 5489b84f8e Improvements to cmake. 2011-09-29 21:23:26 -04:00
James Goppert d887a28b91 Added ArduBoat/ ArduRover/ and APO library. 2011-09-29 14:12:15 -04:00
Jason Short 326cfef808 Dead Zone fix - Now the range is full instead of clipped. Should make the Yaw much more smooth. 2011-09-26 22:12:39 -07:00
Jason Short ce338071eb RC_Channel tweaks. using Radio_trim rather than 1500 in Raw output. Cleaned up line in calc PWM to be easier to read. 2011-09-21 14:52:20 -07:00
Amilcar Lucas 227ce0a92d Merge some small misc improvements from APM_Camera branch 2011-09-17 20:25:31 +02:00
Jason Short cd72e6bea9 roughed in an expo option idea
made min and max values 1100, 1900
removed hard coded init for camera values
2011-09-16 19:06:53 -07:00
unknown 7a70cb6169 Merge branch 'master' of https://code.google.com/p/ardupilot-mega/ 2011-09-14 16:02:21 +02:00
unknown a4e001bbcf Adding CMake support 2011-09-14 15:44:55 +02:00
Amilcar Lucas 1f29197771 Revert more of 6dcbc7f44bc0.
Fix an issue with initialization of channels that on-line changed their function.
For the curious people that the code size overhead of having any aux channel do any function (with this code) is 44 bytes.
 To see wich code I'm talking about, do a git diff 05057ac2d455..this_commit (replace this commit with the commit hash of this commit)
2011-09-13 14:01:35 +02:00
Amilcar Lucas f08cea8044 These changes were meant to be inside commit a14c06adc06b. I'm sorry but reverting stuff is not that easy 2011-09-13 01:54:47 +02:00
Amilcar Lucas 5406991831 Added support for routing any function to any of the aux. servos.
This is a manual merge from the APM_Camera branch.
It reverts the stuff that Oliver did not menat to do with his commit 6dcbc7f44bc0
2011-09-13 01:24:06 +02:00
Amilcar Lucas c7b3bfd295 Use the G_RC_AUX macro when possible. Added more comments. Remove unused code 2011-09-12 20:21:12 +02:00
Amilcar Lucas 77c798abd5 Use G_RC_AUX macro to simplify accessing the auxiliary servos 2011-09-12 00:02:47 +02:00
Amilcar Lucas 46f9d4cec8 This is ugly, but it fixes compilation on arduino 2011-09-11 23:25:06 +02:00
Amilcar Lucas ce010b4e38 Moved update_aux_servo_function() to the RC_Channel_aux.* files.
This simplifies code sharing between ArduCopter and Arduplane at the expense of 48bytes.
Moved CH_x defines out of the defines.h file and into the library where they belong
2011-09-11 23:07:30 +02:00
Amilcar Lucas 213969202a Moved the RC_Channel_aux class to its own file. The includes could be improved, has anyone got any ideas how ? 2011-09-11 19:13:01 +02:00
Amilcar Lucas c5fd792024 Make the switch case complete 2011-09-11 18:32:24 +02:00
Amilcar Lucas 9f14c5f578 Fix RC range reversal 2011-09-11 04:12:46 +02:00
Amilcar Lucas dd19a7302d I do not understand this, but it looks like it needs int8 here 2011-09-11 02:41:48 +02:00
Amilcar Lucas d84f80cb0d Moved enum values around to make code simpler to read and use 2011-09-11 02:34:47 +02:00
Amilcar Lucas 386e80eaf6 Added comments and TODO 2011-09-10 23:57:27 +02:00
Amilcar Lucas f4998c3673 Moved a function from radio.pde to the RC_Channel_aux library. Now its more readable and reusable 2011-09-10 13:26:29 +02:00
Amilcar Lucas b7a0d8836a This is the real HEAD of the APM_Camera branch. Seams that lots of changes got lost in the SVN to GIT port 2011-09-09 16:18:38 +02:00
jasonshort e05de48e2d Adding reverse to Channel Raw output (unscaled output) to fix camera reversing.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@3297 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-09-08 04:58:42 +00:00
jasonshort 150f58a4bd removed scaling on control in because it might cause rounding issues.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2969 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-30 23:48:38 +00:00
jasonshort b7b0212506 Cleaned up or reverse code.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2842 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-07-13 05:54:40 +00:00
rmackay9@yahoo.com 499cbec9e5 RC_Channel.h - small change to store _reverse setting to eeprom
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2528 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-06-10 03:33:31 +00:00
jasonshort 8f82de3e11 changed a bool to uint8_t
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2120 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-05-06 17:51:26 +00:00
jasonshort a67b1d6896 Added new output type AMGLE_RAW - this will ouput non-scaled PWM, better for copters than fixed wings.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2093 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-05-05 17:46:11 +00:00
DrZiplok 701157c350 Re-order class members to avoid initializer-order warnings.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2073 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-05-02 05:56:21 +00:00
james.goppert@gmail.com c1b6032e7f Eclipse makefile support for examples.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1860 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-04-09 19:38:12 +00:00
tridge60@gmail.com 860998d337 implemented typesafe PSTR()
This makes PSTR() type safe by using a 1 byte wrapper
structure. Attempts to use the wrong varient of a print function will
generate a compilation error.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1797 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-03-21 07:25:48 +00:00
jasonshort 29a486c519 removed unused save_trim() function
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1716 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-02-23 05:17:24 +00:00
DrZiplok@gmail.com c52b459a53 Variable names must be PROGMEM strings.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1655 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-02-14 17:43:33 +00:00
DrZiplok@gmail.com 1dd50ec263 Use AP_Var to store channel calibration.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1651 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-02-14 04:43:44 +00:00
deweibel@gmail.com 3443a7817d Add reversing for PWM outputs in angle_to_pwm case.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1566 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-27 18:16:22 +00:00
deweibel@gmail.com 50c3b2e4fd Add initial values for scaling and dead zone to RC_Channel constructor
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1506 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-17 04:05:48 +00:00
jasonshort 3d529b3a51 added channel examples
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1330 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-28 19:29:37 +00:00
jasonshort 0738870e64 included setup process
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1329 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-28 19:20:35 +00:00
jasonshort 3f61f5aa49 git-svn-id: https://arducopter.googlecode.com/svn/trunk@1320 f9c3cf11-9bcb-44bc-f272-b75c42450872 2010-12-28 18:57:20 +00:00
jasonshort 7dd1b3cbe7 removed EEPROMB references
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1314 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-28 18:42:03 +00:00
jasonshort bf3ee6f843 fixed bug
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1304 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-27 23:03:26 +00:00
jasonshort 68eec6805a update use EEPROM class, new scaled input for RC_Channel
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1264 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-26 01:17:04 +00:00
james.goppert 24bb547eae Added some functionality to RC_Channel to meet APM needs.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1223 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-21 03:53:26 +00:00
jasonshort e194e2fa75 git-svn-id: https://arducopter.googlecode.com/svn/trunk@1118 f9c3cf11-9bcb-44bc-f272-b75c42450872 2010-12-13 04:08:22 +00:00
jasonshort 718bf566c8 rc range bug fixed
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1058 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-06 17:22:05 +00:00
jasonshort 4ef6bd673f added trim save
git-svn-id: https://arducopter.googlecode.com/svn/trunk@980 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-11-29 01:44:40 +00:00
jasonshort 44f2139951 added filter option
git-svn-id: https://arducopter.googlecode.com/svn/trunk@969 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-11-28 07:03:23 +00:00
jasonshort 59a3087cb6 added control / nav mixing
git-svn-id: https://arducopter.googlecode.com/svn/trunk@944 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-11-27 03:04:30 +00:00
jasonshort dc16a2961d git-svn-id: https://arducopter.googlecode.com/svn/trunk@926 f9c3cf11-9bcb-44bc-f272-b75c42450872 2010-11-25 07:10:06 +00:00
jasonshort 2eb714aa51 almost ready for use, still testing
git-svn-id: https://arducopter.googlecode.com/svn/trunk@906 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-11-23 21:20:38 +00:00
jasonshort 2dd479ea62 almost ready for use, still testing
git-svn-id: https://arducopter.googlecode.com/svn/trunk@905 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-11-23 21:20:29 +00:00
jasonshort@gmail.com 4fa2491adf This is a new Library for managing RC input channels which will replace the current way of storing RC input in Arrays and most of the Radio.pde tab
git-svn-id: https://arducopter.googlecode.com/svn/trunk@902 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-11-23 19:28:19 +00:00