Browse Source

ControlMath: by value to reference

sbg
Dennis Mannhart 7 years ago committed by Lorenz Meier
parent
commit
ae0f02f67d
  1. 2
      src/modules/mc_pos_control/Utility/ControlMath.cpp
  2. 2
      src/modules/mc_pos_control/Utility/ControlMath.hpp

2
src/modules/mc_pos_control/Utility/ControlMath.cpp

@ -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) {

2
src/modules/mc_pos_control/Utility/ControlMath.hpp

@ -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);
} }

Loading…
Cancel
Save