mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
Rover: Create DEGX100 to rad_to_cd
This commit is contained in:
committed by
Randy Mackay
parent
3e4dafd4a2
commit
4aa490eb60
+1
-1
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user