Commit Graph

80 Commits

Author SHA1 Message Date
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
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
Jason Short 1e37a0ec17 added a limit to range output 2012-02-18 21:08:17 -08:00
Andrew Tridgell 37cabb4cfa fixed dead zone load/save 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 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