mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 09:23:35 +08:00
FlightTask - When switching task, pass the last setpoints of the previous task to the new task
This is done to allow proper initialization of the new FlightTask and give it a chance to continue the setpoints without discontinuity. The function checkSetpoints replaces the setpoints containing NANs with an estimate of the state. The estimate is usually the current estimate of the EKF or zero. The transition FlightTask also provides an estimate of the current acceleration to properly initialize the next FlightTask after back-transition. This avoid having to initialize the accelerations to zero knowing that the actual acceleration is usually far from zero.
This commit is contained in:
committed by
Mathieu Bresciani
parent
d24c415fd7
commit
1414f50cea
+2
-8
@@ -49,7 +49,7 @@ public:
|
||||
|
||||
virtual ~FlightTaskManualPositionSmoothVel() = default;
|
||||
|
||||
bool activate() override;
|
||||
bool activate(vehicle_local_position_setpoint_s state_prev) override;
|
||||
void reActivate() override;
|
||||
|
||||
protected:
|
||||
@@ -62,13 +62,7 @@ protected:
|
||||
(ParamFloat<px4::params::MPC_ACC_DOWN_MAX>) _param_mpc_acc_down_max
|
||||
)
|
||||
private:
|
||||
|
||||
enum class Axes {XY, XYZ};
|
||||
|
||||
/**
|
||||
* Reset the required axes. when force_z_zero is set to true, the z derivatives are set to sero and not to the estimated states
|
||||
*/
|
||||
void reset(Axes axes, bool force_z_zero = false);
|
||||
void _resetPositionLock();
|
||||
void _checkEkfResetCounters(); /**< Reset the trajectories when the ekf resets velocity or position */
|
||||
|
||||
VelocitySmoothing _smoothing[3]; ///< Smoothing in x, y and z directions
|
||||
|
||||
Reference in New Issue
Block a user