APMrover2: fix servo_out to GCS message

This commit is contained in:
khancyr 2017-11-21 00:37:42 +01:00 committed by Randy Mackay
parent 005002736b
commit 279a57dc10

View File

@ -143,24 +143,27 @@ void Rover::send_nav_controller_output(mavlink_channel_t chan)
void Rover::send_servo_out(mavlink_channel_t chan)
{
#if HIL_MODE != HIL_MODE_DISABLED
// normalized values scaled to -10000 to 10000
// This is used for HIL. Do not change without discussing with
// HIL maintainers
float motor1, motor3;
if (g2.motors.have_skid_steering()) {
motor1 = 10000 * (SRV_Channels::get_output_scaled(SRV_Channel::k_throttleLeft) / 1000.0f);
motor3 = 10000 * (SRV_Channels::get_output_scaled(SRV_Channel::k_throttleRight) / 1000.0f);
} else {
motor1 = 10000 * (SRV_Channels::get_output_scaled(SRV_Channel::k_steering) / 4500.0f);
motor3 = 10000 * (SRV_Channels::get_output_scaled(SRV_Channel::k_throttle) / 100.0f);
}
mavlink_msg_rc_channels_scaled_send(
chan,
millis(),
0, // port 0
10000 * channel_steer->norm_output(),
motor1,
0,
g2.motors.get_throttle(),
motor3,
0,
0,
0,
0,
0,
receiver_rssi);
#endif
}
void Rover::send_vfr_hud(mavlink_channel_t chan)