58 Commits

Author SHA1 Message Date
Matthias Grob
8ca28f3796 Separate message for trajectory setpoint 2022-05-12 17:19:48 +02:00
Matthias Grob
843c814fb8 MulticopterPositionControl: allow offboard takeoff also when not landed 2022-05-06 04:12:18 -07:00
Matthias Grob
1211a457d7 MulticopterPositionControl: Overwrite vertical acceleration during takeoff rampup only 2022-05-06 04:12:18 -07:00
Matthias Grob
d9a2fe5226 Revert "MCPosControl: fix invalid setpoint race condition"
This reverts commit e7a2c1d88e1bad6c07805aa52c7500d18dbe84d8.
2022-05-06 04:12:18 -07:00
Matthias Grob
46fdc28cf8 MulticopterPositionControl: fix typo "descen{d/t}" 2022-05-04 02:22:18 -07:00
Daniel Agar
7f1bb556e9 Update src/modules/mc_pos_control/MulticopterPositionControl.cpp
Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2022-05-04 02:22:18 -07:00
Matthias Grob
3fb4889ab9 MultcopterPositionControl: fix executing a zero setpoint for 200ms
This is a combination of the originally introduced delay:
06c10f61c1401d448979c65c2250afde42b99522
then the emergency failsafe being changed to not just land,
position control being rescheduled to not overwrite every setpoint in:
e502214429576ce68ac3fee9d2db19112f4604b9
and it being fixed by overwriting the setpoint but not removing
the long obsolete hystersis here:
114e85d260d4acb157e191fd8cfc1f58c9c73e4e
2022-05-04 02:22:18 -07:00
Matthias Grob
5055fec796 MulticoperPositionControl: explicitly overwrite setpoint timestamp when setpoint is reset 2022-05-04 02:22:18 -07:00
Matthias Grob
424fd8b304 MulticoperPositionControl: remove time_stamp_now alias for timestamp_sample of the local position
to make it explicit what is used is not a fresh hrt_absolute_time() call
by this module.
2022-05-04 02:22:18 -07:00
Matthias Grob
8180f931de MulticopterPositionControl: rename local_pos -> vehicle_local_position 2022-05-04 02:22:18 -07:00
Matthias Grob
4ffe796b4d MulticopterPositionControl: clarify previous position control naming 2022-05-04 02:22:18 -07:00
Daniel Agar
ad6592f669 mc_pos_control: require current trajectory setpoint to run controller 2022-05-04 02:22:18 -07:00
Daniel Agar
3d7a6b4021 mc_pos_control: silence invalid setpoint warning when disarmed 2022-04-26 01:37:37 -04:00
Matthias Grob
10f927ae2b MulticopterPositionControl: remove unused return value parameters_update() 2022-04-12 10:13:11 -04:00
Daniel Agar
6135bb384b cleanup module callback registration failed errors 2022-03-23 20:44:50 -04:00
Matthias Grob
c9f7c20d46 MulticoperPositionController: time failsafe messages together
The following output instead of printing the
action "stop and wait" just once:

WARN  [mc_pos_control] invalid setpoints
WARN  [mc_pos_control] invalid setpoints
WARN  [mc_pos_control] Failsafe: stop and wait
WARN  [mc_pos_control] invalid setpoints
WARN  [mc_pos_control] Failsafe: stop and wait
WARN  [mc_pos_control] invalid setpoints
WARN  [mc_pos_control] Failsafe: stop and wait
2022-01-19 14:31:19 +01:00
bresch
ea7d2334c9 mpc: add parameter for ascent/descent speed in auto modes 2022-01-12 13:33:48 +01:00
Daniel Agar
019eaf7038 multicopter: minimize dt jitter by using estimate timestamp_sample 2021-12-17 17:52:28 -05:00
Beat Küng
4ba84d56c9 logger: introduce optional topics
The current practice of adding topics to the default set isn't scalable,
as it affects all setups.
By making sure topics are advertised on init, logger can just discard
topics that don't exist. This does not work for all topics, so topics are
specifically marked as optional. It can be extended to more topics later
on though.

This reduces the list of topics by ~35 on a pixracer configured as quad,
and reduces RAM usage by ~1KB.
2021-11-15 09:02:03 -05:00
Matthias Grob
7ec8dd9d23 vehicle_constraints: remove deprecated speed_xy constraint 2021-11-09 21:47:06 -05:00
Nicolas Martin
ba66f8a1e2 reset hover thrust value in controllers when disarmed
During landing, hover thrust value can be very incorrect so it should be
reset before taking off
2021-10-08 10:39:49 +02:00
bresch
e53d2907d7 AutoSmoothVel: adjust controller constraints in emergency braking
When engaging auto mode at high vertical speed, we don't want to cut the velocity
trajectory setpoint in order to create a smooth deceleration.
2021-09-23 09:22:32 +02:00
Beat Küng
90940c3672 mc_pos_control: switch to events 2021-09-11 14:08:41 -04:00
Matthias Grob
58ea97a699 MulticopterPositionControl: add horizontal margin for saturation cases 2021-09-08 19:55:27 +02:00
bresch
1016600ded Revert "mc_pos_control: omit initial warning"
This reverts commit 446598d00359d42acef2619c157a493d2997edd5.

The first warning was due to a race condition that is fixed by the previous commit;
don't omit the first warning anymore
2021-07-30 21:39:18 -04:00
bresch
e7a2c1d88e MCPosControl: fix invalid setpoint race condition
Only modify the _setpoint for takeoff when there is a new uORB message
to avoid a race condition where both vel_sp(2) and accel_sp(2) can be
NAN at the same time.
2021-07-30 21:39:18 -04:00
mcsauder
fef2c43395 Modify occurrences of control_mode to vehicle_control_mode in MulticopterPositionControl.cpp/hpp to reflect the existing naming convention in the files. 2021-07-06 22:02:15 -04:00
Matthias Grob
5ac5399d83 Remove horizontal slow down close to ground
Because based on the numerous complaints it was disabled by default
(only velocities above 10m/s were limited)
and since then no one intentionally used it anymore. But
there were some minor investigations of drones not reaching
their maximum speed which always showed 10m/s.
2021-06-25 11:15:41 +02:00
bresch
514845592b en-/disable mc position controller using explicit control mode flag 2021-06-09 18:10:22 +02:00
bresch
841914462d MC pos control: use vz<->z_deriv blending in pure vel mode only
This logic was introduced to avoid large altitude drifts in velocity
mode (altitude not controlled) due to potential velocity estimate bias
in case of IMU problems (see PR #8445). After some refactorings,
the logic started to be used in altitude-controlled modes as well, which is not needed.
2021-06-08 14:58:14 +02:00
Julian Oes
446598d003 mc_pos_control: omit initial warning 2021-06-07 08:54:19 -04:00
Matthias Grob
29e07b1e52 MulticopterPositionControl: publish stricter tilt limit during takeoff 2021-04-20 18:18:21 +02:00
Matthias Grob
8fec39ad39 MulticopterPositionControl: readd takeoff ramp fix
added in #14821 and accidentally removed in #14665
2021-03-31 15:21:42 +02:00
Matthias Grob
c06b5a1de9 MulticopterPositionControl: improve tilt limit readability and scope
according to @bresch's review comment.
2021-03-31 10:03:08 +02:00
Matthias Grob
94469d84ae MulticopterPositionControl: fix twitch on tilt limit relaxation 2021-03-31 10:03:08 +02:00
Matthias Grob
ceb445caa0 Run mc_pos_control for acceleration control mode flag 2021-03-11 10:37:03 -05:00
Daniel Agar
35488337d3 mc_pos_control: add OFFBOARD takeoff intent 2021-03-07 11:04:17 +01:00
Matthias Grob
114e85d260 MultiCopterPositionControl: hotfix emergency failsafe
that prevents the vehicle from crashing with invalid setpoints or
states.

This broke with #16869 when the scheduling of the position control module
and the setpoint generation got independent. The failsafe mechanism assumed
the setpoint is overwirtten by the possibly infeasible input on every loop
iteration which is not the case anymore. As a result the failsafe reset its
histeresis based on the failsafe setpoint from the last loop iteration.

Keeping the failsafe_setpoint separate solves this issue. Note that
these setpoints to the bare minimum to keep the vehicle safely in the air
and do not suffer from sideffects ignoring the EKF reset.
2021-03-05 11:29:36 -05:00
Daniel Agar
d0c9a5fc93
OFFBOARD mode architecture overhaul (#16739)
- handle SET_POSITION_TARGET_LOCAL_NED and SET_POSITION_TARGET_GLOBAL_INT with ORB_ID(trajectory_setpoint)
 - FlightTaskOffboard not needed at all
 - bypass position_setpoint_triplet entirely (start removing extraneous fields)
 - simplify offboard_control_mode to map to supported control modes
2021-03-05 09:39:46 -05:00
Matthias Grob
28b89b024f MulticopterPositionControl: fix Takeoff ramp use
- guard against NAN speed_up limit as input to ramp see #14339
- allow negative speed_up limit for ramp to work
2021-03-03 18:53:56 +01:00
Daniel Agar
0ada59e57b ekf reset remove NAN checks 2021-03-03 18:53:56 +01:00
Daniel Agar
266ea377da move takeoff state machine flight_mode_manager -> mc_pos_control 2021-03-03 18:53:56 +01:00
Beat Küng
14bf9cf753 mc: add SYS_VEHICLE_RESP param to configure vehicle responsiveness 2021-02-24 17:27:31 +01:00
Daniel Agar
ac8f4e3c48 mc_pos_control: only update constraints if topic updated
- update failsafe constraints
2021-01-19 14:44:42 +01:00
Daniel Agar
4d7b875ee2 flight_mode_manager: merge with flight_tasks 2021-01-17 15:46:30 +01:00
Matthias Grob
fafbb687d8 FlightModeManager: fix integral reset on ground
This information could also be used for yaw and integral
resets of the lower level controllers.
2020-12-30 10:25:08 -05:00
Matthias Grob
7de288877a MulticoperPositionControl: 3rd pass get rid of zombie members 2020-12-30 10:25:08 -05:00
Matthias Grob
8edb06e94f FlightModeManager: make sure emergency failsafe works 2020-12-30 10:25:08 -05:00
Matthias Grob
8329208b84 FlightModeManager: fix takeoff ramp from zero 2020-12-30 10:25:08 -05:00
Matthias Grob
88c274b3cd MulticopterPositionControl: 2nd pass to move to FlightModeManager 2020-12-30 10:25:08 -05:00