Skip to content
Snippets Groups Projects
Commit a2d5485c authored by bresch's avatar bresch
Browse files

Trajectory manual - Handle EKF xy reset

parent e1472818
No related branches found
No related tags found
No related merge requests found
......@@ -147,6 +147,16 @@ void FlightTaskManualPositionSmoothVel::_updateSetpoints()
VelocitySmoothing::timeSynchronization(_smoothing, 2); // Synchronize x and y only
if (_position_lock_xy_active) {
// Check if a reset event has happened.
if (_sub_vehicle_local_position->get().xy_reset_counter != _reset_counter) {
// Reset the XY axes
_smoothing[0].setCurrentPosition(_position(0));
_smoothing[1].setCurrentPosition(_position(1));
_reset_counter = _sub_vehicle_local_position->get().xy_reset_counter;
}
}
Vector3f pos_sp_smooth;
Vector3f accel_sp_smooth;
......
......@@ -70,4 +70,5 @@ private:
matrix::Vector3f _vel_sp_smooth;
bool _position_lock_xy_active{false};
matrix::Vector2f _position_setpoint_xy_locked;
uint8_t _reset_counter{0}; /**< counter for estimator resets in xy-direction */
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment