Commit Graph

44 Commits

Author SHA1 Message Date
Gustavo Jose de Sousa 9927cf066f AP_Compass: remove use of milligauss_ratio
Now, we have all current compasses publishing their values already in
milligauss, so there's no need for that variable anymore.
2015-10-15 19:56:14 +09:00
Andrew Tridgell c59bdc12df AP_Compass: fix the milligauss handling
the previous approach assumed a 1:1 mapping between compass backends
and compass instances, which isn't true on PX4.

It also only setup milligauss offsets on a set_and_save call, which is
not the only way offsets change

this adds a milligauss_ratio per instance, which is considerably
simpler
2015-09-09 14:53:11 +10:00
Staroselskii Georgii c207d8c6a8 AP_Compass: add milligauss counterparts to get_field() and get_offsets()
From now on there's a pair get_field_milligauss() and
get_offsets_milligauss() that can make the transition to the common
units across all compasses easier.
2015-09-09 10:38:16 +10:00
Jonathan Challinger 5fe6db0dc9 AP_Compass_PX4: use new compass backend interface 2015-09-03 16:59:09 +10:00
Gustavo Jose de Sousa 58f300e78e AP_Compass: 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:42 +10:00
Andrew Tridgell 86fc90f54c AP_Compass: removed spurious rotation in PX4 backend
and cleanup rotation macros
2015-03-14 08:52:37 +11:00
Andrew Tridgell 8f6982860f AP_Compass: fixed devid for 2nd compass 2015-03-13 20:46:32 +11:00
Andrew Tridgell 7b51c907f5 AP_Compass: zero some more variables in constructor and init 2015-03-13 19:22:11 +11:00
Andrew Tridgell a871c87cad AP_Compass: use state array for compass variables 2015-03-13 18:46:15 +11:00
Víctor Mayoral Vilches d3b76cd8d3 AP_Compass: split compass into frontend/backend 2015-03-13 18:46:15 +11:00
Andrew Tridgell 99ed508903 AP_Compass: change for new PX4 paths 2015-02-14 12:25:43 +11:00
Jonathan Challinger 9054dd3f9a AP_Compass: use apply_correction_function to eliminate duplication 2014-10-19 17:02:45 +11:00
Randy Mackay 85e82a0399 Compass_PX4: use instance specific orient and external 2014-10-01 13:02:03 +10:00
Randy Mackay 01fa4ba619 Compass_PX4: primary compass based on use_for_yaw 2014-10-01 13:02:02 +10:00
Andrew Tridgell 9f6d1f987b AP_Compass: removed use of hrt_absolute_time() 2014-08-20 08:41:28 +10:00
Randy Mackay a6c29ba1c3 Compass_PX4: get_primary made public 2014-07-22 22:01:23 +09:00
Randy Mackay f42c9579d7 Compass: add dev_id for PX4
dev_id is retrieved from PX4Firmware via ioctl call
2014-07-10 20:24:46 +09:00
Andrew Tridgell c138244155 AP_Compass: support 3 mags on PX4 2014-07-04 12:07:47 +10:00
Andrew Tridgell 2d9e9d9bc3 AP_Compass: added COMPASS_PRIMARY parameter
this allows selection of which compass is the primary. Useful if the
first compass starts giving spurious data (as happened in our plane)
2014-05-25 22:03:44 +10:00
Andrew Tridgell 485ae596fc AP_Compass: fixed last_update for secondary compass with primary failed
this ensures EKF and DCM will use a secondary compass if the primary
fails
2014-03-23 22:05:17 +11:00
Matthew Lloyd 60a4f74de6 AP_Compass: avoid division by zero if we haven't received any mag reports
Otherwise, get_field() will return NaNs after once every few calls to
read() during compassmot on PX4 platforms, which causes compassmot to fail.

This is a quick hack around the deeper issue, which could be something
like the PX4 mag driver experiencing starvation and skipping mag reports,
buffer overrun or something else that causes mag reports to be dropped.
Or perhaps we should never expect in the first place that we will always
receive at least one mag report between calls to read().
2014-03-23 21:22:32 +11:00
Andrew Tridgell db48ed9218 AP_Compass: fixed showing of is_external for 2nd compass 2014-03-13 16:26:43 +11:00
Andrew Tridgell c44d8b45ce AP_Compass: auto-select healthy compass 2013-12-09 20:01:42 +11:00
Andrew Tridgell 61f564d7c9 AP_Compass: support motor compensation for multiple compasses
Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
2013-12-09 19:45:31 +11:00
Andrew Tridgell 0a7a935f63 AP_Compass: fixup 2013-12-09 17:54:54 +11:00
Andrew Tridgell c538816825 AP_Compass: support compass health status on multiple compasses 2013-12-09 17:46:41 +11:00
Andrew Tridgell bde89fd4e2 AP_Compass: added compass offsets for 2nd compass 2013-12-09 17:34:07 +11:00
Andrew Tridgell 8a97042fb1 AP_Compass: updates to support multiple compasses 2013-12-09 17:34:07 +11:00
Andrew Tridgell cb16733918 AP_Compass: switched to a vector based interface
this is more consistent with other APIs and makes multi-device support
easier
2013-12-09 17:34:06 +11:00
Andrew Tridgell 229841052a AP_Compass_PX4: removed MAGIOCSSAMPLERATE call 2013-09-09 18:04:41 +10:00
Andrew Tridgell db14a85fc5 AP_Compass: added more debugging to AP_Compass_PX4 driver
this helps debug compass initialisation issues
2013-09-09 18:04:40 +10:00
Andrew Tridgell b8b72819c1 AP_Compass: ignore COMPASS_ORIENT for internal compass
this means if COMPASS_ORIENT is not 0 and the external compass fails
to start on boot we don't end up with a bad compass orientation
2013-09-07 16:49:51 +10:00
Andrew Tridgell fbf79c07f0 AP_Compass: added COMPASS_EXTERNAL option
this allows configuring of a compass as being externally attached
2013-08-30 14:02:09 +10:00
Andrew Tridgell 97b7130bb9 libraries: update license header to GPLv3
we switched to GPLv3 a long time ago, but neglected to update the
per-file license headers
2013-08-30 13:01:39 +10:00
Andrew Tridgell 1ff669eb97 AP_Compass: simplify PX4 compass driver
we can now rely on queueing in the NuttX driver
2013-08-30 13:01:34 +10:00
Andrew Tridgell 86027f6e0f AP_Compass: fixed PX4 build 2013-05-02 13:00:52 +10:00
Andrew Tridgell 217f34e155 AP_Compass: added COMPASS_ORIENT parameter, to support external compasses
this allows the user to configure the compass for any orientation
supported by our rotation library
2013-05-02 12:48:14 +10:00
Andrew Tridgell 0fce0eb488 AP_Compass_PX4: fixed handling of a saturated compass
a saturated compass is now marked unhealthy, rather than causing the
code to spin waiting for a valid sample. This fixes a problem with
strong magnets causing the main flight loop to stop
2013-05-01 08:54:53 +10:00
Randy Mackay b8d492b504 Compass: current based compensation added 2013-03-03 23:02:12 +09:00
Randy Mackay d8515ff85e Compass: basic compensation for motor interference 2013-03-02 00:03:16 +09:00
Andrew Tridgell 80eaa52ed8 AP_Compass: use report timestamp on PX4 for accurate timing 2013-01-22 21:22:01 +11:00
Andrew Tridgell 60a4447a86 AP_Compass: added set_board_orientation() method 2013-01-13 17:32:48 +11:00
Andrew Tridgell 26bc278181 AP_Compass: use queue length 10 in PX4 driver
and remove unnecessary poll() call
2013-01-04 20:12:03 +11:00
Andrew Tridgell 741174f5d5 AP_Compass: first cut at a PX4 compass driver 2013-01-04 16:21:24 +11:00