mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
FlightTaskTransition: use new 2D rotation
This commit is contained in:
@@ -36,7 +36,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "FlightTaskTransition.hpp"
|
#include "FlightTaskTransition.hpp"
|
||||||
#include "Sticks.hpp"
|
|
||||||
|
using namespace matrix;
|
||||||
|
|
||||||
FlightTaskTransition::FlightTaskTransition()
|
FlightTaskTransition::FlightTaskTransition()
|
||||||
{
|
{
|
||||||
@@ -50,7 +51,6 @@ FlightTaskTransition::FlightTaskTransition()
|
|||||||
|
|
||||||
bool FlightTaskTransition::updateInitialize()
|
bool FlightTaskTransition::updateInitialize()
|
||||||
{
|
{
|
||||||
|
|
||||||
updateParameters();
|
updateParameters();
|
||||||
return FlightTask::updateInitialize();
|
return FlightTask::updateInitialize();
|
||||||
}
|
}
|
||||||
@@ -110,8 +110,7 @@ bool FlightTaskTransition::update()
|
|||||||
|
|
||||||
// calculate a horizontal acceleration vector which corresponds to an attitude composed of pitch up by _param_pitch_cruise_degrees
|
// calculate a horizontal acceleration vector which corresponds to an attitude composed of pitch up by _param_pitch_cruise_degrees
|
||||||
// and zero roll angle
|
// and zero roll angle
|
||||||
matrix::Vector2f tmp(-1.0f, 0.0f);
|
const Vector2f tmp = Dcm2f(_yaw) * Vector2f(-1.0f, 0.0f);
|
||||||
Sticks::rotateIntoHeadingFrameXY(tmp, _yaw, NAN);
|
|
||||||
_acceleration_setpoint.xy() = tmp * tanf(math::radians(_param_pitch_cruise_degrees)) * CONSTANTS_ONE_G;
|
_acceleration_setpoint.xy() = tmp * tanf(math::radians(_param_pitch_cruise_degrees)) * CONSTANTS_ONE_G;
|
||||||
|
|
||||||
// slowly move vertical velocity setpoint to zero
|
// slowly move vertical velocity setpoint to zero
|
||||||
|
|||||||
Reference in New Issue
Block a user