mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 10:46:33 +08:00
Sticks/StickYaw: refactor to use constructor properly
This commit is contained in:
committed by
Daniel Agar
parent
0cc13f0799
commit
2edd97102b
@@ -39,10 +39,14 @@
|
|||||||
|
|
||||||
#include <px4_platform_common/defines.h>
|
#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,
|
void StickYaw::generateYawSetpoint(float &yawspeed_setpoint, float &yaw_setpoint, const float desired_yawspeed,
|
||||||
const float yaw, const float deltatime)
|
const float yaw, const float deltatime)
|
||||||
{
|
{
|
||||||
_yawspeed_slew_rate.setSlewRate(2.f * M_PI_F);
|
|
||||||
yawspeed_setpoint = _yawspeed_slew_rate.update(desired_yawspeed, deltatime);
|
yawspeed_setpoint = _yawspeed_slew_rate.update(desired_yawspeed, deltatime);
|
||||||
yaw_setpoint = updateYawLock(yaw, yawspeed_setpoint, yaw_setpoint);
|
yaw_setpoint = updateYawLock(yaw, yawspeed_setpoint, yaw_setpoint);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
class StickYaw
|
class StickYaw
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StickYaw() = default;
|
StickYaw();
|
||||||
~StickYaw() = default;
|
~StickYaw() = default;
|
||||||
|
|
||||||
void generateYawSetpoint(float &yawspeed_setpoint, float &yaw_setpoint, const float desired_yawspeed, const float yaw,
|
void generateYawSetpoint(float &yawspeed_setpoint, float &yaw_setpoint, const float desired_yawspeed, const float yaw,
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ using namespace matrix;
|
|||||||
|
|
||||||
Sticks::Sticks(ModuleParams *parent) :
|
Sticks::Sticks(ModuleParams *parent) :
|
||||||
ModuleParams(parent)
|
ModuleParams(parent)
|
||||||
{};
|
{}
|
||||||
|
|
||||||
bool Sticks::checkAndSetStickInputs()
|
bool Sticks::checkAndSetStickInputs()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user