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
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
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
Grant Morphett
122e88dbed
RC_Channel: remove the unused test function get_failsafe
2015-09-09 10:28:02 +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
1b13250fd8
RC_Channel: small parameter description change
2015-05-14 10:33:08 +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
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
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
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
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
a788405c8b
RC_Channel: added percent_input() function
...
useful for plane flaps
2014-03-05 09:17:50 +11:00
Andrew Tridgell
f6d888e0da
RC_Channel: added disable_out() method
2013-12-20 11:58:53 +11:00
Randy Mackay
f8e2947823
RC_Channel: parameter @Units to pwm
2013-11-26 22:34:28 +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
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
47437b9ddf
RC: set dead zone only if parameter has not been set by user
2013-07-12 11:44:16 +09: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
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
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
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
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
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
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
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
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
uncrustify
e9fb7cfd92
uncrustify libraries/RC_Channel/RC_Channel.cpp
2012-08-21 19:04:31 -07:00
Andrew Tridgell
518d6365ff
AP_Param: update remaining libraries for new constructor syntax
2012-08-08 12:11:57 +10: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
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
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