ManualSmoothingXY: ensure that maximum speed is correctly propagated to the smoothing class

This commit is contained in:
Dennis Mannhart
2018-07-20 09:26:18 +02:00
committed by Lorenz Meier
parent 9df337e243
commit 5ef2a61be5
3 changed files with 19 additions and 4 deletions
@@ -48,6 +48,15 @@ public:
ManualSmoothingXY(ModuleParams *parent, const matrix::Vector2f &vel);
~ManualSmoothingXY() = default;
/**
* Maximum velocity is required to detect user intention.
* Maximum velocity changes depending on task. Consequently,
* in order to deduce user intention from velocity, the maximum
* allowed velocity has to updated.
* @param vel_max corresponds to vehicle constraint
*/
void updateMaxVelocity(const float &vel_max) {_vel_max = vel_max;};
/**
* Smoothing of velocity setpoint horizontally based
* on flight direction.
@@ -97,6 +106,12 @@ private:
float _acc_state_dependent{0.0f};
float _jerk_state_dependent{0.0f};
/**
* Maximum velocity.
* It is used to deduce user intention.
*/
float _vel_max{0.0f};
/* Previous setpoints */
matrix::Vector2f _vel_sp_prev{}; // previous velocity setpoint
@@ -108,5 +123,4 @@ private:
(ParamFloat<px4::params::MPC_JERK_MAX>) _jerk_max, ///< jerk max during brake
(ParamFloat<px4::params::MPC_VEL_MANUAL>) _vel_manual ///< maximum velocity in manual controlled mode
)
};