2246 Commits

Author SHA1 Message Date
Beat Küng
1851665fab boards: add new spi+i2c config
Chip-select and SPI initialization uses the new config, whereas the drivers
still use the existing defines.

The configuration in board_config.h can be removed after all drivers are
updated.
2020-03-10 10:11:43 -04:00
Beat Küng
3fef401e81 uorb callbacks: fix unregister ordering to avoid race conditions
The order should be: first unregister, then remove the item from the
runnable queue.
2020-03-09 08:06:00 -04:00
Julian Kent
36c307a39e Provide a dummy avoidance for flash constrained boards
Part of this: move ObstacleAvoidance to a library
2020-03-09 09:51:49 +01:00
Julian Kent
5169cfcc45 Add bezier trajectory tracking in obstacle avoidance 2020-03-09 09:51:49 +01:00
Julian Kent
5b8aa20c2f Bezier trajectory functions to get position, velocity, accel on trajectory 2020-03-09 09:51:49 +01:00
bresch
2d009e2e7a ecl: update submodule
- reduce CPU load
- fix earth rate gyro compensation
- make test with clang
- use switch statements in controlHeightFusion

Diff:
3fa5f501ae..230c865fa9
2020-03-04 23:59:24 +01:00
PX4 BuildBot
862cb2052c Update submodule ecl to latest Mon Mar 2 12:39:50 UTC 2020
- ecl in PX4/Firmware (43aab81fdebc5c70d8ddb9285ee1e5005f4ee8a1): 05d391c785
    - ecl current upstream: 3fa5f501ae
    - Changes: 05d391c785...3fa5f501ae

    3fa5f50 2020-02-27 Carl Olsson - EKF: dont check gps_check_fail_status in velocity reset (#761)
71d4d22 2020-02-21 Daniel Agar - EKF: covariances() helper return const reference and fix code style
8b91856 2020-02-21 bresch - ekf: fix angle wrapping in realignYawGPS
00872fc 2020-02-18 Daniel Agar - EKF: ImuDownSampler pass imuSample as const reference
81c6d66 2020-02-13 bresch - ekf: clean uncorrelateQuatStates function
c6d5a74 2020-02-12 Julian Kent - Update change indicator
2020-03-02 14:03:21 -05:00
Martina Rivizzigno
678e32caf7 CollisionPrevention remove mavlink_log outputs 2020-03-02 16:49:56 +01:00
Martina Rivizzigno
a9491dfaf7 run avoidance also in Loiter 2020-03-02 16:49:56 +01:00
Martina
a4acb6b92a CollisionPrevention: set frame for obstacle_distance_fused topic 2020-03-02 16:49:56 +01:00
baumanta
7801ed129f Add safety measure and test for missing sensor data 2020-03-02 16:49:56 +01:00
baumanta
67d0f5c5d1 CollisionPrevention: No movement if FOV is zero 2020-03-02 16:49:56 +01:00
Julian Kent
18754225c9 Update matrix library 2020-02-26 10:27:32 +01:00
Daniel Agar
afc59f843c invensense icm20602 improvements
- refactor Run() into simple state machine
 - perform reset and configuration in sensor bus thread
 - when using data ready interrupt skip checking FIFO count
2020-02-22 12:15:52 -05:00
Timothy Scott
4c1adc088f Removed all swapping of uORB instances 2020-02-21 22:38:26 -08:00
Daniel Agar
22499effb9 invensense icm20602 improvements
- checked register mechanism and simple watchdog
    - driver checks for errors gradually and can reconfigure itself
 - respect IMU_GYRO_RATEMAX at the driver level
 - fixed sensor INT16_MIN and INT16_MAX handling (y & z axis are flipped before publishing)
 - increased sensor_gyro_fifo max size (enables running the driver much slower, but still transferring all raw data)
 - PX4Accelerometer/PX4Gyroscope remove unnecessary memsets
2020-02-18 19:21:20 -05:00
Julian Kent
e7aa899746 AutoLineSmoothVel: don't use _velocity_setpoint for constraints
Unfortunately the constraints cannot be implemented using the
_constraints because the controller uses that directly. This
causes discontinuities in the velocity and/or accel at various
points of the flight. In particular this was used in Takeoff.

Instead this was done by changing target accel/velocity in the
jerk-optimal velocity planner for Z.
2020-02-18 13:59:58 +01:00
Morten Fyhn Amundsen
86bf4b2289 FlightTaskManualAltitude: Fix sign error in terrain hold setpoint reset
The modified statements are intended to

1. Set a new Z position setpoint that is equivalent to the current distance
to ground setpoint,

and

2. Set a new distance to ground setpoint that is equivalent to the current Z
position setpoint.

They are only called in terrain hold mode, when activating/deactivating the
holding (typically when coming to a stop and when starting to move again).

The setpoints take the current control error into account, but because the
control error is added, not subtracted, the result is that the new setpoint
is 2 times the control error off from the old setpoint, instead of being
at the same spot as the old setpoint.
2020-02-17 15:18:04 +01:00
Daniel Agar
d7c3e1066a
uavcannode updates and px4_fmu-v4_cannode example
- drivers/uavcannode add baro, mag, gps publications
 - delete old px4_cannode-v1 board
 - add stripped down simple rcS for CAN nodes
2020-02-16 12:11:54 -05:00
Julian Oes
9a96ca14be Tools: make Python import error more readable
The problem with printing the exception was that starting with
Python 3.6 the ImportError is yet another (sub) exception called
ModuleNotFoundError which can't be printed as a string and then triggers
another exception:

```
Traceback (most recent call last):
  File "/home/julianoes/src/Firmware/Tools/serial/generate_config.py", line 11, in <module>
    import jinja2
ModuleNotFoundError: No module named 'jinja2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/julianoes/src/Firmware/Tools/serial/generate_config.py", line 13, in <module>
    print("Failed to import jinja2: " + e)
TypeError: must be str, not ModuleNotFoundError
```

As per @bkueng's suggestion the easiest is to cast the exception to str
and that way prevent the second exception.
2020-02-14 11:40:05 +01:00
Beat Küng
8020e82c1c MultirotorMixer: allow for longer mixer geometry names (16 instead of 8) 2020-02-13 03:49:16 -08:00
Beat Küng
73bd90ddd5 crazyflie: fix PWM channel ordering
Channels belonging to a certain timer were not all grouped together.
This is required by the .first_channel_index and .last_channel_index data
members.

We introduce a new mixer geometry to solve the problem.
2020-02-13 03:49:16 -08:00
bresch
17ab617877 ecl update: contains important fixes for accel bias instabilities 2020-02-12 22:34:17 +01:00
Daniel Agar
8cdbc4c593 px4iofirmware: add PX4IO_PERF define to completely disable perf counters 2020-02-10 09:40:39 +01:00
Silvan Fuhrer
a3710fcdef VTOL: flight task auto: disable weather vane when not stationary
Use yawrate setpoint from weather vane only if velocity setpoint is small
(smaller than half the cruise velocity)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-02-07 16:46:29 +01:00
Silvan Fuhrer
98aee29ddc VTOL: Manual Pos Flight Task: do not use yawrate sp from weather vane if position isn't locked
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-02-07 16:46:29 +01:00
bresch
7ca13a67b3 ZeroOrderHoverThrustEstimatorTest: add hover thrust jump test case
This is done to test the recovery function of the estimator in case
of divergence or sudden extreme hover thrust change.

Also specify seed of random generator
2020-02-07 11:52:52 +01:00
bresch
e15e94b00a HoverThrustEstimator: Add convergence tests
With noisy accel and thrust in hover, climb and descent conditions.
2020-02-07 11:52:52 +01:00
bresch
0f1c7590e9 HoverThrustEstimator: add a new single state estimator
with measurement noise auto-tuning

The purpose of this estimator is to improve land detection and vertical
velocity feedforward

Recovery strategy:
This is required when the setpoint suddenly changes in air or that the
EKF is diverging. A lowpassed test ratio is used as a trigger for the recovery logic
Also, a lowpassed residual is used to estimate the steady-state value
and remove it when estimating the accel noise to avoid increasing the
accel noise when the redisual is caused by an offset.
2020-02-07 11:52:52 +01:00
Daniel Agar
1aa514a8ea
Update submodule ecl to latest Wed Feb 5 12:39:46 UTC 2020
- ecl in PX4/Firmware (ad3865207f22e26534e04cde8825a07eda4399b5): a3e1eb9d50
    - ecl current upstream: ed260c4f1d
    - Changes: a3e1eb9d50...ed260c4f1d

ed260c4 2020-02-03 Daniel Agar - validation: remove unused vibration metric
e52e2b8 2020-02-01 kritz - Sensor Replay (#717)
da752c9 2020-01-28 kamilritz - Hot flow fusion fix
ee859e0 2020-01-28 kritz - Robustify timestamp checks (#729)
f20726d 2020-01-23 kamilritz - Expand auto-format coverage and tiny style changes
fbdd75d 2020-01-27 kritz - Update CONTRIBUTING.md
5d38b73 2020-01-24 kamilritz - Update description of Firmware build tests
e3af91c 2020-01-24 bresch - Ekf: use helper functions to centralize the checks of horizontal aiding (gps, flow, ev_pos, ev_vel)
2020-02-05 14:24:38 -05:00
Hamish Willee
ca96b6b0ea CBRK_AIRSPD_CHK: Doc driver not started 2020-02-04 09:22:18 +01:00
bresch
c80593a144 FlightTaskManualAltitude: Rename _min_speed_down -> _max_speed_down as it is the maximum allowed downward speed 2020-02-03 18:05:17 +01:00
bresch
c0d1aa1654 FlightTaskManualAltitude: Follow altitude limit given by the estimator 2020-02-03 18:05:17 +01:00
SalimTerryLi
e0abe7090e
SBUS on Linux: replace termios with termios2 and add UNKNOWN UART WQ 2020-02-02 14:06:27 -05:00
Matthias Grob
5bd8da2286 PositionControl: temporarily remove direct thrust setpoint support
This commit temporarily breaks direct horizontal thrust setpoint execution
which is used by FlightTaskManualAltitude. This is necessary to allow for
PositionControl cleanup namely calculating the whole velocity PID in one
Vector3f formula.

Having this in a separate commit is useful since it reduces indentation
of a bigger code block.
2020-01-30 07:28:18 -05:00
Daniel Agar
2410b31662
sensors: move accel filtering to sensors/vehicle_acceleration
I've added a queue depth of 4 for sensor_accel and sensor_gyro. This is initially added because it's not always possible for the `vehicle_acceleration` to keep up with every publication of the primary accelerator as it runs in the same thread as ekf2, various controllers, etc. 

Later this mechanism will be used in a few areas
 - rate limit `vehicle_angular_velocity` and `vehicle_acceleration` without missing any raw data
 - move IMU integration to `vehicle_imu` and out of the actual driver threads, eliminating the need for sensor_accel_integrated and sensor_gyro_integrated
 - integrate raw gyro synchronized with optical flow measurements
2020-01-29 16:13:38 -05:00
Silvan Fuhrer
4fa64f686a pre arm check: add circuit breaker for the VTOL arming in fixed-wing mode prevention
Added a new circuit breaker that, if set, enables arming in fixed-wing mode for VTOLs.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-01-28 00:30:24 +01:00
Daniel Agar
24f0c2d72a
sensors: move gyro filtering to sensors/vehicle_angular_velocity
- gyro filtering (low-pass and notch) only performed on primary gyro in `sensors/vehicle_angular_velocity` instead of every gyro in `PX4Gyroscope`
 - sample rate is calculated from actual updates (the fixed value was slightly wrong in many cases, and very wrong in a few)
 - In the FIFO case the array is now averaged and published in `sensor_gyro` for filtering downstream. I'll update this in the future to use the full FIFO array (if available), but right now it should be fine.
2020-01-27 10:05:33 -05:00
RomanBapst
27e9b1e3d4 updated ecl 2020-01-24 16:49:17 +03:00
kamilritz
5a5b3a44ee Update flow interface 2020-01-24 16:49:17 +03:00
Jacob Dahl
562062b303 batt_smbus: fix potential buffer overrun bug (#13904) 2020-01-24 11:01:25 +01:00
Beat Küng
e939f60a9e FlightTaskAuto: accept invalid triplet_setpoint (and interpret as loiter)
This will allow navigator to not output any setpoints while disarmed.
Otherwise the position controller outputs warnings in the form of:
Auto activation failed with error: Activation Failed

The risk here is that it could hide problems, where navigator sends invalid
triplets when it should not.
2020-01-24 08:42:16 +01:00
kritz
47cab3dba5 Update external vision interface (#13989)
* Update external vision interface

* Update ECL Version
2020-01-23 15:36:08 +01:00
kamilritz
9554f8f98b Update ECL version 2020-01-23 13:27:30 +01:00
Daniel Agar
009ba638f5 PX4Accelerometer/PX4Gyroscope update FIFO case to trapezoidal integration 2020-01-22 18:35:41 -05:00
Beat Küng
67f3234b5b posix cdev_platform: set errno on px4_open failure 2020-01-22 12:07:51 -05:00
kamilritz
4e8665082e Move baro downsampling and dynamic pressure comp to ECL lib 2020-01-21 13:36:08 +03:00
Daniel Agar
dc05ceaad2
create temperature_compensation module
- this is a new module for temperature compensation that consolidates the functionality previously handled in the sensors module (calculating runtime thermal corrections) and the events module (online thermal calibration)
 - by collecting this functionality into a single module we can optionally disable it on systems where it's not used and save some flash (if disabled at build time) or memory (disabled at run time)
2020-01-20 21:42:42 -05:00
Daniel Agar
e863dd317e
Update submodule ecl to latest Tue Jan 21 00:39:21 UTC 2020
-  ecl in PX4/Firmware (ac205456f93857f447595eb0005c954a78461778): 011b4c2e4e
    - ecl current upstream: 950e75e484
    - Changes: 011b4c2e4e...950e75e484

950e75e 2020-01-18 Matthias Grob - EKF_ringbuffer: minor missing space for style
26125c2 2020-01-17 kamilritz - Switch from jenkins to github actions
2020-01-20 21:01:02 -05:00
Daniel Agar
bb465ca5b7
sensor accel/gyro message cleanup
- split out integrated data into new standalone messages (sensor_accel_integrated and sensor_gyro_integrated)
 - publish sensor_gyro at full rate and remove sensor_gyro_control
 - limit sensor status publications to 10 Hz
 - remove unused accel/gyro raw ADC fields
 - add device IDs to sensor_bias and sensor_correction
    - vehicle_angular_velocity/vehicle_acceleration: check device ids before using bias and corrections
2020-01-18 01:15:00 -05:00