Rover: replace get_output_norm*100 for throttle with get_output_scaled

No functional change
This commit is contained in:
Andrew Tridgell 2017-06-20 15:18:38 +09:00 committed by Randy Mackay
parent 79f7cc5779
commit d060fd2826
3 changed files with 5 additions and 5 deletions

View File

@ -162,7 +162,7 @@ void Rover::send_servo_out(mavlink_channel_t chan)
0, // port 0
10000 * channel_steer->norm_output(),
0,
10000 * SRV_Channels::get_output_norm(SRV_Channel::k_throttle),
100 * SRV_Channels::get_output_scaled(SRV_Channel::k_throttle),
0,
0,
0,
@ -179,7 +179,7 @@ void Rover::send_vfr_hud(mavlink_channel_t chan)
gps.ground_speed(),
ahrs.groundspeed(),
(ahrs.yaw_sensor / 100) % 360,
static_cast<uint16_t>(100 * fabsf(SRV_Channels::get_output_norm(SRV_Channel::k_throttle))),
SRV_Channels::get_output_scaled(SRV_Channel::k_throttle),
current_loc.alt / 100.0f,
0);
}

View File

@ -278,7 +278,7 @@ void Rover::Log_Write_Nav_Tuning()
wp_distance : wp_distance,
target_bearing_cd : static_cast<uint16_t>(fabsf(nav_controller->target_bearing_cd())),
nav_bearing_cd : static_cast<uint16_t>(fabsf(nav_controller->nav_bearing_cd())),
throttle : static_cast<int8_t>(100 * SRV_Channels::get_output_norm(SRV_Channel::k_throttle)),
throttle : int8_t(SRV_Channels::get_output_scaled(SRV_Channel::k_throttle)),
xtrack_error : nav_controller->crosstrack_error()
};
DataFlash.WriteBlock(&pkt, sizeof(pkt));
@ -336,7 +336,7 @@ void Rover::Log_Write_Sonar()
turn_angle : static_cast<int8_t>(obstacle.turn_angle),
turn_time : turn_time,
ground_speed : static_cast<uint16_t>(fabsf(ground_speed * 100)),
throttle : static_cast<int8_t>(100 * SRV_Channels::get_output_norm(SRV_Channel::k_throttle))
throttle : int8_t(SRV_Channels::get_output_scaled(SRV_Channel::k_throttle))
};
DataFlash.WriteBlock(&pkt, sizeof(pkt));
}

View File

@ -23,7 +23,7 @@ void Rover::crash_check()
if ((ahrs.groundspeed() >= CRASH_CHECK_VEL_MIN) || // Check velocity
(fabsf(ahrs.get_gyro().z) >= CRASH_CHECK_VEL_MIN) || // Check turn speed
((100 * fabsf(SRV_Channels::get_output_norm(SRV_Channel::k_throttle))) < CRASH_CHECK_THROTTLE_MIN)) {
(fabsf(SRV_Channels::get_output_scaled(SRV_Channel::k_throttle)) < CRASH_CHECK_THROTTLE_MIN)) {
crash_counter = 0;
return;
}