533 Commits

Author SHA1 Message Date
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
Martina Rivizzigno
0963dc9af1 ObstacleAvoidance: fix bug in requesting update of the mission item.
During takeoff you're always in the condition within xy acceptance radius
and more than altitude radius away from the takeoff waypoint
2019-05-29 15:16:33 +02:00
Martina Rivizzigno
9e8575b71b do not overwrite with obstacle avoidance yaw setpoints if external yaw
handling is enabled
2019-05-29 15:16:33 +02:00
Martina Rivizzigno
44b8b4f79f send velocity setpoint to enable proper takeoff/land 2019-05-29 15:16:33 +02:00
Martina Rivizzigno
a18f3e5d45 reset the position lock only if current triplet latitude and longitude
are valid
2019-05-24 21:40:42 +02:00
Matthias Grob
ea48cd4970 Takeoff: address @RomanBapst's review comments 2019-05-22 22:05:38 +02:00
bresch
bb055fdaf3 AutoSmoothVel - Override checkTakeoff with task-specific logic and reactivate z axis with downward velocity to takeoff smoothly 2019-05-22 22:05:38 +02:00
Matthias Grob
7c7d980cf0 FlightTasks: fix takeoff trigger for offboard 2019-05-22 22:05:38 +02:00
Matthias Grob
e73218d665 mc_pos_control/FlightTasks: trigger takeoff based on task
The initial idea of the flight task architecture was that
a task can freely set it's setpoints and doesn't have to
worry about takeoff and landing. It would just takeoff
when it's landed and there's a setpoint to go up and
land when it puts a setpoint that pushes into the ground.
With the takeoff logic there are some significant interface
problems depending on the way a task is implemented:
From the setpoint is not high enough to trigger to
an unexpected takeoff because of some estimator
fluctuation affecting the setpoint. It's easiest to solve this
by allowing the task to determine when a takeoff is triggered.
If no condition is implemented by default a task is not
allowing a takeoff  and cannot be used to get the vehicle
off the ground.
2019-05-22 22:05:38 +02:00
bresch
feefbb444b ManualSmoothVel - Remove unused _param_mpc_jerk_min declaration 2019-05-17 14:15:29 +02:00
bresch
b726d8df0d Add jerk parameter for auto mode MPC_JERK_AUTO. Specify when a parameter is only used in a certain manual or auto mode 2019-05-17 14:15:29 +02:00
Julian Oes
9d8015d029 modules/lib: ignore address-of-packed-member
For now we need to ignore this warning which GCC 9 shows for the MAVLink
headers.
2019-05-16 13:06:25 +02:00
Matthias Grob
21194239c7 FlightTaskAuto: revisit yaw rate limit
There were multiple comments not addressed in pr #11904.
See commit 4bcb37f9bc9ef20b521ebcf33e7a0ed08fa86ccd
2019-04-26 18:58:50 +02:00
bresch
89bc68e12b Auto - Rename MC_YAWRAUTO_MAX -> MPC_YAWRAUTO_MAX 2019-04-26 12:43:26 +02:00
bresch
581d25f77f Auto mode traj - limit yaw setpoint rate of change when generated in the flight task instead of clamping the yaw rate in the controller
Move yaw setpoint slew rate from AutoLineSmoothVel to Auto. The slew rate is now applied consistently to all the auto FlightTasks
2019-04-26 12:43:26 +02:00
Martina Rivizzigno
eba0bb389a ObstacleAvoidance: fix comment, update failsafe position if one axis is NAN 2019-04-24 08:54:50 +02:00
Martina Rivizzigno
e037edd2cc ObstacleAvoidance: once the commadand loiter has been sent, keep using
the first position when the oa fails as setpoint to avoid jumps
2019-04-24 08:54:50 +02:00
baumanta
c0a1f5b72f Collision prevention improvements (#11866)
* match max vel in col-prev to regular pos ctrl
* change warning criterium to avoid float error
* disable push back from obstacles
* use floats consistently
2019-04-17 13:20:29 -04:00