mirror of https://github.com/ArduPilot/ardupilot
AC_Circle: use fast_atan2 to calc bearing from center
This does not save much time because it's only called at initialisation
This commit is contained in:
parent
f23e94707c
commit
915dad2da4
|
@ -248,7 +248,7 @@ void AC_Circle::init_start_angle(bool use_heading)
|
|||
_angle = wrap_PI(_ahrs.yaw-PI);
|
||||
} else {
|
||||
// get bearing from circle center to vehicle in radians
|
||||
float bearing_rad = ToRad(90) + atan2f(-(curr_pos.x-_center.x), curr_pos.y-_center.y);
|
||||
float bearing_rad = ToRad(90) + fast_atan2(-(curr_pos.x-_center.x), curr_pos.y-_center.y);
|
||||
_angle = wrap_PI(bearing_rad);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue