mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 14:50:35 +08:00
MAVLink app: Further improvements on simulated RC scaling
This commit is contained in:
@@ -948,7 +948,7 @@ MavlinkReceiver::handle_message_manual_control(mavlink_message_t *msg)
|
||||
* which makes the corner positions unreachable.
|
||||
* scale yaw up and clip it to overcome this.
|
||||
*/
|
||||
rc.values[2] = man.r / 1.2f + 1500;
|
||||
rc.values[2] = man.r / 1.1f + 1500;
|
||||
if (rc.values[2] > 2000) {
|
||||
rc.values[2] = 2000;
|
||||
} else if (rc.values[2] < 1000) {
|
||||
@@ -956,7 +956,12 @@ MavlinkReceiver::handle_message_manual_control(mavlink_message_t *msg)
|
||||
}
|
||||
|
||||
/* throttle */
|
||||
rc.values[3] = man.z + 1000;
|
||||
rc.values[3] = man.z / 0.9f + 1000;
|
||||
if (rc.values[3] > 2000) {
|
||||
rc.values[3] = 2000;
|
||||
} else if (rc.values[3] < 1000) {
|
||||
rc.values[3] = 1000;
|
||||
}
|
||||
|
||||
rc.values[4] = decode_switch_pos_n(man.buttons, 0) * 1000 + 1000;
|
||||
rc.values[5] = decode_switch_pos_n(man.buttons, 1) * 1000 + 1000;
|
||||
|
||||
Reference in New Issue
Block a user