361 Commits

Author SHA1 Message Date
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
Daniel Agar
fd67bd0680 uORB: SubscriptionCallback cleanup naming 2019-09-28 13:43:56 -04:00
bazooka joe
fb3a91cc4f added circuit_breaker_enabled_by_val()
added and using circuit_breaker_enabled_by_val() where possible instead of circuit_breaker_enabled() which search for cbrk parameters by name, which is extensive process.
2019-09-22 13:55:40 -04:00
bresch
e9ab6a75ba MC rate control - Scale the integrator with K during the integration
part to avoid having to scale its saturation separately. This is
required to avoid premature saturation of the integrator when using
the K term.
Also remove double saturation of the integrator
2019-09-19 14:05:28 +02:00
Beat Küng
1bee984bb0 MC_AIRMODE: move parameter definition to mixer_module
Makes sure that the parameter is included for the builds that need it.
2019-08-31 10:05:00 -04:00
Daniel Agar
78ef8aab2d STACK_MAIN increase default 1024 -> 2048 2019-08-30 19:11:51 -07:00
Beat Küng
f8e0441e7b src/platforms/common: move to platforms/common
Script to update include paths:
for i in $(grep -rl 'include <px4_work_queue' src platforms); do sed -i 's/#include <px4_work_queue/#include <px4_platform_common\/px4_work_queue/' $i; done
2019-08-30 07:59:44 +02:00
Julian Kent
d70b024ec7
GTest functional tests that include parameters and uORB messaging (#12521)
* Add kdevelop to gitignore

* Add test stubs

* Rename px4_add_gtest to px4_add_unit_gtest

* Add infrastructure to run functional tests

* Add example tests with parameters and uorb messages

* Fix memory issues in destructors in uORB manager and CDev

* Add a more real-world test of the collision prevention
2019-08-09 15:10:09 +02:00
Daniel Agar
e8a11086eb create uORB::PublicationMulti for multi publications 2019-08-08 21:01:56 -04:00
Daniel Agar
2ad12d7977
sensors: create vehicle_angular_velocity module (#12596)
* split out filtered sensor_gyro aggregation from mc_att_control and move to wq:rate_ctrl
2019-08-06 12:55:25 -04:00
RomanBapst
2fbb70d9ca mc_att_control: output zero throttle in manual mode when landed
- MPC_MANTHR_MIN is used as minimum throttle in attitude control mode when
the vehicle is in air. This is useful to retain some control around roll and
pitch axis if airmode is not enabled and the user demands zero throttle.
However, when the vehicle is landed there is not need to keep the throttle
at a higher value than zero.

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-07-23 17:12:45 +02:00
bresch
d24c415fd7 PID rate controller - Add controller gain to support Ideal PID form (ISA standard) 2019-07-16 10:24:19 +02:00
Matthias Grob
5002b13bda mc_att_control: Increase default rate integral gain
@bkueang and me realized that on every frame we tune the integral gain for
the roll and pitch rate controller is much too low. Usually it needs to be
increased to 0.3 or even 0.4 to have better "locked in" flight performance
and 0.2 seems like a good compromise for a safe default.
2019-06-24 18:26:27 +02:00
Beat Küng
ea31f34d09 mc rate controller: add I term reduction factor
Reduce the I gain for high rate errors to reduce bounce-back effects after
flips. Up to 200 degrees the gain is almost not reduced (<25%), so this
will only take noticeable effects for large errors (setpoint changes),
where we actually want to have an effect.

This allows to increase the MC_*RATE_I parameters w/o negative effects
when doing flips (i.e. bounce-back after flips).

The 400 degrees limit and the x^2 are empirical.

The better the rate tracking in general (high P gain), the less this is
required (because of the lower tracking error). At the same time it also
does not harm, as the i_factor will always be close to 1.
2019-06-22 13:23:19 +02:00
Timothy Scott
a134da6e12 Removed is_rotor_wing, replaced with vehicle_type 2019-06-13 10:04:26 +02:00
Matthias Grob
048cca7bc4 vtol_att_control: apply multicopter takeoff hotfix also for vtol (#12250)
Please see reference:
https://github.com/PX4/Firmware/issues/12171
2019-06-12 13:59:29 -04:00
Daniel Agar
79d4c09d59
uORB::Publication simplify and cleanup
- base class is now template
 - drop linked list
 - virtualization no longer required
2019-06-12 08:48:19 -04:00
Daniel Agar
d9c5fb0500 mc_att_control move print_usage() to bottom of file and format 2019-06-08 03:23:50 -07:00
Daniel Agar
cecd009ddc mc_att_control: fix vehicle_rates_setpoint_poll() error due to merge timing 2019-06-05 21:18:02 -04:00
Daniel Agar
4c42cac380 mc_att_control move most orb subscriptions to uORB::Subscription 2019-06-05 20:37:47 -04:00
Matthias Grob
ac002db25c MAVLink/Commander: @Pedro-Roque's offboard yawrate handling 2019-06-04 08:26:09 +02:00
Julian Oes
2ac8841f35 vtol/fw/mc: fix VTOL enum shadowing
This changes the enums used for various VTOL states to enum classes
which makes them type-safe and should avoid shadowing.

This change was motivated by a Clang warning about shadowing of the
enum const TRANSITION_TO_FW which was declared twice, once in
vtol_type.h and once in standard.h.

This change only removes the shadowing but presumably these enums could
be cleaned up and consolidated further.
2019-05-29 23:51:10 -04:00
Matthias Grob
1c776f16ec mc_att_control: fix applying not updated thrust setpoint 2019-05-22 22:05:38 +02:00
Matthias Grob
953e5e5019 Revert "mc_att_control: fix having high thrust when disarmed"
This reverts commit 0c81a19decde6ddfe4ce87c34c762ea15fd3ab09.
2019-05-22 22:05:38 +02:00
Matthias Grob
9ba748e67e mc_att_control: fix having high thrust when disarmed
After boot the user is in manual mode and if he has an RC
but doesn't switch out the thrust gets set to the throttle stick
position. When he then starts a takeoff from tablet the thrust is still
high while arming and the land detector immediately sees a takeoff
skiping smooth takeoff from the position controller.
2019-05-22 22:05:38 +02:00
Matthias Grob
868b4e1746 Testing: correct license headers 2019-05-09 09:42:46 +02:00
Matthias Grob
01e9b2cde8 AttitudeControlTest: compare vectors, not every element 2019-05-09 09:42:46 +02:00
Matthias Grob
2cd0344712 AttitudeControlTest: fix style 2019-05-09 09:42:46 +02:00
Matthias Grob
63b967f5df Add unit testing possibility using googletest on POSIX 2019-05-09 09:42:46 +02:00
Roman Bapst
816aa0ffb6 VTOL transitions: use FW attitude loop (#11911)
* VTOL trans: changed that now in transition for both MC and FW the corresponding (correct) attitude controller is running
* attitude setpoint for stabilized mode is generated by tailsitter.cpp
* reset yaw setpoint during transition to avoid big yaw errors after
transition back to hover
* VT_TYPE parameter: added "reboot required" metadata
2019-05-08 10:33:13 -04:00
bresch
6d8d8e3c88 MC gyro cutoffs - Reduce IMU_GYRO_CUTOFF to 30Hz and disable MC_DTERM_CUTOFF.
A low gyro cutoff is needed for most medium/large size drones as the structural natural and blade-pass frequencies are low.
A higher value is still desirable for small platforms surch as racers
or well isolated autopilots and should be tuned by the user.
Specific values for config files are untouched.
The cutoff filter for the D term is disabled here as the required
cutoff frequency for the default D term of the rate controller is higher
than the gyro cutoff. In that case, enabling the D term cutoff would
just add some undesired phase lag to the derivative.
2019-05-07 12:15:51 +02:00
Matthias Grob
29719894f7 AttitudeControl: remove unused setter 2019-04-30 23:18:44 -05: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