mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 17:31:36 +08:00
flight tasks: refactor BlockParam -> Param and handle param updates
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
class FlightTaskManual : public FlightTask
|
||||
{
|
||||
public:
|
||||
FlightTaskManual(control::SuperBlock *parent, const char *name);
|
||||
FlightTaskManual() = default;
|
||||
|
||||
virtual ~FlightTaskManual() = default;
|
||||
|
||||
@@ -61,14 +61,19 @@ protected:
|
||||
bool _sticks_data_required = true; /**< let inherited task-class define if it depends on stick data */
|
||||
matrix::Vector<float, 4> _sticks; /**< unmodified manual stick inputs */
|
||||
matrix::Vector3f _sticks_expo; /**< modified manual sticks using expo function*/
|
||||
control::BlockParamFloat _stick_dz; /**< 0-deadzone around the center for the sticks */
|
||||
|
||||
float stickDeadzone() const { return _stick_dz.get(); }
|
||||
private:
|
||||
|
||||
bool _evaluateSticks(); /**< checks and sets stick inputs */
|
||||
|
||||
uORB::Subscription<manual_control_setpoint_s> *_sub_manual_control_setpoint{nullptr};
|
||||
|
||||
control::BlockParamFloat _xy_vel_man_expo; /**< ratio of exponential curve for stick input in xy direction */
|
||||
control::BlockParamFloat _z_vel_man_expo; /**< ratio of exponential curve for stick input in z direction */
|
||||
|
||||
bool _evaluateSticks(); /**< checks and sets stick inputs */
|
||||
DEFINE_PARAMETERS_CUSTOM_PARENT(FlightTask,
|
||||
(ParamFloat<px4::params::MPC_HOLD_DZ>) _stick_dz, /**< 0-deadzone around the center for the sticks */
|
||||
(ParamFloat<px4::params::MPC_XY_MAN_EXPO>)
|
||||
_xy_vel_man_expo, /**< ratio of exponential curve for stick input in xy direction */
|
||||
(ParamFloat<px4::params::MPC_Z_MAN_EXPO>)
|
||||
_z_vel_man_expo /**< ratio of exponential curve for stick input in z direction */
|
||||
)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user