diff options
author | px4dev <px4@purgatory.org> | 2012-12-29 13:28:32 -0800 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2012-12-29 13:28:32 -0800 |
commit | 0ae5997bd0f05ca15cca6a17e8b7894227788151 (patch) | |
tree | 09c6b40b25ef25639087677ab8c6f5ca9989c5ec /apps/px4io/mixer.cpp | |
parent | 6b9d5dac4dd866903ed28f062a3c998a85058e63 (diff) | |
download | px4-firmware-0ae5997bd0f05ca15cca6a17e8b7894227788151.tar.gz px4-firmware-0ae5997bd0f05ca15cca6a17e8b7894227788151.tar.bz2 px4-firmware-0ae5997bd0f05ca15cca6a17e8b7894227788151.zip |
Fix some scaling errors in the PWM <-> mixer-internal conversions.
Diffstat (limited to 'apps/px4io/mixer.cpp')
-rw-r--r-- | apps/px4io/mixer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/px4io/mixer.cpp b/apps/px4io/mixer.cpp index 6af1dd3dc..9b3d65dba 100644 --- a/apps/px4io/mixer.cpp +++ b/apps/px4io/mixer.cpp @@ -126,7 +126,7 @@ mixer_tick(void) for (unsigned i = 0; i < IO_SERVO_COUNT; i++) { if (i < mixed) { /* scale to servo output */ - system_state.servos[i] = (outputs[i] * 1000.0f) + 1000; + system_state.servos[i] = (outputs[i] * 500.0f) + 1500; } else { /* set to zero to inhibit PWM pulse output */ system_state.servos[i] = 0; @@ -168,7 +168,7 @@ mixer_callback(uintptr_t handle, /* scale from current PWM units (1000-2000) to mixer input values */ /* XXX this presents some ugly problems w.r.t failsafe and R/C input scaling that have to be addressed */ - control = ((float)control_values[control_index] - 1000.0f) / 1000.0f; + control = ((float)control_values[control_index] - 1500.0f) / 500.0f; return 0; } |