Browse Source

Rover: replace get_output_norm*100 for throttle with get_output_scaled

No functional change
master
Andrew Tridgell 8 years ago committed by Randy Mackay
parent
commit
d060fd2826
  1. 4
      APMrover2/GCS_Mavlink.cpp
  2. 4
      APMrover2/Log.cpp
  3. 2
      APMrover2/crash_check.cpp

4
APMrover2/GCS_Mavlink.cpp

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

4
APMrover2/Log.cpp

@ -278,7 +278,7 @@ void Rover::Log_Write_Nav_Tuning()
wp_distance : wp_distance, wp_distance : wp_distance,
target_bearing_cd : static_cast<uint16_t>(fabsf(nav_controller->target_bearing_cd())), 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())), 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() xtrack_error : nav_controller->crosstrack_error()
}; };
DataFlash.WriteBlock(&pkt, sizeof(pkt)); DataFlash.WriteBlock(&pkt, sizeof(pkt));
@ -336,7 +336,7 @@ void Rover::Log_Write_Sonar()
turn_angle : static_cast<int8_t>(obstacle.turn_angle), turn_angle : static_cast<int8_t>(obstacle.turn_angle),
turn_time : turn_time, turn_time : turn_time,
ground_speed : static_cast<uint16_t>(fabsf(ground_speed * 100)), 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)); DataFlash.WriteBlock(&pkt, sizeof(pkt));
} }

2
APMrover2/crash_check.cpp

@ -23,7 +23,7 @@ void Rover::crash_check()
if ((ahrs.groundspeed() >= CRASH_CHECK_VEL_MIN) || // Check velocity if ((ahrs.groundspeed() >= CRASH_CHECK_VEL_MIN) || // Check velocity
(fabsf(ahrs.get_gyro().z) >= CRASH_CHECK_VEL_MIN) || // Check turn speed (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; crash_counter = 0;
return; return;
} }

Loading…
Cancel
Save