394 Commits

Author SHA1 Message Date
Peter van der Perk
d5e3e9a7bc [Kconfig] Decompose Kconfig, now each module has its own Kconfig
Which is better for versioning and decomposability
2021-10-07 10:09:01 -04:00
bresch
9681f819a8 mc_att: inject identification signal in att control output 2021-10-02 18:12:05 -04:00
Daniel Agar
b5430c22c4 AlphaFilter: move from ecl -> mathlib 2021-07-15 10:38:24 -04:00
Beat Küng
629f7ba15b params: ensure short description is only a single line
So a UI can display it properly
2021-03-23 12:55:11 -04:00
Jaeyoung-Lim
6b4ccaa53e Handle invalid yaw rate setpoints 2021-03-14 00:01:57 +01:00
Daniel Agar
bb12fce66c delete RATTITUDE flight mode 2021-03-09 10:47:00 -05:00
Matthias Grob
c96d9a79b8 mc_att_control_params: remove frequency unit from attitude gains 2021-03-08 11:14:01 -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
Lorenz Meier
15219fbfe5 MC att control: Robustify for throttle scaling
PX4 can support negative (reverse) throttle and the multicopter controller is not expecting this input range. This hardens it against it.
2021-02-14 11:17:28 +01:00
Daniel Agar
967d35a6b6
rate limit most parameter_update subscriptions
- parameter updates can be quite expensive because they trigger nearly all modules to reload all of their parameters immediately
 - limit modules from updating faster than once per second
2021-01-10 21:09:15 -05:00
Daniel Agar
0f411d6820
Multi-EKF support (ekf2)
- ekf2 can now run in multi-instance mode (currently up to 9 instances)
    - in multi mode all estimates are published to alternate topics (eg estimator_attitude instead of vehicle_attitude)
 - new ekf2 selector runs in multi-instance mode to monitor and compare all instances, selecting a primary (eg N x estimator_attitude => vehicle_attitude)
 - sensors module accel & gyro inconsistency checks are now relative to the mean of all instances, rather than the current primary (when active ekf2 selector is responsible for choosing primary accel & gyro)
 - existing consumers of estimator_status must check estimator_selector_status to select current primary instance status
 - ekf2 single instance mode is still fully supported and the default

Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
2020-10-27 10:56:11 -04:00
Hamish Willee
979243f38f
params: make parameter units more consistent (#15502) 2020-08-24 11:33:08 +02:00
Daniel Agar
b7f9ff6747 mc_att_control: don't use auto for primitive types
Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2020-08-10 14:07:42 -04:00
Daniel Agar
0781fdd813 mc_att_control: don't store vehicle_status copy 2020-08-10 14:07:42 -04:00
Daniel Agar
8c42c38650 mc_att_control: don't store full vehicle_land_detected copy 2020-08-10 14:07:42 -04:00
Daniel Agar
41a1675c53 AttitudeControl: only normalize attitude setpoint once on update 2020-08-10 14:07:42 -04:00
Daniel Agar
1c42d12491 mc_att_control: don't keep att copy and avoid unnecessary Quatf construction and copies 2020-08-10 14:07:42 -04:00
Daniel Agar
5e739f66d6 mc_att_control: inline control attitude call and rate publication
- this makes it clear that we didn't need to keep local copies of the rate setpoint
2020-08-10 14:07:42 -04:00
Daniel Agar
45ee16d236 mc_att_control: use attitude timestamp for dt 2020-08-10 10:51:52 -04:00
Steve Nogar
48bf9268c3 rename Mixer to MixerBase to resolve case-insensitivity on mac 2020-07-31 09:37:49 -04:00
Matthias Grob
0b391fdcfc mc_att_control: add gradual3 function to cover hover thrust rescaling 2020-07-24 11:31:15 +02:00
Matthias Grob
e9eae1bd76 Refactor: Name manual_control_setpoint the same way everywhere 2020-06-22 12:06:27 -04:00
Matthias Grob
bcd771d832 Update ecl and adapt to new AlphaFilter location 2020-06-17 09:29:35 -04:00
Daniel Agar
31fe7af454 selectively increase optimization -Os -> -O2
- targetted at modules/libraries that benefit without drastically
increasing flash usage
 - ignored on boards with CONSTRAINED_FLASH set
2020-06-04 20:59:52 -04:00
Matthias Grob
e482081f91 mc_att_control: grab attitude setpoint before processing estimate reset 2020-05-26 15:07:45 +03:00
Matthias Grob
12ee75700a mc_att_control: adapt setpoint on estimation reset
There was a gap where the attitude controller already used the estimate
with a new reference but the last known attitude setpoint was still based
on the old reference. This leads to a big glitch on reset because until
the attitude setpoint gets updated the error is wrong and as large as the
attitude delta of the reset.
2020-05-26 15:07:45 +03:00
Matthias Grob
cf658494ad mc_attitude_control: keep last attitude setpoint as member
The last attitude setpoint that is known from the position controller
is now kept inside the AttitudeControl class such that we don't
keep the whole vehicle_attitude_setpoint struct and always copy over from
there to run an update step.
2020-05-26 15:07:45 +03:00
Matthias Grob
1a3c692e4e mc_att_control: add an optional stick tilt input filter 2020-05-20 19:30:19 +02:00
Daniel Agar
326d8efc16 move attitude controllers to new wq:attitude_ctrl 2020-04-27 21:34:35 -04:00
Matthias Grob
b8576cccc8 AttitudeControlTest: add scale testing for yaw weight 2020-03-28 17:51:59 +01:00
Matthias Grob
96bbc63eb1 AttitudeControl: let the user set yaw weight directly via parameter
instead of infering the yaw weight from the gains which can lead to
unexpected results depending on the particular vehicle tuning.
2020-03-28 17:51:59 +01:00
Matthias Grob
d313b0417a AttitudeControl: Take advantage of Quaternion.canonical()
Introduced by @kamilritz in
https://github.com/PX4/Matrix/pull/116/
2020-03-17 10:01:42 +01:00
Matthias Grob
f90d3671c0 vehicle_attitude_setpoint: get rid of unused q_d_valid flag 2020-02-27 09:17:52 +01:00
Daniel Agar
21a8d7db7f WorkItem modules: Run() shouldn't be public 2020-01-22 12:03:03 -05:00
Daniel Agar
22a005c9f4
delete module's redundant print_status()
- we can already get the running status from ModuleBase and the other misc information is already available through perf or uORB
2019-11-30 18:22:19 -05:00
Daniel Agar
0cc250194d
VTOL: explicitly start all FW & MC controllers in VTOL mode 2019-11-30 12:58:36 -05:00
Matthias Grob
28755d5bbf att_control: remove resetting the attitude setpoint
since the position controller publishes them again already when disarmed.
2019-11-24 11:06:03 -05:00
Daniel Agar
75da6e351b mixer: organize by type 2019-11-22 16:48:10 -05:00
Daniel Agar
79dc676c8f mixer: move MixerGroup out of Mixer hierarchy and delete mixer.h header 2019-11-22 15:00:25 -05:00
Daniel Agar
84fe64b1c2
create new multicopter rate controller module (mc_rate_control) split out of mc_att_control 2019-11-19 17:03:11 -05:00
Beat Küng
3198610f85 src/platforms: move all headers to platforms/common/include/px4_platform_common
and remove the px4_ prefix, except for px4_config.h.

command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done

Transitional headers for submodules are added (px4_{defines,log,time}.h)
2019-10-30 11:48:47 +01:00
Daniel Agar
d545825bf0 clang-tidy: enable performance-unnecessary-value-param and fix 2019-10-27 19:19:07 -04:00
Matthias Grob
08ec6a28f0 mc_att_control: remove TPA
because it's mostly unused and we have thrust curve correction
see parameter THR_MDL_FAC
2019-10-18 15:54:09 -04:00
Julien Lecoeur
4cc7b1319f Fix param update in mc_att_control
ModuleParams::updateParams() was never called
2019-10-16 08:17:04 -04:00
Matthias Grob
9f639d1f3b mc_att_control: move rate control to RateControl class
This makes the controller more modular, more readable and hence
better maintainable.
2019-10-15 07:46:47 +02:00
Matthias Grob
bb91db2057 AttitudeControlTest: fix adaptAntipodal() function 2019-10-14 18:23:22 +02:00
Matthias Grob
83dfa227a7 AttitudeControlTest: include all corner case combinations
Which revealed antipodal quaternion corner cases when
the first element is zero.
2019-10-14 18:23:22 +02:00
Matthias Grob
511828bfd2 AttitudeControlTest: add first controller convergence test 2019-10-14 18:23:22 +02:00
Daniel Agar
26364d44c9
px4_work_queue: command line status output and shutdown empty queues
* adds a work_queue systemcmd that will bring a tree view of all active work queues and work items
 * WorkQueues now track attached WorkItems and will shutdown when the last WorkItem is detached
2019-10-02 12:23:17 -04:00
Daniel Agar
c8e59c4e39 parameter_update use uORB::Subscription consistently 2019-09-29 10:49:03 -04:00