mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 17:23:34 +08:00
Scale R/C inputs around the preset center, not the nominal center.
This commit is contained in:
@@ -119,7 +119,6 @@ controls_tick() {
|
|||||||
|
|
||||||
ASSERT(r_raw_rc_count <= MAX_CONTROL_CHANNELS);
|
ASSERT(r_raw_rc_count <= MAX_CONTROL_CHANNELS);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In some cases we may have received a frame, but input has still
|
* In some cases we may have received a frame, but input has still
|
||||||
* been lost.
|
* been lost.
|
||||||
@@ -168,8 +167,8 @@ controls_tick() {
|
|||||||
|
|
||||||
int16_t scaled = raw;
|
int16_t scaled = raw;
|
||||||
|
|
||||||
/* adjust to zero-relative (-500..500) */
|
/* adjust to zero-relative around center */
|
||||||
scaled -= 1500;
|
scaled -= conf[PX4IO_P_RC_CONFIG_CENTER];
|
||||||
|
|
||||||
/* scale to fixed-point representation (-10000..10000) */
|
/* scale to fixed-point representation (-10000..10000) */
|
||||||
scaled *= 20;
|
scaled *= 20;
|
||||||
|
|||||||
Reference in New Issue
Block a user