mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 10:03:34 +08:00
mixer_group: do not clamp offset to arbitrary value
- allow the user to apply an offset that covers the entire servo range Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
@@ -132,10 +132,10 @@ MixerGroup::set_trims(int16_t *values, unsigned n)
|
||||
/* convert from integer to float */
|
||||
float offset = (float)values[index] / 10000;
|
||||
|
||||
/* to be safe, clamp offset to range of [-100, 100] usec */
|
||||
if (offset < -0.2f) { offset = -0.2f; }
|
||||
/* to be safe, clamp offset to range of [-500, 500] usec */
|
||||
if (offset < -1.0f) { offset = -1.0f; }
|
||||
|
||||
if (offset > 0.2f) { offset = 0.2f; }
|
||||
if (offset > 1.0f) { offset = 1.0f; }
|
||||
|
||||
debug("set trim: %d, offset: %5.3f", values[index], (double)offset);
|
||||
index += mixer->set_trim(offset);
|
||||
|
||||
Reference in New Issue
Block a user