mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 18:37:35 +08:00
ControlMath: by value to reference
This commit is contained in:
committed by
Lorenz Meier
parent
3c40aa0d9c
commit
ae0f02f67d
@@ -132,7 +132,7 @@ vehicle_attitude_setpoint_s thrustToAttitude(const matrix::Vector3f &thr_sp, con
|
||||
* constraint: ||vf|| <= 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) {
|
||||
|
||||
@@ -47,5 +47,5 @@
|
||||
namespace ControlMath
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user