Rover: use floats for get/set output scaled

This commit is contained in:
Iampete1 2021-09-18 18:54:27 +01:00 committed by Andrew Tridgell
parent 8b34f2f48c
commit f178717212
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@
#define ENABLE ENABLED
#define DISABLE DISABLED
#define SERVO_MAX 4500 // This value represents 45 degrees and is just an arbitrary representation of servo max travel.
#define SERVO_MAX 4500.0 // This value represents 45 degrees and is just an arbitrary representation of servo max travel.
// types of failsafe events
#define FAILSAFE_EVENT_THROTTLE (1<<0)

View File

@ -293,7 +293,7 @@ void Sailboat::get_throttle_and_mainsail_out(float desired_speed, float &throttl
mast_rotation_angle = 90.0f;
if (wind_dir_apparent_abs > 135.0f) {
// wind is almost directly behind, keep wing on current tack
if (SRV_Channels::get_output_scaled(SRV_Channel::k_mast_rotation) < 0) {
if (is_negative(SRV_Channels::get_output_scaled(SRV_Channel::k_mast_rotation))) {
mast_rotation_angle *= -1.0f;
}
} else {