mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 18:47:21 +08:00
FlightTaskTransition: use new 2D rotation
This commit is contained in:
@@ -36,7 +36,8 @@
|
||||
*/
|
||||
|
||||
#include "FlightTaskTransition.hpp"
|
||||
#include "Sticks.hpp"
|
||||
|
||||
using namespace matrix;
|
||||
|
||||
FlightTaskTransition::FlightTaskTransition()
|
||||
{
|
||||
@@ -50,7 +51,6 @@ FlightTaskTransition::FlightTaskTransition()
|
||||
|
||||
bool FlightTaskTransition::updateInitialize()
|
||||
{
|
||||
|
||||
updateParameters();
|
||||
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
|
||||
// and zero roll angle
|
||||
matrix::Vector2f tmp(-1.0f, 0.0f);
|
||||
Sticks::rotateIntoHeadingFrameXY(tmp, _yaw, NAN);
|
||||
const Vector2f tmp = Dcm2f(_yaw) * Vector2f(-1.0f, 0.0f);
|
||||
_acceleration_setpoint.xy() = tmp * tanf(math::radians(_param_pitch_cruise_degrees)) * CONSTANTS_ONE_G;
|
||||
|
||||
// slowly move vertical velocity setpoint to zero
|
||||
|
||||
Reference in New Issue
Block a user