Skip to content

Commit

Permalink
Sticks/StickYaw: refactor to use constructor properly
Browse files Browse the repository at this point in the history
  • Loading branch information
MaEtUgR authored and dagar committed Oct 5, 2021
1 parent 0cc13f0 commit 2edd971
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/modules/flight_mode_manager/tasks/Utility/StickYaw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@

#include <px4_platform_common/defines.h>

StickYaw::StickYaw()
{
_yawspeed_slew_rate.setSlewRate(2.f * M_PI_F);
}

void StickYaw::generateYawSetpoint(float &yawspeed_setpoint, float &yaw_setpoint, const float desired_yawspeed,
const float yaw, const float deltatime)
{
_yawspeed_slew_rate.setSlewRate(2.f * M_PI_F);
yawspeed_setpoint = _yawspeed_slew_rate.update(desired_yawspeed, deltatime);
yaw_setpoint = updateYawLock(yaw, yawspeed_setpoint, yaw_setpoint);
}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/flight_mode_manager/tasks/Utility/StickYaw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
class StickYaw
{
public:
StickYaw() = default;
StickYaw();
~StickYaw() = default;

void generateYawSetpoint(float &yawspeed_setpoint, float &yaw_setpoint, const float desired_yawspeed, const float yaw,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/flight_mode_manager/tasks/Utility/Sticks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ using namespace matrix;

Sticks::Sticks(ModuleParams *parent) :
ModuleParams(parent)
{};
{}

bool Sticks::checkAndSetStickInputs()
{
Expand Down

0 comments on commit 2edd971

Please sign in to comment.