33 Commits

Author SHA1 Message Date
bresch
c811cf4784 FlightTask - Move ekf reset counter monitoring logic in the base FlihtTask
Each child FlightTask can simply implement what it wants to do in case
of an EKF reset event by overriding one of the _ekfResetHandler functions
2019-09-24 10:34:08 +02:00
bresch
0153e1b126 Matrix - Explicitly cast array[3] to Vector3f
Use .xy() for Vector2 -> Vector3 assignment
2019-09-19 17:31:49 +02:00
bresch
f5d7eb4d87 Refactor FlightTaskManualPositionSmoothVel 2019-09-19 17:31:49 +02:00
bresch
080eedfd02 ManualPositionSmoothVel - Split large function into smaller ones, split XY and Z axes
Next step is to move as much as possible to a library in order to
reuse the Z axis in the Altitude FlightTask
2019-09-19 17:31:49 +02:00
bresch
8cc2a7018e VelocitySmoothing - Re-enable time stretch, integrate dt to get local time.
Also split a few functions into smaller ones for readability, fix
formatting, use geters to get the current state of the trajectory
instead of return arguments.
2019-09-17 09:27:00 +02:00
bresch
a03cc495ce VelocitySmoothing - Refactor class to use polynomial evaluation instead of numerical integration
This solves many numerical issues when the trajectory is close to the
primary NE axes (small velocities). It is also more robust when dt is
large and has some jitter.
2019-09-17 09:27:00 +02:00
bresch
f4b40865af SmoothVel - Fix altitude lock logic.
It was broken because _velocity_setpoint is used for input and output
and was assumed to be the input at a place where it was already overwitten
To clarify this, the input setpoint is renamed "target"
2019-08-22 16:43:41 +02:00
baumanta
d168d5049f check vel_setpoint instead of stick input for position lock 2019-08-21 10:02:40 +02:00
bresch
ea0e164145 FlightTask - Rename state_prev to last_setpoint 2019-07-16 13:09:09 +02:00
bresch
37a9b90945 FlightTask - Move checkSetpoints function in each FlightTask to be tailored to the specific needs and avoid checking all the setpoints 2019-07-16 13:09:09 +02:00
bresch
24811cf550 FlightTask smoothVel - Initialize ekf reset counters when task is activated 2019-07-16 13:09:09 +02:00
bresch
1414f50cea 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.
2019-07-16 13:09:09 +02:00
bresch
b14446f0e5 Parameter update - Rename variables in lib
using paramter_update.py script
2019-04-03 15:38:50 +02:00
bresch
a08b1682e3 [Position|AutoLine]SmoothVel - Update position and velocity states of the trajectories in case of EKF reset. Until now, only the position reset on XY axis was properly handled. Now, xy, vxy, z and vz are handled 2019-03-20 14:35:26 -04:00
bresch
aecf8fce58 ManualPositionSmoothVel - Force velocity and acceleration setpoints to zero if the velocity setpoint is smaller than 1mm/s and that the acceleration setpoint is null 2019-03-18 08:33:11 +01:00
bresch
1fefa76e5d ManualSmoothVel - Set jerk to 1.0 during position hold to help the optimizer to converge towards 0 vel and acc 2019-03-18 08:33:11 +01:00
bresch
f229444722 ManualSmoothVel - Split position lock condition and flag action 2019-02-25 21:41:04 +01:00
bresch
8f584a1496 smooth takeoff - Support smooth takeoff triggered by jerk setpoint 2019-02-25 08:07:33 +01:00
bresch
70ddb8049a Traj Smoothing - make format 2019-02-13 20:56:57 +01:00
bresch
4cace1bbe9 Manual vel smooth - use speed_up and speed_down constraints to limit velocity target of the trajectory generator 2019-02-13 20:56:57 +01:00
bresch
b7c2464cce Manual vel smooth - Use MPC_JERK_MAX only 2019-02-13 20:56:57 +01:00
bresch
f1262cbe84 Manual Traj - Avoid velocity jumps due to a modification of the constraints 2019-02-13 20:56:57 +01:00
bresch
57eef6b170 Manual Trajectory - Add Z position lock logic and log complete trajectory 2019-02-13 20:56:57 +01:00
bresch
a2d5485c7f Trajectory manual - Handle EKF xy reset 2019-01-22 17:23:16 +01:00
bresch
90cee2d5ea Manual Smoth Vel - Override reActivate to not reset Z axis (prevented takeoff) 2018-11-06 22:17:00 +01:00
bresch
67c0846068 Vel smooth - Improve position lock/unlock detection 2018-11-06 22:17:00 +01:00
bresch
d9edcfdc06 Trajectory - format style 2018-11-06 22:17:00 +01:00
bresch
6a7ce651bc Trajectory - Add position lock-unlock logic and proper initialization from controller feedback 2018-11-06 22:17:00 +01:00
bresch
84665672ad Vel smooth - Change jerk scheduling strategy 2018-11-06 22:17:00 +01:00
bresch
ab7e4436b3 Vel smooth - Add Z trajectory 2018-11-06 22:17:00 +01:00
Beat Küng
787d82c9e6 VelocitySmoothing: simplify the API & fix style 2018-11-06 22:17:00 +01:00
bresch
22780efcd0 Trajectory - Add time synchronization between trajectories. Split update(...) function into updateDurations(...) and integrate(...) to be able to insert time synchronization in between. 2018-11-06 22:17:00 +01:00
Beat Küng
86463e4ec7 Flight Tasks: add new trajectory smoothing flight task & library
Derivation by Mathieu Bresciani:
https://github.com/Auterion/trajectory_generator
2018-11-06 22:17:00 +01:00