60 Commits

Author SHA1 Message Date
Mathieu Bresciani
c5deba53a2 mc_pos_control: Explicitly convert tilt variables to radians during check and assignments 2019-06-27 11:38:21 -04:00
Matthias Grob
f30f12341f PositionControl: tiny minimal thrust length
To be able to still infer the direction of the thrust vector we
limit it to a minimal length even if MPC_THR_MIN is set to zero.

Note: This is a hotfix for certain specific applications.
The direction of the thrust vector in this corner case is very
likely to get into the tilt limit which is generally undesired.
2019-05-08 03:08:45 -05:00
bresch
ece49247b6 Parameter update - Rename variables in modules/mc_pos_control
using parameter_update.py script
2019-04-03 15:38:50 +02:00
bresch
e0c48d1d76 PositionControl - use dynamic constraints to saturate velocity controller for now as it is needed for the current smooth takeoff logic. Will be reverted after smooth takeoff refactor 2019-02-13 20:56:57 +01:00
bresch
3543071eb9 Position Controller - Saturate the controllers using static parameters. Handle saturations in the flight tasks only 2019-02-13 20:56:57 +01:00
Matthias Grob
573dd89cbf PositionControl: addess @bkueng 's comment in #11056 2019-01-26 14:53:15 +01:00
Dennis Mannhart
5887a2393c PositionControl: skip controller only if adjusted thrust setpoint are not finite
PositionControl: update comment about the order of thrust and position

mc_pos_control: reset setpoints to NAN if required

MulticopterLandDetector: consider to be landed if vehicle is not armed

mc_pos_control: initialize landing struct with landed

mc-pos-ctrl: adjust thrust-setpoint and yaw during ground-contact/maybe-landed without capturing
that information within vehicle-local-position-setpoint topic because that information
does not belong to user intention

PositionControl: set local position/velocity setpoint to NAN if not used in the control pipeline

mc-pos-ctrl: Fill vehicle_local_position_setpoint_s structure as follow:
The message contains setpoints where each type of setpoint is either the input to the PositionController
or was generated by the PositionController and therefore corresponds to the PositioControl internal states (states that were generated by P-PID).
Example:
If the desired setpoint is position-setpoint, _local_pos_sp will contain
position-, velocity- and thrust-setpoint where the velocity- and thrust-setpoint were generated by the PositionControlller.
If the desired setpoint has a velocity-setpoint only, then _local_pos_sp will contain valid velocity- and thrust-setpoint, but the position-setpoint
will remain NAN. Given that the PositionController cannot generate a position-setpoint, this type of setpoint is always equal to the input to the
PositionController.

mc_pos_control: switch to designated initializer for landed

It's less error prone because it produces an error on every discrepancy.
2019-01-08 15:36:30 +01:00
Beat Küng
c659d2bcc2 mixer: minor refactoring to reduce header include dependencies
- avoid including <px4_defines.h> from the math headers
- avoid driver include <drivers/drv_mixer.h> from the mixer
2018-12-13 09:50:07 +01:00
bresch
0863e95a2c Add "Tracking Anti-Reset Windup" in velocity PID controller 2018-11-15 22:08:00 +01:00
Dennis Mannhart
3b92d49b64 replace + with && 2018-11-05 21:54:19 +01:00
Dennis Mannhart
6a0a9c92fb PositionControl:
- set integral states and setpoint of reference state to 0
- set thrust to NAN if it will be computed from position and velocity control
2018-11-05 21:54:19 +01:00
Dennis Mannhart
1f0d559d65 PositionControl: check and set _skip_controller flag at the end of the setpoint update 2018-10-10 10:29:46 -04:00
Dennis Mannhart
2f833a26d1 mc_pos_control: check if position-control setpoint update succeeded.
refactor use_obstacle_avoidance method
2018-10-10 10:29:46 -04:00
Matthias Grob
bee6a6b8b0 Refactor: Use new matrix::Vector2f constructor 2018-10-01 08:10:21 -04:00
Daniel Agar
223dacee64 multicopter position controller use const references 2018-08-31 14:37:49 -04:00
ChristophTobler
9362f844f4 position control: fix failsafe thrust
invert direction to point upwards and increase to 70% of throttle range between min and hover
2018-07-20 09:26:18 +02:00
ChristophTobler
7cc85885a4 position control: set _skip_controller before calling _interfaceMapping()
Without this failsafe will be overwritten
2018-07-20 09:26:18 +02:00
Dennis Mannhart
a5e8eb23ad PositionControl: saturate thrust integral 2018-07-20 09:26:18 +02:00
Dennis Mannhart
5ffcb6af01 PositionControl: set vel_dot to 0 if NAN 2018-07-20 09:26:18 +02:00
Dennis Mannhart
7b13803e2c PositionControl: for thrust setpoints only use MPC_MANTHR_MIN for minimum thrust 2018-07-20 09:26:18 +02:00
Dennis Mannhart
e8620708b3 PositionControl: set states to zero if not valid 2018-07-20 09:26:18 +02:00
Dennis Mannhart
9c2ec3c229 PositionControl: add control states structure 2018-07-20 09:26:18 +02:00
Dennis Mannhart
8a3c7f9e41 PositionControl: style check 2018-07-20 09:26:18 +02:00
Dennis Mannhart
2519d97aa2 PositionControl: add failsafe 2018-07-20 09:26:18 +02:00
Dennis Mannhart
45810ec2b4 PositionControl: replace constraint structure with new constraint message structure 2018-07-20 09:26:18 +02:00
Dennis Mannhart
24e6e4041f PositionControl: format clean up 2018-07-20 09:26:18 +02:00
Dennis Mannhart
89c0259b2a PositionControl: replace overwrite with ModuleParams updateParams method 2018-07-20 09:26:18 +02:00
Dennis Mannhart
4c1fcca294 PositionControl.cpp: replace all params with ModuleParams type. Add method that overwrites
parameter values
2018-07-20 09:26:18 +02:00
Dennis Mannhart
caa773008a PositionControl: degrees to radians 2018-07-20 09:26:18 +02:00
Dennis Mannhart
4761f0a344 PositionControl: bug fix Pv replacement with Pp 2018-07-20 09:26:18 +02:00
Dennis Mannhart
c01fab089a PositionControl parameter renaming. Use the the name as stored in the metadata 2018-07-20 09:26:18 +02:00
Dennis Mannhart
cf59c2a2ac PositionControl/mc_pos_control: update comments 2018-07-20 09:26:18 +02:00
Dennis Mannhart
673945f28b PositionControl: check if constraints are below global maximum 2018-07-20 09:26:18 +02:00
Dennis Mannhart
60a9b45c88 Positioncontrol: limit velocity upwards during smooth takeoff 2018-07-20 09:26:18 +02:00
Dennis Mannhart
65a9cd171f PositionControl: variable replacement 2018-07-20 09:26:18 +02:00
Dennis Mannhart
e2ac12ef2c FlightTask: comment fixes 2018-07-20 09:26:18 +02:00
Dennis Mannhart
10bd3a50ba PositionControl: parameter subscription declaration 2018-07-20 09:26:18 +02:00
Dennis Mannhart
7f68417d19 PositionControl: make distinction for throttle minimum depending on mode 2018-07-20 09:26:18 +02:00
Dennis Mannhart
9ff4d13c2c mc_pos_control: remove unused method 2018-07-20 09:26:18 +02:00
Dennis Mannhart
75fb1b28b9 mc_pos_control: set thrust to zero if in idle 2018-07-20 09:26:18 +02:00
Dennis Mannhart
816f2d12d5 FlightTaskAuto minor clean up 2018-07-20 09:26:18 +02:00
Dennis Mannhart
3c40aa0d9c PositionControl: if valid velocity and position setpoint available, always prioritize
velocity setpoint generated from position error over velocity feedforward
2018-07-20 09:26:18 +02:00
Dennis Mannhart
558a0f892c PositionControl: auto takeoff with constant speed
PositionControl: remove takeoff logic

mc_pos_control: takeoff logic for flighttask

mc_pos_control: smooth takeoff throttle start at 0
2018-07-20 09:26:18 +02:00
Dennis Mannhart
6e62beb560 FlightTaskAuto: abstract class for mapping triplets to quadruple
FlightTaskAuto: add type that corresponds to triplet type

FligthTaskAuto: set all setpoints if invalid in xy

FlightTaskAuto: cast triplet type to WaypointType

FlightTaskAutoLine: class for px4 legacy auto

FlightTaskAutoLine: methods prototype

FlightTaskAuto: change sp to wp (=Waypoint)
add params

FlightTaskAutoLine: follow waypoints along line based on flight state
2018-07-20 09:26:18 +02:00
Beat Küng
76c94b08f1 PositionControl: use constant references instead of pass-by-value for structs 2018-06-13 16:19:34 +02:00
Dennis Mannhart
48fa3fbca3 PositionControl: thrust setpoint check with fabsf 2018-04-05 07:30:12 +02:00
Dennis Mannhart
26ffda5079 PositionControl: replace matrix length() method with simple dot-product to safe compuation 2018-04-05 07:30:12 +02:00
Dennis Mannhart
81da94ff46 PositionControl: Anti-windup that uses max in NE based on tilt limit and remaining throttle
excess
2018-04-05 07:30:12 +02:00
Matthias Grob
f99471f34c PositionControl: refactor remove Data define for Vector
This define results in super unreadable code.
2018-04-05 07:30:12 +02:00
Dennis Mannhart
88cf2aebc6 PositionControl: comment fix + unused parameter removal 2018-04-05 07:30:12 +02:00