Commit Graph

550 Commits

Author SHA1 Message Date
Matthias Grob 7774b150a9 FlightTaskOrbit: only reapproach circle if center changed
The condition that the vehicle is more than 3m away from the circle line
was too sloppy. That often happens when the radius is changed by sticks.
A reapproach is only necessary when the center is moved and that's only
possible through the orbit command.
2019-08-31 14:25:39 +02:00
Matthias Grob cca7596bcd FlightTaskOrbit: use StraightLine library to approach circle
The initial approach to the circle to orbit on was very agressive since
it was just the controller trying to stay on the circle reaching the
limits. Now there's first an approach phase in which the vehicle reaches
the circle trajeectory in a smooth perpendicular line before starting the
orbit execution.
2019-08-31 14:25:39 +02:00
Matthias Grob 345ad06d7e StraightLine: rewrite old implementation
Before it was:
- not used anywhere
- copied from an old mission implementation version
- didn't plan in advance
- had a lot of broken cases
- dependent on a lot of parameters

I'm starting with a new relatively simple implementation that works as
expected for a minimum viable implementation and can be improved over time.
The first version is used to approach the circle path in Orbit mode to
verify the interface and get testing such that it gets eventually used
everywhere.
2019-08-31 14:25:39 +02:00
bresch fe73cef224 TestVelocitySmoothing - Split time synchronization and final state checks into two different test functions
Also improve the comments
2019-08-29 15:20:53 +02:00
bresch 94d15931f2 TestVelocitySmoothing - Remove useless function override, use ceil instead of ceilf and remove line duplicate 2019-08-29 15:20:53 +02:00
bresch 5b82fa3a0f TestVelocitySmoothing - add check for time synchronization and final acceleration 2019-08-29 15:20:53 +02:00
bresch f40d571858 VelocitySmoothing - add zero setpoint test 2019-08-29 15:20:53 +02:00
bresch c59bcc686c VelocitySmothing - Add gtest script 2019-08-29 15:20:53 +02:00
roangel 1e510f5a44 [FlightTasks] Added class enum for FlightTasks errors (#12822) 2019-08-29 14:48:52 +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
Silvan Fuhrer ab28f1e4f7 Navigator: VTOL: disable weather vane during yaw aligning before front transition
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2019-08-21 10:08:04 +02:00
baumanta af0d63250c check velocity_setpoint instead of sticks in altitude mode 2019-08-21 10:02:40 +02:00
baumanta d168d5049f check vel_setpoint instead of stick input for position lock 2019-08-21 10:02:40 +02:00
bresch 4eb9c7d812 Create TrajMath library and move waypoint speed calculations in it 2019-08-09 12:04:48 +02:00
bresch b1698b78bc AutoSmoothVel - scale down acc_hor using traj_p parameter in the computation of the maximum waypoint entrance speed 2019-08-09 12:04:48 +02:00
bresch de10f1e04d MC auto - Modify yaw_sp_aligned to take mis_yaw_error tolerance.
Add check for this flag in AutoLine
2019-08-09 12:04:48 +02:00
Dennis Mannhart 9e9b2ab9e8 FlightTaskAutoLine/SmoothVel: stop at waypoint if altitude is has not been reached yet 2019-08-09 12:04:48 +02:00
bresch 255c911155 AutoSmoothVel - Compute desired speed at target based on angle between previous-current and current-next waypoints
Also remove crosstrack P controller that produces overshoots when the
acceptance radius is large (crosstrack error is suddenly large at
waypoint switch).
2019-08-09 12:04:48 +02:00
bresch 50fbb56737 Yaw mode 3 - Add check for minimum distance to target in MPC_YAW_MODE 3 (along trajectory) to be consistent with the other yaw modes 2019-08-07 10:30:34 +02:00
Martina Rivizzigno 19ad80385e ObstacleAvoidance: update empty_trajectory_waypoint 2019-08-05 16:05:40 +02:00
Martina Rivizzigno d29f2ff60c ObstacleAvoidance: use hysteresis on z to check progress towards the goal 2019-08-05 16:05:40 +02:00
Martina Rivizzigno 39e59d6cc4 add point type (mavlink command associated with wp) in Obstacle Avoidance interface 2019-08-05 16:05:40 +02:00
Daniel Agar e69398c09f introduce uORB::PublicationQueued and transition most orb_advertise_queue usage 2019-08-04 10:08:09 -04: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 e5128ac7b9 Cosmetic - Use c++ list initialization 2019-07-11 17:46:44 +02:00
bresch 15ec73629b MPC auto - Add MPC_YAW_MODE: towards waypoint (yaw first) mode. This mode ensures that
the vehicle yaws towards the next waypoint before accelerating. This is
required for drones with front vision and aerodynamic multicopters such
as standard vtol planes or highspeed multirotors.
2019-07-11 17:46:44 +02:00
bresch 6df1600357 Auto - Update velocity setpoint generator to avoid overshoot at high cruise speed.
The linear mapping from position error to cruise velocity is changed by
a combination of that linear mapping and a nonlinear function containing
the maximum acceleration and jerk to avoid overshoots at waypoints due to
overoptimistic breaking distance.
2019-07-09 09:46:45 +02:00
Jacob Dahl 59c555aec3 Multicopter Auto: Adjustable land speed via RC (#12220) 2019-07-08 23:55:21 -04:00
Timothy Scott dce1dda871 Fixed incorrect timestamps 2019-07-03 14:39:59 +02:00
Angel 46662072d1 Missed conversion to radians in AutoMapper and AutoMapper2 2019-06-25 14:01:35 +02:00
bresch 83d90410ff Jerk-limited auto mode - use MPC_ACC_HOR instead of MPC_ACC_HOR_MAX
as written in the parameter desctiption
2019-06-14 09:56:56 +02:00
Timothy Scott a134da6e12 Removed is_rotor_wing, replaced with vehicle_type 2019-06-13 10:04:26 +02:00
Martina Rivizzigno 7a586d2b60 ObstacleAvoidance: hysteresis on failsafe 2019-06-12 16:42:02 +02:00
Daniel Agar 32a89a1834 rename empy templates (*.template) to proper file extension (.em) 2019-06-10 10:42:00 -07:00
Daniel Agar 90bf26b239 CollisionPrevention move orb subscriptions to uORB::Subscription 2019-06-07 09:22:35 -04:00
baumanta 2320088541 use position controller parameters for limitation instead of acceleration/jerk 2019-06-04 16:47:33 +02:00
baumanta 09e1d4888c use velocity component in bin direction instead of norm 2019-06-04 16:47:33 +02:00
baumanta e7d17cc265 consider acceleration ramp-up time 2019-06-04 16:47:33 +02:00
baumanta 60befdce5b change collision prevention algorithm 2019-06-04 16:47:33 +02:00
baumanta 8427cd3051 constant acceleration breaking for collision prevention 2019-06-04 16:47:33 +02:00
Daniel Agar 2c63e335e9 uORB::Subscription subscribe directly to uORB device node object 2019-06-03 17:06:21 -04:00
bresch d13dfdcd24 AutoLineSmoothVel - Remove duplicate of _yaw_sp_prev update. This is done in the Auto FlightTask, _limit_yaw_rate 2019-05-30 11:14:44 +02:00
bresch a7cf981c8c AutoLineSmoothVel - Reduce jerk if acceleration, velocity and desired velocity are small to help the optimizer to converge towards zero 2019-05-30 11:14:44 +02:00
bresch 3499b6ff89 AutoLineSmoothVel - Do not generate heading from trajectory if the velocity vector is smaller than 10cm/s
This is done to avoid generating large yaw changes when the velocity
vector is small; for example when switching into loiter or reaching the
last waypoint.
2019-05-30 11:14:44 +02:00
Martina Rivizzigno 119ccc4256 ObstacleAvoidance: fix comment 2019-05-29 15:16:33 +02:00
Martina Rivizzigno 61f69ed139 ObstacleAvoidance: use convention for paramter name 2019-05-29 15:16:33 +02:00
Martina Rivizzigno 1e8582974c do not update desired setpoints and waypoints if the oa is disabled 2019-05-29 15:16:33 +02:00