Lucas De Marchi
2591261af6
Global: rename min and max macros to uppercase
...
The problem with using min() and max() is that they conflict with some
C++ headers. Name the macros in uppercase instead. We may go case by
case later converting them to be typesafe.
Changes generated with:
git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)max(/\1MAX(/g'
git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)min(/\1MIN(/g'
9 years ago
Andrew Tridgell
774e257a88
AP_InertialSensor: support FMUv4
9 years ago
Caio Marcelo de Oliveira Filho
d7601095fa
AP_InertialSensor: use millis/micros/panic functions
9 years ago
Andrew Tridgell
ccd915eb67
AP_InertialSensor: moved raw gyro and accel logging to common code
...
this brings raw logging to non-PX4 ports
9 years ago
Andrew Tridgell
75ea8f3dc0
AP_InertialSensor: removed "have sample" logic from drivers
...
the frontend has all the information it needs, so we can simplify the
drivers some more
9 years ago
Andrew Tridgell
0e4bab74ba
AP_InertialSensor: simplify sensor backends
...
use common code for filtering and update, allowing each sensor driver
to be simpler and more consistent
9 years ago
Gustavo Jose de Sousa
31a49d318c
AP_InertialSensor: PX4: publish gyro raw sample rate
...
That enables delta angle calculation.
10 years ago
Gustavo Jose de Sousa
25a499a41f
AP_InertialSensor: use raw sample rate terminology
...
In order to avoid confusion between sample rate from sensor and sample rate
from the frontend class (AP_InertialSensor), use "raw sample rate" to refer to
the former.
The changes in the code were basically done with the following commands:
git grep -wl _accel_sample_rates | xargs sed -i "s,\<_accel_sample_rates\>,_accel_raw_sample_rates,g"
git grep -wl _set_accel_sample_rate | xargs sed -i "s,\<_set_accel_sample_rate\>,_set_accel_raw_sample_rate,g"
git grep -wl _accel_sample_rate | xargs sed -i "s,\<_accel_sample_rate\>,_accel_raw_sample_rate,g"
git grep -wl _gyro_sample_rates | xargs sed -i "s,\<_gyro_sample_rates\>,_gyro_raw_sample_rates,g"
git grep -wl _set_gyro_sample_rate | xargs sed -i "s,\<_set_gyro_sample_rate\>,_set_gyro_raw_sample_rate,g"
git grep -wl _gyro_sample_rate | xargs sed -i "s,\<_gyro_sample_rate\>,_gyro_raw_sample_rate,g"
And also with minor changes on indentation and comments.
10 years ago
Gustavo Jose de Sousa
4e83f7b02c
AP_InertialSensor: PX4: don't calculate delta angle
...
Delta angle calculation will be unified.
10 years ago
Gustavo Jose de Sousa
dfd671c54e
AP_InertialSensor: Backend: add hook for new gyro sample arrival
...
That hook will do common tasks for when new gyro raw sample is available.
10 years ago
Gustavo Jose de Sousa
f769a39449
AP_InertialSensor: PX4: don't calculate delta velocity
...
Delta velocity calculation will be unified.
10 years ago
Gustavo Jose de Sousa
a0b1337646
AP_InertialSensor: PX4: publish sample rate
...
By publishing the sample rate, the vibration and clipping are magically
calculated.
10 years ago
Gustavo Jose de Sousa
77a4f10d89
AP_InertialSensor: PX4: don't call calc_vibration_and_clipping()
...
That calculation will be unified.
10 years ago
Gustavo Jose de Sousa
e06627dfcb
AP_InertialSensor: Backend: add hook for new raw accel samples
...
That hook will eventually do necessary things when a new accelerometer raw
sample arrives (like calculating vibration levels).
10 years ago
Gustavo Jose de Sousa
ac3a677626
AP_InertialSensor: remove param rotate_and_correct from publish functions
...
Once that parameter is always false.
10 years ago
Andrew Tridgell
dc455a5fd6
AP_InertialSensor: setup for MPU9250 support on PX4
10 years ago
Gustavo Jose de Sousa
7789aec85b
AP_InertialSensor: standardize inclusion of libaries headers
...
This commit changes the way libraries headers are included in source files:
- If the header is in the same directory the source belongs to, so the
notation '#include ""' is used with the path relative to the directory
containing the source.
- If the header is outside the directory containing the source, then we use
the notation '#include <>' with the path relative to libraries folder.
Some of the advantages of such approach:
- Only one search path for libraries headers.
- OSs like Windows may have a better lookup time.
10 years ago
Andrew Tridgell
4fe092fead
AP_InertialSensor: panic on bad gyro or accel sample rates
10 years ago
Andrew Tridgell
d3b85eb792
AP_InertialSensor: use driver supplied sample rate
...
this will work with a wider range of sensors
10 years ago
Andrew Tridgell
f831c16238
AP_InertialSensor: use fixed sensor sample times
...
this uses fixed sample times for PX4 IMUs, rather than reported
timestamps. It avoids timing jitter caused by the over-sampling in
the PX4 drivers
10 years ago
Randy Mackay
0db7acc628
InertialSensor: calc vibration and accel clipping
10 years ago
Peter Barker
8be9e99fad
AP_InertialSensor_PX4: 64-bit timestamps for ACCx and GYRx messages
10 years ago
Andrew Tridgell
7d90033a36
AP_InertialSensor: support raw accel and gyro dataflash logging
10 years ago
Tom Pittenger
a4b8575432
InertialSensor: fix compile warnings re float constants
10 years ago
Jonathan Challinger
423160eaf8
AP_InertialSensor: publish delta_velocity_dt
10 years ago
Andrew Tridgell
23272e4013
AP_InertialSensor: added get_temperature() interface
...
this will allow logging of individual temperature sensors
10 years ago
Andrew Tridgell
3d7d46b9b0
AP_InertialSensor: replaced INS_MPU6K_FILTER with INS_ACCEL_FILTER and INS_GYRO_FILTER
...
this allows filtering to be set separately on accels and gyros where possible
10 years ago
Andrew Tridgell
5d0eb49114
AP_InertialSensor: calculate queue depth based on requested sample rate
...
this auto-scales the queue depth for plane, rover and copter
10 years ago
Jonathan Challinger
bc655ff0cc
AP_InertialSensor_PX4: add optional debug
10 years ago
Jonathan Challinger
074ee49cd0
AP_InertialSensor_PX4: interleave accel and gyro samples by time
10 years ago
Jonathan Challinger
addf80b669
AP_InertialSensor_PX4: explicitly configure sensors, publish deltas
10 years ago
Jonathan Challinger
155c173ed1
AP_InertialSensor: rename _rotate_and_offset to _publish
10 years ago
Andrew Tridgell
4537acb898
AP_InertialSensor: change for new PX4 device paths
10 years ago
Emile Castelnuovo
dae32984f1
AP_InertialSensor: use PX4 library for VRBRAIN boards.
10 years ago
LukeMike
6a93148b92
AP_InertialSensor: added library for VRBRAIN Inertial Sensor
10 years ago
Andrew Tridgell
b9adc6e466
AP_InertialSensor: prefer sensors that have zero error counts
...
if a sensor has failed in flight then try not to use it if another
error-free sensor is available
10 years ago
Andrew Tridgell
7c288e020b
AP_InertialSensor: fixed detection of dead IMU
...
if a PX4 sensor does not give new data we need to avoid calling
_rotate_and_offset_*() to avoid marking it as healthy. Otherwise if
the MPU6k dies we won't switch to the LSM303D automatically
10 years ago
Andrew Tridgell
a047d1f569
AP_InertialSensor: moved default filter and sample_rate to frontend
...
this simplifies the backends and prevents code repitition
11 years ago
Andrew Tridgell
3a9a5a9c18
AP_InertialSensor: implement gyro and accel health monitoring
...
sensor is healthy if it gave a sample on the last update()
11 years ago
Andrew Tridgell
586fa9a816
AP_InertialSensor: added product_id support
...
fill in parameter from first backend
11 years ago
Andrew Tridgell
a42af0f2f1
AP_InertialSensor: use common AP_InertialSensor driver for PX4 and VRBRAIN
11 years ago
Andrew Tridgell
d48beb0c0f
AP_InertialSensor: converted PX4 driver to new API
11 years ago
Andrew Tridgell
5c9e5fbc11
AP_InertialSensor: removed use of hrt_absolute_time()
11 years ago
Andrew Tridgell
ca12592448
AP_InertialSensor: allow for 3 accels and 3 gyros on Pixhawk
...
this supports FMUv3
11 years ago
Andrew Tridgell
2c85a7ba56
AP_InertialSensor: expose get_primary_accel() for use in AHRS
11 years ago
Andrew Tridgell
b1c5f23bbd
AP_InertialSensor: make get_delta_time() const
...
allows use from AP_NavEKF
11 years ago
Randy Mackay
b7565affcd
INS: add support for 400hz for PX4
11 years ago
Andrew Tridgell
6d39cf5e49
AP_InertialSensor: another attempt at fixing the spurious bad gyro health warnings
...
cope with _get_sample() not being called for a while
11 years ago
Andrew Tridgell
99e2dc87c9
AP_InertialSensor: prevent INS healthy errors while initialising
...
during gyro cal we shouldn't mark the gyro unhealthy
11 years ago
Andrew Tridgell
433ad19335
AP_InertialSensor: fixed loop limits
...
stops pointless operations
11 years ago