mirror of https://github.com/ArduPilot/ardupilot
Drift: get velocity using const reference
This commit is contained in:
parent
02775e8dc5
commit
729026d80c
|
@ -56,7 +56,7 @@ static void drift_run()
|
|||
pilot_throttle_scaled = get_pilot_desired_throttle(g.rc_3.control_in);
|
||||
|
||||
// Grab inertial velocity
|
||||
Vector3f vel = inertial_nav.get_velocity();
|
||||
const Vector3f& vel = inertial_nav.get_velocity();
|
||||
|
||||
// rotate roll, pitch input from north facing to vehicle's perspective
|
||||
float roll_vel = vel.y * ahrs.cos_yaw() - vel.x * ahrs.sin_yaw(); // body roll vel
|
||||
|
|
Loading…
Reference in New Issue