mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 01:53:34 +08:00
FlightTaskManualSmoothing: change name of method
This commit is contained in:
committed by
Beat Küng
parent
01073d36e5
commit
f2f5f41641
@@ -123,8 +123,8 @@ ManualSmoothingXY::_getIntention(const matrix::Vector2f &vel_sp, const matrix::V
|
|||||||
* that the user demanded a direction change.
|
* that the user demanded a direction change.
|
||||||
* The detection is done in body frame. */
|
* The detection is done in body frame. */
|
||||||
/* Rotate velocity setpoint into body frame */
|
/* Rotate velocity setpoint into body frame */
|
||||||
matrix::Vector2f vel_sp_heading = _getInHeadingFrame(vel_sp, yaw);
|
matrix::Vector2f vel_sp_heading = _getWorldToHeadingFrame(vel_sp, yaw);
|
||||||
matrix::Vector2f vel_heading = _getInHeadingFrame(vel, yaw);
|
matrix::Vector2f vel_heading = _getWorldToHeadingFrame(vel, yaw);
|
||||||
|
|
||||||
if (vel_sp_heading.length() > FLT_EPSILON) {
|
if (vel_sp_heading.length() > FLT_EPSILON) {
|
||||||
vel_sp_heading.normalize();
|
vel_sp_heading.normalize();
|
||||||
@@ -250,7 +250,7 @@ ManualSmoothingXY::_velocitySlewRate(matrix::Vector2f &vel_sp, const float dt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
matrix::Vector2f
|
matrix::Vector2f
|
||||||
ManualSmoothingXY::_getInHeadingFrame(const matrix::Vector2f &vec, const float &yaw)
|
ManualSmoothingXY::_getWorldToHeadingFrame(const matrix::Vector2f &vec, const float &yaw)
|
||||||
{
|
{
|
||||||
|
|
||||||
matrix::Quatf q_yaw = matrix::AxisAnglef(matrix::Vector3f(0.0f, 0.0f, 1.0f), yaw);
|
matrix::Quatf q_yaw = matrix::AxisAnglef(matrix::Vector3f(0.0f, 0.0f, 1.0f), yaw);
|
||||||
@@ -259,10 +259,10 @@ ManualSmoothingXY::_getInHeadingFrame(const matrix::Vector2f &vec, const float &
|
|||||||
}
|
}
|
||||||
|
|
||||||
matrix::Vector2f
|
matrix::Vector2f
|
||||||
ManualSmoothingXY::_getInWorldFrame(const matrix::Vector2f &vec, const float &yaw)
|
ManualSmoothingXY::_getHeadingToWorldFrame(const matrix::Vector2f &vec, const float &yaw)
|
||||||
{
|
{
|
||||||
|
|
||||||
matrix::Quatf q_yaw = matrix::AxisAnglef(matrix::Vector3f(0.0f, 0.0f, 1.0f), yaw);
|
matrix::Quatf q_yaw = matrix::AxisAnglef(matrix::Vector3f(0.0f, 0.0f, 1.0f), yaw);
|
||||||
matrix::Vector3f vec_heading = q_yaw.conjugate(matrix::Vector3f(vec(0), vec(1), 0.0f));
|
matrix::Vector3f vec_world = q_yaw.conjugate(matrix::Vector3f(vec(0), vec(1), 0.0f));
|
||||||
return matrix::Vector2f(&vec_heading(0));
|
return matrix::Vector2f(&vec_world(0));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ private:
|
|||||||
void _getStateAcceleration(const matrix::Vector2f &vel_sp, const matrix::Vector2f &vel, const Intention &intention,
|
void _getStateAcceleration(const matrix::Vector2f &vel_sp, const matrix::Vector2f &vel, const Intention &intention,
|
||||||
const float dt);
|
const float dt);
|
||||||
void _velocitySlewRate(matrix::Vector2f &vel_sp, const float dt);
|
void _velocitySlewRate(matrix::Vector2f &vel_sp, const float dt);
|
||||||
matrix::Vector2f _getInHeadingFrame(const matrix::Vector2f &vec, const float &yaw) ;
|
matrix::Vector2f _getWorldToHeadingFrame(const matrix::Vector2f &vec, const float &yaw) ;
|
||||||
matrix::Vector2f _getInWorldFrame(const matrix::Vector2f &vec, const float &yaw);
|
matrix::Vector2f _getHeadingToWorldFrame(const matrix::Vector2f &vec, const float &yaw);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user