2274 Commits

Author SHA1 Message Date
Matthias Grob
91057fe024 FlighTasks: remove FlightTaskSport
This mode was just kept as an example after
its usage in a single case. It's basically untested
and doesn't make much sense anymore since it's
incompatible with the jerk limited trajectory
implementations. It's implementation only switched
hte configuration parameter of the velocity resulting
from maximum stick deflection to be
MPC_XY_VEL_MAX instead of MPC_VEL_MANUAL.
This is according to todays understanding undesired
because when hitting that limit the position
controller has no room for corrections anymore.

Also it saves some flash space on omnibus to remove
the task at this point and makes romm for the
acceleration feed-forward.
2020-03-30 09:58:39 +02:00
Matthias Grob
b79b095ce7 FlightTasks: adapt to acceleration based control 2020-03-30 09:58:39 +02:00
Beat Küng
e5dd2e7a19 mag_compensation.py: some minor fixes + indentation 2020-03-27 11:07:50 +01:00
Dusan Zivkovic
26a8707298 flight task auto: set acceptance radius when setting loiter as a responce to invalid setpoint 2020-03-26 21:02:20 +01:00
bresch
dc38930bb2 AutoSmoothVel: desynchronize XY from Z for small changes in speed
This fixes the issue that makes the drone slow-down even in straight
lines due to the Z component being constrained to a really small value
2020-03-26 08:31:09 +01:00
baumanta
7fd77fedaa add python script for offline param identification 2020-03-26 08:00:30 +01:00
baumanta
22ceeccc26 add library for current- or thrust-based mag compensation 2020-03-26 08:00:30 +01:00
Daniel Agar
f4e2cd36d4 add new invensense/mpu6500 driver for airmind mindpx 2020-03-25 01:05:38 -04:00
Daniel Agar
f5fe50f839 invensense/icm20608g driver minor improvements
- interupt pin set active low and latch
 - relax retry timeout if configure failed
 - improve configured empty rate (sample rate) rounding
 - fix RegisterCheck
 - check FIFO count as part of full transfer and reset or adjust timing if necessary
 - rename DRV_IMU_DEVTYPE_ICM20608 -> DRV_IMU_DEVTYPE_ICM20608G
2020-03-25 01:05:38 -04:00
Beat Küng
6ad5357d1a SPI+I2C: remove unused defines and printf's 2020-03-24 09:46:20 -04:00
JacobCrabill
1e5784609f UAVCAN Sensors: Improve error handling
Also add new 'generic' device types for UAVCAN sensors

Other misc. cleanup and style changes.
2020-03-21 12:39:29 -04:00
JacobCrabill
4c8cfa140a UAVCAN: Overhaul SensorBridge drivers
Supposedly multiple sensor callbacks were supported; in reality, this
was not the case, as the mag SensorBridge in particular can only
calibrate one compass, leading to a race condition on which compass
appears first on the bus to get published and calibrated (with no
warning to the user that the 'wrong' compass is being used).

For sensors with existing generic driver classes (baro and mag) the
sensor bridges use these classes for the driver registration, and uORB
publication, and calibration interface (ioctl) handling.
2020-03-21 12:39:29 -04:00
TSC21
341dd6ba26 update submodule src/lib/ecl 2020-03-20 23:18:04 +01:00
bresch
0213fd662a update ecl 2020-03-19 20:27:39 +03:00
bazooka joe
53bc5fddad smbus return with error if failed transfer 2020-03-19 09:34:02 +01:00
PX4 BuildBot
32a6a4e8d8 Update submodule ecl to latest Wed Mar 18 12:38:43 UTC 2020
- ecl in PX4/Firmware (e34351229b4d9de251c495ee49e7c709a93b2521): f1aa53db8a
    - ecl current upstream: ee5e3c479b
    - Changes: f1aa53db8a...ee5e3c479b

    ee5e3c4 2020-03-18 CarlOlsson - ekfgsf: fix formatting
f20fc08 2020-03-17 Mathieu Bresciani - ekf2: centralize mag covariance reset (#693)
2020-03-18 12:39:33 -04:00
Beat Küng
68ef14002a differential_pressure drivers: allow multiple instances of each driver
- the device path needs to be removed, as startup fails if it already
  exists
- sdp3x broadcasts a reset on startup, so do it only for the first I2C
  address
2020-03-17 23:31:17 -04:00
Beat Küng
3b7b2dc871 differential_pressure sensors: use driver base class 2020-03-17 23:31:17 -04:00
Beat Küng
134413233a i2c spi: extend BusCLIArguments to handle common driver arguments 2020-03-17 23:31:17 -04:00
Matthias Grob
eb3b0f6b55 mathlib: get rid of now duplicate sign() function
Instead use the one that was copied to the matrix library in
https://github.com/PX4/Matrix/pull/116/
2020-03-17 10:01:42 +01:00
Daniel Agar
1a9452e411
fw_att_control: move ecl/attitude_fw into fw_att_control module
- ecl/attitude_fw was never maintained as a standalone library
 - moving ecl/attitude_fw library into the fw_att_control module to ease further development
2020-03-15 14:14:59 -04:00
Paul Riseborough
ab92b46e69
Update ecl to add ability to recover from bad magnetic yaw
* msg: Add EKF-GSF yaw estimator logging data
* ecl: update to version with EKF-GSF yaw estimator
* ekf2: Add param control and logging for EKF-GSF yaw estimator
* logger: Add logging for EKF-GSF yaw esimtator
2020-03-15 12:57:25 -04:00
Daniel Agar
422e89b1c0 iSentek IST8308 magnetometer driver 2020-03-15 12:27:01 -04:00
Daniel Agar
64c7b4d489 parameters: handle MC_DTERM_CUTOFF -> IMU_DGYRO_CUTOFF migration 2020-03-15 09:31:45 +01:00
PX4 BuildBot
2da38ae81c Update submodule matrix to latest Thu Mar 12 00:38:40 UTC 2020
- matrix in PX4/Firmware (db0c95ed5620e8ffad3dd3281b511cf5f9ee7848): 649c837b6b
    - matrix current upstream: 4873dc1c1e
    - Changes: 649c837b6b...4873dc1c1e

    4873dc1 2020-03-04 kritz - Analytic inverse implementation (#122)
2020-03-12 00:01:38 -04:00
Daniel Agar
f9794e99f8
move hover_thrust_estimator to new module (mc_hover_thrust_estimator)
* MC_HTE: unitialize with hover_thrust parameter
* MC_HTE: constrain hover thrust setter between 0.1 and 0.9
* MC_HTE: integrate with land detector and velocity controller
* MCHoverThrustEstimator: Always publish an estimate even when not fusing measurements. This is required as the land detector and the position controller need to receive a hover thrust value.

* MC_HTE: use altitude agl threshold to start the estimator
local_position.z is relative to the origin of the EKF while dist_bottom
is above ground

Co-authored-by: bresch <brescianimathieu@gmail.com>
2020-03-11 21:20:54 -04:00
Beat Küng
a2b2605443 param: fix param_get_cplusplus type check 2020-03-10 10:11:43 -04:00
Beat Küng
b54e5a1c23 param: automatically update calibration ID params on import
This avoids the need for recalibration, and also cleans up other driver
ID's (merge separate accel/gyro).

The SPI address was previously set to a board-specific (arbitrary) value,
and is now set to 0. This will allow extending for multiple sensors of the
same type on the same bus.
2020-03-10 10:11:43 -04:00
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