Skip to content

Commit

Permalink
FlightTaskTransition: use new 2D rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
MaEtUgR committed Apr 15, 2023
1 parent 7ebd6cc commit 5c1e0dd
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
*/

#include "FlightTaskTransition.hpp"
#include "Sticks.hpp"

using namespace matrix;

FlightTaskTransition::FlightTaskTransition()
{
Expand All @@ -50,7 +51,6 @@ FlightTaskTransition::FlightTaskTransition()

bool FlightTaskTransition::updateInitialize()
{

updateParameters();
return FlightTask::updateInitialize();
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5c1e0dd

Please sign in to comment.