Commit Graph

48 Commits

Author SHA1 Message Date
Daniel Agar ed7f333fe8 sensors delete disabled ATT_VIBE_THRESH (#8372) 2017-11-26 17:25:45 -05:00
Daniel Agar fabab8ac4d sensors remove barometer enabled check for now 2017-11-15 01:34:59 -05:00
Daniel Agar 273742aa0d add boolean parameters to enable/disable each sensor 2017-11-14 15:54:37 -05:00
Daniel Agar 21995bd4b7 sensors ignore invalid failover index
- fixes CID 199478
2017-10-31 08:10:04 +01:00
Paul Riseborough b3d045d4d0 Revert "add boolean parameters to enable/disable each sensor"
This reverts commit 9fde19259e.
2017-10-30 20:49:36 +11:00
Daniel Agar 9fde19259e add boolean parameters to enable/disable each sensor 2017-10-29 16:24:31 +01:00
Daniel Agar 2a1ecaa13e sensors reduce priority of a failed sensor 2017-10-29 16:24:31 +01:00
Paul Riseborough 60a68d30c7 sensors: Calculate and publish magnetometer inconsistency 2017-10-05 09:30:26 -07:00
Daniel Agar e15afcca7a vehicle_command commands are uint16, not uint32 2017-09-08 09:06:30 +02:00
Lorenz Meier 576ad4b521 Sensors update: use correct constants 2017-08-01 12:46:59 +02:00
Nicolae Rosia 0a22a9c47c change gyro & accel dt from float to uint64. This has the benefit of
calculating the estimator timeslip correctly.

Signed-off-by: Nicolae Rosia <nicolae.rosia@gmail.com>
2017-07-16 14:08:37 +02:00
Beat Küng 4afa931d80 voted_sensors_update: fix mag rotation
fixes a wrong index for _mag_device_id: previously, driver_index was used
(the CAL_MAG param index), but the correct index is the uorb topic
instance.
2017-06-17 06:36:54 +02:00
Mohammed Kabir 5a96490c68 sensors : fix race condition triggered by slow-to-boot external sensors 2017-06-14 19:53:07 +02:00
Beat Küng ce7d8d2270 sensor_mag.msg: add is_external flag & set it in the mag drivers
With this we don't have to use the ioctl MAGIOCGEXTERNAL, which does not
work on POSIX (eg. RPi).
2017-06-14 19:53:07 +02:00
Beat Küng ba3d66abba voted_sensors_update: fix invalid/stale mag data on posix
Problem: _mag_device_id is used to get the correct rotation matrix for each
mag. But on POSIX, _mag_device_id was always 0, leading to invalid rotation
matrices.
This resulted in stale mag error messages (rot matrix=0 ==> mag data=0).
_mag_device_id was 0 because there are no /dev/magX devices (eg. on RPi),
thus the mag driver could not be opened.

This patch does: get the device id from the uorb topic instead. We still
need the device handle on certain platforms to apply the calibration params
and to check if the mag is internal or external.

Problem left: on POSIX, the check for external mag does not work.
2017-06-14 19:53:07 +02:00
Beat Küng 76f593afb0 fix voted_sensors_update: remove DevMgr::releaseHandle(h);
the 'continue' continues with the inner loop, whereas the outer loop is
responsible for opening the handle. Thus the inner loop needs to keep it
open.
2017-06-14 19:53:07 +02:00
Beat Küng af6846b9a8 fix voted_sensors_update: use int32 for param_get() 2017-06-14 19:53:07 +02:00
Kabir Mohammed 5cbaaa633b FINALLY fix mag rotation issues. (#7366)
* sensors : second cut at fixing mag calibration - remove old problematic code

* sensors : use more intuitive naming for loop variables
2017-06-07 10:49:57 +02:00
Mohammed Kabir 0cb3eb99dc sensors : correctly handle internal magnetometer rotations 2017-06-03 02:16:58 +08:00
Mohammed Kabir 62b7645130 sensors : remove deprecated (since 2015) mag rotation parameter 2017-05-27 00:31:05 +02:00
Mohammed Kabir 6ee09ca16f sensors : map between driver rotation order and uORB instance order when recieving first mag message 2017-05-27 00:31:05 +02:00
Paul Riseborough 3bcb710da9 voted_sensors_update: publish sensor selections (+3 squashed commits)
Squashed commits:
[290660d] voted_sensors_update: revert the new_accel_data check (and others)

The check removed the ability to detect sensor timeouts.
[c8dc7ad] sensors: publish changes to sensor selection
[dd90dec] sensors: ensure all sensor selections published first time
2017-05-03 08:37:14 +02:00
Daniel Agar f04f1d6b03 sensors HIL increase gyro and accel timeout
- fixes #7050
2017-04-25 23:52:11 +02:00
Mohammed Kabir 57aa41df2c sensors : decouple maximum sensor count and allow flexible maximums 2017-04-24 12:24:11 +02:00
Beat Küng bc91005e7a voted_sensors_update: increase accel & gyro timeout in HIL mode 2017-03-10 09:00:24 +01:00
Beat Küng aabdc4125b ekf2: publish ekf2_timestamps topic 2017-03-04 22:47:54 +08:00
Beat Küng 881f2d2d36 sensors: add 'sensors start -hil' parameter
This does the following if given:
- don't initialize the sensors (the sensor drivers are not started)
- publish sensor_combined even in hil mode
- do not apply or publish thermal corrections
2017-03-04 05:59:10 +08:00
Beat Küng e31958cad1 voted_sensors_update: don't report failover if previous index is invalid 2017-02-01 08:40:23 +01:00
Beat Küng 4a8d29800c voted_sensors_update: cleanup & remove some attributes
since the correction topic now contains data from all sensors, we don't
need additional fields in voted_sensors_update
2017-02-01 08:40:23 +01:00
Paul Riseborough bdd3b094a7 sensors: report mapping from uORB to compensation parameter index 2017-02-01 08:40:23 +01:00
Paul Riseborough 170bc91587 sensors: fix bug in thermal compensation temperature limit (+2 squashed commits)
Squashed commits:
[2df1d9e] sensors: change definition of sensor offset and scale factor to match legacy code
[089e103] sensors: publish thermal corrections for all sensors
2017-02-01 08:40:23 +01:00
Lorenz Meier 9cacdaafc7 Sensors: Reset gyro and accel calibration if one sensor goes missing.
This is to ensure that if sensor IDs are fixed we do not end up in a state where the system is partially calibrated and the need for re-calibration is not properly communicated to the user.
2017-01-29 16:24:47 +01:00
Daniel Agar 019c6647f2 astyle src/modules/sensors 2017-01-29 01:18:32 +01:00
Beat Küng ab9e0aa524 sensors temp compensation: do an orb_copy to get the driver ID
This removes the necessity, that the driver class ID matches the uorb topic
instance.

Also improve error handling & reporting
2017-01-19 19:24:52 +01:00
Beat Küng fd48d9c190 sensors: print status of temp compensation with 'sensors status' 2017-01-19 19:24:52 +01:00
Beat Küng 117826a31f sensors temp compensation: refactor into a separate class
- reduces some code duplication
- provides clear API & separation for temp compensation

additional changes:
- added timestamp to sensor_correction topic
- reduced its publication rate, to only when voting index or scales or
  offsets change (if there is more than 1deg change in temperature)
2017-01-19 19:24:52 +01:00
Beat Küng f38843278d voted_sensors_update: make msl_pressure static const 2017-01-19 19:24:52 +01:00
Beat Küng 535b1ea0dd voted_sensors_update: simplify accel & gyro poll methods 2017-01-19 19:24:52 +01:00
Beat Küng bbd47389e0 voted_sensors_update: fix copy paste naming mistake 2017-01-19 19:24:52 +01:00
Beat Küng 0765ed552c sensor_correction.msg rename {gyro,accel,baro}_select to match uORB convention 2017-01-19 19:24:52 +01:00
Paul Riseborough 0485c2b94a sensors: add baro pressure temperature compensation and reporting 2017-01-19 19:24:52 +01:00
Paul Riseborough 63f032832f Add prototype IMU temperature compensation
Enabled using TC_A_ENABLE and TC_G_ENABLE parameters
Disabled by default.
IMU offsets and scale factors for selected sensor published to sensor_correction topic
TODO Parameter storage method is cumbersome
2017-01-19 19:24:52 +01:00
Lorenz Meier a6696d339d Sensors app: Fix consistency checks.
The sensors app assumed that all topics are published on boot which is not necessarily true and it assumed that all publications had valid data. This change ensures that topics are initialized as they update the first time and that the consistency check only runs on topics which carry valid data.
2016-12-30 00:06:04 +01:00
Lorenz Meier c91f827072 sensors app: Always run validator so it gets updated and can detect timeouts 2016-12-19 20:34:52 +01:00
Lorenz Meier fe5cc5622b Failover logging in sensors app: Trim down strings 2016-12-19 20:34:52 +01:00
Lorenz Meier cc7db94edc Sensors app mag voter: Increase stale value detection threshold to accomodate low-noise mag setups 2016-12-19 20:34:52 +01:00
Beat Küng 66925bc065 voted_senors_update: fix style after rebase 2016-12-14 19:57:54 +01:00
Beat Küng d4da626e78 sensors: move sensors with voting into a separate class 2016-12-14 19:57:54 +01:00