49 Commits

Author SHA1 Message Date
Martina Rivizzigno
39e59d6cc4 add point type (mavlink command associated with wp) in Obstacle Avoidance interface 2019-08-05 16:05:40 +02:00
bresch
ea0e164145 FlightTask - Rename state_prev to last_setpoint 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
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
Jacob Dahl
59c555aec3 Multicopter Auto: Adjustable land speed via RC (#12220) 2019-07-08 23:55:21 -04:00
Timothy Scott
a134da6e12 Removed is_rotor_wing, replaced with vehicle_type 2019-06-13 10:04:26 +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
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
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
Matthias Grob
1454694bdd FlightTaskAuto: separate default speed and limit
It wasn't possible to fly faster than cruise speed even if planned
in the mission.

Limiting the planned cruise speed is necessary because
the smoothed trajectory mission plans to the _mc_cruise_speed and
if that's higher than the maximum it gets capped for safety by the
position controller and the result is a jerky flight.
2019-04-12 15:47:36 +02:00
Martina Rivizzigno
4dcc77b822 ObstacleAvoidance: remove printf and remove unnecessary new lines 2019-04-04 16:41:26 +02:00
Martina Rivizzigno
c1258931da rename updateAvoidanceWaypoints->updateAvoidanceDesiredWaypoints and
updateAvoidanceSetpoints->updateAvoidanceDesiredSetpoints
2019-04-04 16:41:26 +02:00
Martina Rivizzigno
b165c41737 ObstacleAvoidance: add comments 2019-04-04 16:41:26 +02:00
Martina Rivizzigno
34b0f33098 move all obstacle avoidance interfaces to the ObstacleAvoidance library 2019-04-04 16:41:26 +02:00
Martina Rivizzigno
320ed40806 use subscription array in ObstacleAvoidance library 2019-04-04 16:41:26 +02:00
bresch
b14446f0e5 Parameter update - Rename variables in lib
using paramter_update.py script
2019-04-03 15:38:50 +02:00
bresch
c5706f6283 FlightTaskAuto - Recover position control after local position reset (#11636)
* FlightTaskAuto - Explicitly check is _triplet_target is finite to decide if the target has to be updated or not. If the _target is NAN, always try to update it to get a valid setpoint.
2019-03-15 00:42:24 -04:00
baumanta
d42b9205f9 Rename parameter MPC_OBS_AVOID to COM_OBS_AVOID and change the location to commander. 2019-03-12 11:24:33 +01:00
Simone Guscetti
be7416c823 FlightTask Auto: Adapt to new message and rename variable 2018-12-10 16:17:23 +01:00
Simone Guscetti
66f85ff9ae FlightTask Auto: Save deploy gear information 2018-12-10 16:17:23 +01:00
Matthias Grob
94d4f0391a FlightTaskAuto: fix newline at end of file 2018-11-30 09:30:00 -05:00
Dennis Mannhart
c97b2a3071 FlightTaskAuto: move method getVelocityFromAngle to FlightTaskAutoLine 2018-11-30 09:30:00 -05:00
Martina
280cb34a77 FlightTaskAuto: replace NAV_ACC_RAD with acceptance radius from triplet 2018-10-09 12:01:45 -04:00
Beat Küng
206baa7432 Flight tasks: avoid using *= for scalar to vector assignment
It's confusing and there is a corner case where the result is incorrect:
*= 0 will not set the variable to 0 if it's already NAN.
2018-10-04 15:09:02 +02:00
Beat Küng
bb756e0e12 FlightTaskAuto: remove unnecessary brackets in switch case statements 2018-10-04 15:09:02 +02:00
Matthias Grob
bee6a6b8b0 Refactor: Use new matrix::Vector2f constructor 2018-10-01 08:10:21 -04:00
Martina
5b8ae9fb29 rename position_controller_status field from altitude_acceptance_radius
to altitude_acceptance
2018-09-24 11:23:01 +02:00
Martina
40650ee2c7 FlightTaskAuto: check avoidance progress only for multicopter 2018-09-24 11:23:01 +02:00
Martina
07eb0b697e FlightTaskAuto: don't create vectors from pointers 2018-09-24 11:23:01 +02:00
Martina
ba4e633bd4 FlightTaskAuto: check avoidance progress only if avoidance is active 2018-09-24 11:23:01 +02:00
Martina
cef7673969 FlightTaskAuto: calculate the new altitude acceptance radius if the vehicle
is inside the xy acceptance radius but not inside the z acceptance radius
2018-09-24 11:23:01 +02:00
Martina
a5a204004b FlightTaskAuto: add check for xy mission progress 2018-09-24 11:23:01 +02:00
Roman
d6b6a1d0b3 addressed comments from review
Signed-off-by: Roman <bapstroman@gmail.com>
2018-09-19 08:27:07 +02:00
Daniel Agar
d11c6af923 FlightTaskAuto don't pass position setpoint by value 2018-08-30 19:04:13 +02:00
Dennis Mannhart
16ca0be4e5 FlightTaskAuto: set reference to 0 if auto is requested but no global position available 2018-08-30 09:44:54 +02:00
Dennis Mannhart
a24fdb93c3 FlightTaskManual: increase rc timeout to 1.5 x COM_RC_LOSS_T 2018-08-30 09:27:48 +02:00
Dennis Mannhart
1f1c9fde01 FlightTaskAuto: lock yaw once within acceptance radius 2018-08-30 09:27:48 +02:00
Daniel Agar
acff200f0d FlightTasks safer matrix usage 2018-08-27 16:33:38 -04:00
Dennis Mannhart
9a23295a40 heading update: do not update heading within NAV_ACC_RAD 2018-08-10 15:52:10 +02:00
Martina
2d9bbeb7ed FlightTaskAuto: use the triplets from navigator and not with the internal
ones for obstacle avoidance. Otherwise the vehicle is continuolsy in the
offtrack state. Use already comnputed yaw and yaw speed setpoints instead
of subscription
2018-08-09 16:38:47 -04:00
Martina
aef41a1378 remove empty lines 2018-08-09 16:38:47 -04:00
Martina
17a08a9de7 FlightTaskAuto: add update method to get triplets for the trajectory
interface
2018-08-09 16:38:47 -04:00
ChristophTobler
b68fd5e0a7 Flight Tasks: CMake/folder restructure (no code change)
put flight tasks in separate folder and create a lib for each
goal is to select tasks for targets (e.g. because of flash issue)
2018-08-08 13:44:49 +02:00