Commit Graph

44 Commits

Author SHA1 Message Date
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Lucas De Marchi 9c6bd38e91 AP_InertialSensor: sanitize includes
Due to the way the headers are organized changing a single change in an
inertial sensor driver would trigger a rebuild for most of the files in
the project. Time could be saved by using ccache (since most of the
things didn't change) but we can do better, i.e. re-organize the headers
so we don't have to re-build everything.

With this patch only AP_InertialSensor/AP_InertialSensor.h is exposed to
most users. There are some corner cases to integrate with some example
code, but most of the places now depend only on this header and this
header doesn't depend on the specific backends.

Now changing a single header, e.g. AP_InertialSensor_L3G4200D.h triggers
a rebuild only of these files:

	$ waf copter
	'copter' finished successfully (0.000s)
	Waf: Entering directory `/home/lucas/p/dronecode/ardupilot/build/minlure'
	[ 80/370] Compiling libraries/AP_InertialSensor/AP_InertialSensor.cpp
	[ 84/370] Compiling libraries/AP_InertialSensor/AP_InertialSensor_L3G4200D.cpp
	[310/370] Linking build/minlure/ArduCopter/libArduCopter_libs.a
	[370/370] Linking build/minlure/bin/arducopter
	Waf: Leaving directory `/home/lucas/p/dronecode/ardupilot/build/minlure'
2016-02-01 14:18:51 -02:00
Andrew Tridgell ccd915eb67 AP_InertialSensor: moved raw gyro and accel logging to common code
this brings raw logging to non-PX4 ports
2015-11-16 17:57:35 +11:00
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
2015-11-16 17:57:35 +11:00
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
2015-11-16 17:57:35 +11:00
Lucas De Marchi 5244559010 Minimize AP_Progmem.h includes
Most of AP_Progmem is already gone so we can stop including it in most
of the places. The only places that need it are the ones using
pgm_read_*() APIs.

In some cases the header needed to be added in the .cpp since it was
removed from the .h to reduce scope. In those cases the headers were
also reordered.
2015-10-30 14:35:32 +09:00
Gustavo Jose de Sousa 4e83f7b02c AP_InertialSensor: PX4: don't calculate delta angle
Delta angle calculation will be unified.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa f769a39449 AP_InertialSensor: PX4: don't calculate delta velocity
Delta velocity calculation will be unified.
2015-10-22 16:31:07 +11:00
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.
2015-08-11 16:28:43 +10:00
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
2015-06-17 13:03:56 +10:00
Jonathan Challinger 423160eaf8 AP_InertialSensor: publish delta_velocity_dt 2015-04-03 14:54:06 -07:00
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
2015-03-12 12:50:31 +11:00
Andrew Tridgell 5d0eb49114 AP_InertialSensor: calculate queue depth based on requested sample rate
this auto-scales the queue depth for plane, rover and copter
2015-03-12 12:50:30 +11:00
Jonathan Challinger bc655ff0cc AP_InertialSensor_PX4: add optional debug 2015-03-12 12:50:28 +11:00
Jonathan Challinger 074ee49cd0 AP_InertialSensor_PX4: interleave accel and gyro samples by time 2015-03-12 12:50:28 +11:00
Jonathan Challinger addf80b669 AP_InertialSensor_PX4: explicitly configure sensors, publish deltas 2015-03-12 12:50:27 +11:00
Emile Castelnuovo dae32984f1 AP_InertialSensor: use PX4 library for VRBRAIN boards. 2015-02-02 08:43:59 +11:00
LukeMike 6a93148b92 AP_InertialSensor: added library for VRBRAIN Inertial Sensor 2015-02-02 08:43:58 +11:00
Andrew Tridgell aeaa3c1e04 AP_InertialSensor: fixed build for VRBrain 2014-10-24 12:10:41 +11:00
Andrew Tridgell a047d1f569 AP_InertialSensor: moved default filter and sample_rate to frontend
this simplifies the backends and prevents code repitition
2014-10-24 12:10:40 +11:00
Andrew Tridgell d48beb0c0f AP_InertialSensor: converted PX4 driver to new API 2014-10-24 12:10:37 +11:00
Andrew Tridgell 2c85a7ba56 AP_InertialSensor: expose get_primary_accel() for use in AHRS 2014-02-27 16:27:46 +11:00
Randy Mackay 33fe778cdd InertialSensor_PX4: resolve compiler warning 2014-02-21 13:53:34 +09:00
Andrew Tridgell b1c5f23bbd AP_InertialSensor: make get_delta_time() const
allows use from AP_NavEKF
2014-02-15 05:29:47 +11:00
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
2013-12-14 15:47:49 +11:00
Andrew Tridgell cba0cb963a AP_InertialSensor: auto-failover to working gyro and accel 2013-12-09 20:02:04 +11:00
Andrew Tridgell a0688a69d4 AP_InertialSensor: generalise the accel/gyro calibration for N sensors 2013-12-09 17:34:06 +11:00
Andrew Tridgell d9b6f7f0f7 AP_InertialSensor: implement up to two sensors on PX4 2013-12-09 17:34:05 +11:00
Andrew Tridgell f10a4b04ae AP_InertialSensor: make PX4 healthy call _get_sample()
this prevents a false positive during times like arming where we are
not reading the sensors
2013-11-10 17:03:16 +11:00
Andrew Tridgell f5299e2e11 AP_InertialSensor: added healthy check for PX4 and HIL
used to detect bad accels
2013-11-07 13:53:59 +11:00
Andrew Tridgell 8532e2bff8 AP_InertialSensor: fixed timing of PX4 sensor samples 2013-10-13 22:15:50 +11:00
Andrew Tridgell e5e4cdee18 AP_InertialSensor: added wait_for_sample() API call
this waits for a new INS sample to arrive, using whatever method is
most efficient on each INS type
2013-10-08 17:31:15 +11:00
Andrew Tridgell 14636e1cdf AP_InertialSensor: changed num_samples_available() to sample_available()
this makes the interface clearer. It also fixes a 3D accel cal bug.
2013-09-27 10:49:00 +10:00
Andrew Tridgell e5ad9dbd15 AP_InertialSensor: switch PX4 driver to fixed time per sample model
this makes the driver much simpler, and does away with the need for an
accumulate function
2013-08-30 13:01:33 +10:00
Andrew Tridgell 38fe89d661 AP_InertialSensor: switch to non-averaging system for PX4 IMUs
always use the latest value, based on a lowpass filter in the driver
2013-08-30 13:01:33 +10:00
Andrew Tridgell 46c5d18585 AP_InertialSensor: disable averaging on FMUv2
the new filter from Leonard means we shouldn't average values, and
instead just use the last value
2013-08-30 13:01:33 +10:00
Andrew Tridgell 76e20150e9 AP_InertialSensor: ensure parent class is initialised in instance classes 2013-04-12 14:30:35 +10:00
Andrew Tridgell 1121254606 AP_InertialSensor: added filter frequency support to PX4 driver 2013-02-07 11:20:45 +11:00
Andrew Tridgell 5643c371b9 AP_InertialSensor: removed unused new_data_available() and temperature() APIs 2013-02-07 10:23:37 +11:00
Andrew Tridgell f60d657f72 AP_InertialSensor: added timer for accumulating samples for PX4
this makes the driver much more tolerant of sketch timing errors
2013-01-21 21:51:32 +11:00
Andrew Tridgell 3d0cb755d2 AP_InertialSensor: user a timer to drive data collection on PX4
this reduces the chance of missing a sample if the main sketch is a
bit slow
2013-01-21 19:44:01 +11:00
Andrew Tridgell 16d72ca160 AP_InertialSensor: update PX4 driver to use read() method 2013-01-20 22:13:20 +11:00
Andrew Tridgell 6142eac4b4 AP_InertialSensor: simplify get_delta_time() API
use a single float return rather than two APIs.

This also changes the MPU6k driver to match the new 2.9 behaviour of
using the MPU6k sample timing instead of micros()
2013-01-11 21:17:21 +11:00
Andrew Tridgell ae09b31176 AP_InertialSensor: added PX4 gyro/accel driver 2013-01-04 14:25:57 +11:00