flight tasks: refactor BlockParam -> Param and handle param updates

This commit is contained in:
Beat Küng
2018-04-11 07:47:06 +02:00
parent 2e620cf1d4
commit 0eaa6222a2
19 changed files with 89 additions and 86 deletions
@@ -45,16 +45,22 @@
class FlightTaskManualPosition : public FlightTaskManualAltitude
{
public:
FlightTaskManualPosition(control::SuperBlock *parent, const char *name);
FlightTaskManualPosition() = default;
virtual ~FlightTaskManualPosition() = default;
protected:
control::BlockParamFloat _vel_xy_manual_max; /**< maximum speed allowed horizontally */
control::BlockParamFloat _acc_xy_max;/**< maximum acceleration horizontally. Only used to compute lock time */
control::BlockParamFloat _vel_hold_thr_xy; /**< velocity threshold to switch back into horizontal position hold */
void _updateXYlock(); /**< applies positon lock based on stick and velocity */
void _updateSetpoints() override;
void _scaleSticks() override;
DEFINE_PARAMETERS_CUSTOM_PARENT(FlightTaskManualAltitude,
(ParamFloat<px4::params::MPC_VEL_MANUAL>) _vel_xy_manual_max, /**< maximum speed allowed horizontally */
(ParamFloat<px4::params::MPC_ACC_HOR_MAX>)
_acc_xy_max, /**< maximum acceleration horizontally. Only used to compute lock time */
(ParamFloat<px4::params::MPC_HOLD_MAX_XY>)
_vel_hold_thr_xy /**< velocity threshold to switch back into horizontal position hold */
)
private:
};