19169 Commits

Author SHA1 Message Date
Matthias Grob
8036efd7f2 mc_pos_control: refactor takeoff trigger conditions to be positive 2019-05-22 22:05:38 +02:00
Matthias Grob
5e23883376 mc_pos_control: fix smooth takeoff ramp
- start from a velocity setpoint pushing into the ground
to ramp from idle thrust up.
- start with a bit higher velocity setpoint threshold to make
sure the vehicle has a chance to really get off the ground.
- calculate ramp slope from initialization setpoint to the desired one
instead from zero to the desired. this ramps up quicker when you demand
a very small upwards velocity like the AutoLineSmoothVel and
ManualPositionSmoothVel tasks do at the beginning.
- don't stay in the takeoff ramp depending on the land detector, this
is unnecessary.
2019-05-22 22:05:38 +02:00
Matthias Grob
bc77302fc9 mc_pos_control: refactor smooth takeoff names
The comments and variable names were partly misleading.
I grouped all members, hopefully gave them more
understandable names and adjusted the comments.
2019-05-22 22:05:38 +02:00
Matthias Grob
6d5d09c231 mc_pos_control: refactor smooth takeoff call
There were two rather confusing function calls one to check
if smooth takeoff needs to be ran and one that updates it.
I combined them and documented the interface correctly
making the parameters non-reference const floats.
2019-05-22 22:05:38 +02:00
Daniel Agar
f0cd79953f create PX4Barometer class 2019-05-20 13:12:49 -04:00
Daniel Agar
a883d8eff9 PX4Magnetometer now functional 2019-05-20 13:12:49 -04:00
Julian Oes
12374490cb visibility.h: clean up includes, add comments
This tries to make the visibility.h header clearer and better
structured. We don't actually need the ifdef for lockstep enabled or
disabled because that's now handled elsewhere.
2019-05-20 12:39:02 -04:00
Julian Oes
84537921e9 visibility.h: fix missing headers 2019-05-20 12:39:02 -04:00
Daniel Agar
162405479b
device drivers lib add linux spi support 2019-05-20 12:18:56 -04:00
David Sidrane
ed8c6019d5 Added TI ina226 I2C power monitor (#11755) 2019-05-17 13:33:48 -04:00
bresch
feefbb444b ManualSmoothVel - Remove unused _param_mpc_jerk_min declaration 2019-05-17 14:15:29 +02:00
Mathieu Bresciani
4b2d01dea1 MPC parameters - Update from Matthias' comments
Co-Authored-By: Matthias Grob <maetugr@gmail.com>
2019-05-17 14:15:29 +02:00
bresch
b726d8df0d Add jerk parameter for auto mode MPC_JERK_AUTO. Specify when a parameter is only used in a certain manual or auto mode 2019-05-17 14:15:29 +02:00
Beat Küng
011aef5464 px4_poll posix: fix wrap-around for large timeouts
timeout is an int, so it wraps when the poll timeout is >2147ms.
This happened in logger, resulting in poll never returning.
2019-05-17 07:53:33 -04:00
Julian Oes
9d8015d029 modules/lib: ignore address-of-packed-member
For now we need to ignore this warning which GCC 9 shows for the MAVLink
headers.
2019-05-16 13:06:25 +02:00
Julian Oes
b20feacdb5 drivers: fix -Wstringop-truncation
GCC 9 complained about stringop-truncation which is a cautionary message
to prevent using strncpy with non-null terminated strings.

We can fix this by copying one byte less than the destination size and
then manually adding the null termination, as we already do.
2019-05-16 13:06:25 +02:00
Oleg Kalachev
77097b6adc commander: update commander status when offboard control mode changed 2019-05-11 10:30:57 -04:00
Bart Slinger
ebf8bc898a fix bebop upload script 2019-05-11 14:39:42 +01: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
f5f95635b4 gtest: fix poisoned exit in compile flags
visibility.h is included globally in PX4 via cmake compile flags.
It contains poisoning the exit() command which is used by gtest
to close the test application. Removing the flag for gtest compilation
fixes the compile error:
gtest.cc:4757:7: error: attempt to use poisoned "exit"
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
Daniel Agar
d4b7441d12
Update submodule ecl to latest Wed May 8 12:38:58 UTC 2019 (#11972)
- ecl in PX4/Firmware (fa1fbed24633aef7985a128ebd4d19a7f6a4d108): c4492b17c1
    - ecl current upstream: a27a43eafa
    - Changes: c4492b17c1...a27a43eafa

a27a43e 2019-05-01 Hamish Willee - Fix up link to EKF docs
3f69189 2019-04-04 Mohammed Kabir - EKF: control: stop vision yaw fusion on timeout
2019-05-08 09:56:16 -04:00
Beat Küng
1169d091b6 ToneAlarm: ignore topic updates with 0 timestamp
Commander initially publishes a tune_control topic set to 0, which can
interfere with the startup tone (as happening on the Pixhawk Cube).
2019-05-08 14:16:30 +02: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
斯东Stone
b35be4b0a6 Fix typo in drivers/lights/CMakeLists.txt 2019-05-08 08:18:37 +02:00
bresch
02f0533ee9 Commander - Remove old code that overrides state_machine_helper logic 2019-05-07 17:45:28 +02: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
Daniel Agar
3d22da9cbe
wind_estimator fix true airspeed usage 2019-05-06 15:25:33 -04:00
Julian Oes
0a978f51e6 px4_atomic: use volatile hack for Snappy
It looks like the atomic builtins are not available using QuRT and the
Hexagon toolchain, so our best bet is to use `volatile` for the atomics.
2019-05-06 12:06:01 -04:00
Oleg Kalachev
7ec6f0dca6 lpe: use minimum flow altitude from uORB instead of hardcoding 2019-05-05 02:57:58 -05:00
bresch
881d0f4143 UAVCAN - update ROMFS_FW_PATH to /etc/uavcan/fw. to match documentation 2019-05-02 16:22:33 -05:00
Beat Küng
74990cadc8 uorb: avoid printf while DeviceMaster is locked
This fixes a potential dead-lock when 'uorb status' was used via MAVLink
shell.
The dead-lock chain is: DeviceMaster::lock() -> printf -> output to a pipe,
which blocks until a reader reads the data. In that case it's mavlink.
If mavlink makes a call that requires DeviceMaster::lock() (such as
orb_exists), it dead-locks.

This patch moves all printf's out of the locked state.
2019-05-02 10:26:41 +02:00
Matthias Grob
29719894f7 AttitudeControl: remove unused setter 2019-04-30 23:18:44 -05:00
Matthias Grob
269d077fae ekf2: only check ground effect if it's configured 2019-04-30 12:34:28 +02:00
Roman
f034d2da19 ekf2: fixed bug in baro ground effect triggering logic
- when either terrain data was temporarily not valid (flying at high
distance to the ground) or the vehicle was not close to the ground
(_param_ekf2_gnd_max_hgt) the ekf switched to using the land detector
ground effect flag.

Signed-off-by: Roman <bapstroman@gmail.com>
2019-04-30 12:34:28 +02:00
Daniel Agar
9bad61b86b
Improve robustness to bad and lost airspeed data (#11846) 2019-04-30 03:08:23 -04:00
Roman
2bd8b517c5 FwPositionControl: don't do takeoff help for vtol
- takeoff help is used for fixed wings, it increases the altitude setpoint
after a launch. A vtol does not need this as it's already sufficiently
high up in the air.

Signed-off-by: Roman <bapstroman@gmail.com>
2019-04-30 02:45:49 -04:00
Matthias Grob
56591954ad Commander: reevaluate RC mode on altitude lock 2019-04-29 13:24:29 -04:00
Daniel Agar
f032d0d9fc
SYS_MC_EST_GROUP mark LPE unsupported and update airframes (#11925) 2019-04-29 11:50:36 -04:00
Daniel Agar
2142459027 Revert "simulator: remove hack for diff_pressure noise"
This reverts commit 4a71984f77249230787b7d263d866d6cfa78a7ac.
2019-04-29 10:46:38 -04:00
Julian Oes
4a71984f77 simulator: remove hack for diff_pressure noise
The noise for airspeed is now applied on the Gazebo side and we can
remove this hack.
2019-04-28 18:22:21 -04:00
Matthias Grob
3bf5d6af12 commander: fix RC mode switch not getting applied after boot
the condition to enter the rc mode switch evaluation was neglecting
the first connection of an RC when "no RC switch changed". this means
depending on the actual initialization values of _last_sp_man and the
desired mode preselected on the RC while connecting it would not get
evaluated.
2019-04-26 21:04:10 +02:00
Matthias Grob
f177a68da9 commander: negate main_state_rc entering condition
pure refactor using De Morgan's law to make the condition more intuitive
since you think about when should I enter and not when should I skip
2019-04-26 21:04:10 +02:00
Matthias Grob
1f3ebd98b1 commander: split up set_main_state_rc entering condition
pure refactor of the huge condition into smaller const bool junks
2019-04-26 21:04:10 +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
Beat Küng
c3ac1497c0 mpu9250: fix mag publishing garbage on IMU failure (SPI only)
The Pixhawk cube as an internal mag on SPI. If there was a bad register
read (e.g. on an IMU failure), _register_wait was non-zero and there was
no transfer but _mag still published mpu_report.mag.
2019-04-26 18:49:28 +02:00
Thijs Raymakers
33fe69a3e8 adis16497: fix TEMP_OUT conversion according to the datasheet 2019-04-26 15:22:06 +02:00