Rover: Create DEGX100 to rad_to_cd

This commit is contained in:
Leonard Hall
2025-05-28 20:16:26 +09:00
committed by Randy Mackay
parent 3e4dafd4a2
commit 4aa490eb60
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -175,7 +175,7 @@ void Mode::get_pilot_desired_heading_and_speed(float &heading_out, float &speed_
}
// calculate angle of input stick vector
heading_out = wrap_360_cd(atan2f(desired_steering, desired_throttle) * DEGX100);
heading_out = wrap_360_cd(rad_to_cd(atan2f(desired_steering, desired_throttle)));
// calculate throttle using magnitude of input stick vector
const float throttle = MIN(safe_sqrt(sq(desired_throttle) + sq(desired_steering)), 1.0f);
+1 -1
View File
@@ -67,7 +67,7 @@ void ModeFollow::update()
}
// calculate vehicle heading
const float desired_yaw_cd = wrap_180_cd(atan2f(desired_velocity_ne.y, desired_velocity_ne.x) * DEGX100);
const float desired_yaw_cd = wrap_180_cd(rad_to_cd(atan2f(desired_velocity_ne.y, desired_velocity_ne.x)));
// run steering and throttle controllers
calc_steering_to_heading(desired_yaw_cd);