ControlMath: by value to reference

This commit is contained in:
Dennis Mannhart
2018-07-20 09:26:18 +02:00
committed by Lorenz Meier
parent 3c40aa0d9c
commit ae0f02f67d
2 changed files with 2 additions and 2 deletions
@@ -132,7 +132,7 @@ vehicle_attitude_setpoint_s thrustToAttitude(const matrix::Vector3f &thr_sp, con
* constraint: ||vf|| <= max * constraint: ||vf|| <= max
* solve for s: ||vf|| = ||v0 + s * u1|| <= max * solve for s: ||vf|| = ||v0 + s * u1|| <= max
*/ */
matrix::Vector2f constrainXY(const matrix::Vector2f &v0, const matrix::Vector2f v1, const float max) matrix::Vector2f constrainXY(const matrix::Vector2f &v0, const matrix::Vector2f &v1, const float max)
{ {
if (matrix::Vector2f(v0 + v1).norm() <= max) { if (matrix::Vector2f(v0 + v1).norm() <= max) {
@@ -47,5 +47,5 @@
namespace ControlMath namespace ControlMath
{ {
vehicle_attitude_setpoint_s thrustToAttitude(const matrix::Vector3f &thr_sp, const float yaw_sp); vehicle_attitude_setpoint_s thrustToAttitude(const matrix::Vector3f &thr_sp, const float yaw_sp);
matrix::Vector2f constrainXY(const matrix::Vector2f &v0, const matrix::Vector2f v1, const float max); matrix::Vector2f constrainXY(const matrix::Vector2f &v0, const matrix::Vector2f &v1, const float max);
} }