Siddharth Purohit
f55ee264a7
AP_Compass: reset compass ids not present after compass cal
...
also implement replacement mechanism for UAVCAN compasses
5 years ago
Siddharth Purohit
c0eb27cc35
AP_Compass: pull compass calibrator out into a separate thread
5 years ago
Andy Piper
63b5711a4d
AP_Compass: use a separate slot for the custom compass rotation
5 years ago
Andy Piper
b7b2d9a6ce
AP_Compass: add support for custom compass rotation via COMPASS_CUS_{ROLL,PIT,YAW}
...
add reboot required for parameters that need it
disable custom rotation on AP_Periph devices
5 years ago
Michael du Breuil
9b404669c8
AP_Compass: Skip rotating the mag data when the board orientation is none
5 years ago
Siddharth Purohit
8d227d401a
AP_Compass: modify compass driver to support consistent ordering and hotplugging
5 years ago
Andrew Tridgell
6fd0ca36aa
AP_Compass: added estimation of compass scale factor
...
this adds new COMPASS_SCALE, COMPASS_SCALE2 and COMPASS_SCALE3
parameters, which give the sensor scaling factor. It is used to
compensate for an incorrect scaling in a compass.
The 3D compass calibration process will set the correct value
automatically, otherwise users can set the value to a known value for
an existing compass
5 years ago
Andrew Tridgell
f4576ec8f3
AP_Compass: reduce firmware size for AP_Periph
6 years ago
Michael du Breuil
58dbbd6d0e
AP_Compass: Refactor battery current backend
6 years ago
Michael du Breuil
9fc954b030
AP_Compass: Reduce scope of BattMonitor include
6 years ago
Andrew Tridgell
9e7929adf6
AP_Compass: removed unusued AP_Common/Semaphore.h
6 years ago
Andrew Tridgell
925555c995
AP_Compass: move accum fields to frontend
...
this is needed to ensure they are per-instance. Without this the SITL
backend produces zero for all but the first instance. The same would
be true for any multi-instance backend
6 years ago
Andrew Tridgell
a260792e9e
AP_Compass: use WITH_SEMAPHORE()
...
and removed usage of hal.util->new_semaphore()
6 years ago
Lucas De Marchi
329516373c
AP_Compass: add common method to accumulate and drain samples
...
Instead of repeating on each driver the same sequence of steps,
let's move them to the common parent class. This only implements
it, but no driver was ported yet.
6 years ago
Lucas De Marchi
4039b51810
AP_Compass: stop passing frontend pointer
...
Let AP_Compass_Backend call AP::compass() *once* instead of passing
the frontend pointer over and over.
7 years ago
Jonathan Challinger
878e84a015
AP_Compass: correct edge case where checks pass when saved dev_id != detected dev_id
7 years ago
Andrew Tridgell
cbd6f4cc21
AP_Compass: fixed compass for tailsitters in SITL
7 years ago
Andrew Tridgell
2fe2c8fbda
AP_Compass: initialise compass IDs saved in SITL
...
this ensures we don't get uncalibrates compasses in SITL
7 years ago
Jacob Walser
6699c59ad3
AP_Compass: add support for custom board orientations
7 years ago
Andrew Tridgell
eccc4f375b
AP_Compass: fixed build warning
7 years ago
night-ghost
f26bb0cfbe
AP_Compass: added range filter to backend, added its use in some sensors (thanks khancyr for style correction)
7 years ago
Michael du Breuil
c66d15efd7
AP_Compass: Read current for compensation from the battery singleton
7 years ago
Andrew Tridgell
ca30f6aec8
AP_Compass: added per-motor compass calibration
...
this allows for a motor calibration vector per motor
7 years ago
Michael du Breuil
fb77d0739e
AP_Compass: Remove unused time calls, stash the time in the read loop
8 years ago
Andrew Tridgell
a440ac4c9d
AP_Compass: use a set_and_notify for external and IDs
...
ensure that GCS that connects quickly gets the right value
fixes issue #5364
8 years ago
Andrew Tridgell
2716ab8408
AP_Compass: added support for per-instance rotations
8 years ago
Andrew Tridgell
1c631ea037
AP_Compass: cleanup use of backend semaphores
...
fixed drivers that didn't protect accumulation counters
8 years ago
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.
8 years ago
Gustavo Jose de Sousa
ad91a810b3
AP_Compass: Backend: add method is_external()
9 years ago
Andrew Tridgell
88a1ebaf0e
AP_Compass: allow setting of exact timestamp in HIL compass
9 years ago
Andrew Tridgell
0e32c047c3
AP_Compass: allow for COMPASS_EXTERNAL=2 for forced external
...
this allows users with unusual compass bus connections to force the
compass to external
9 years ago
Lucas De Marchi
20a4a42cb3
AP_Compass: don't store raw and unfiltered fields
...
These are not used. The only place where raw fields are used are in the
compass calibrator and we don't need to store them.
Additionally remove duplicated documentation about the meaning of the
functions to avoid them getting out of sync.
9 years ago
Lucas De Marchi
e6059f5197
AP_Compass: rename files to follow other libraries
...
AP_Compass.h is the main header to be exported and AP_Compass.cpp its
implementation. There's no need for an additional header.
9 years ago
Caio Marcelo de Oliveira Filho
0d3fbbdd37
AP_Compass: use millis/micros/panic functions
9 years ago
Andrew Tridgell
4a8a24a1a2
AP_Compass: don't update last_update_usec for raw fields
...
this fixes a problem where the EKF gets compass samples at 50Hz
instead of the expected 10Hz
9 years ago
Lucas De Marchi
1a4a26de2b
AP_Compass: remove check for max compass instances
...
For all supported boards the maximum number of instances is 3. The
number of HIL_COMPASSES was already defined as 2 instead of 3, so this
is left as before.
9 years ago
Gustavo Jose de Sousa
0caaef7394
AP_Compass: mention mag field unit in existing documentation
...
We are now always using milligauss for mag field unit, so let's update
documentation accordingly.
9 years ago
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.
9 years ago
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
10 years ago
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.
10 years ago
Jonathan Challinger
72c8d0f530
AP_Compass: add samples to calibrator when published
10 years ago
Jonathan Challinger
f20ef69777
Compass: add soft-iron corrections
10 years ago
Jonathan Challinger
add1b8c257
AP_Compass: modify backend interface to push raw samples to frontend
10 years ago
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.
10 years ago
Randy Mackay
cedc9a8670
Compass: add last_update_usec per instance
10 years ago
Andrew Tridgell
015fce5183
AP_Compass: revert AP_Math class change
10 years ago
Tom Pittenger
ad11a57f57
AP_Compass: compiler warnings: apply is_zero(float) or is_equal(float)
10 years ago
Andrew Tridgell
1962706a33
AP_Compass: fixed last_update, using last_update_usec()
...
this broke use of compass in the EKF
10 years ago
Andrew Tridgell
0efd3bacea
AP_Compass: make new backend match old PX4 behaviour
...
when a compass is internal only apply board orientation, not user
specified rotation
10 years ago
Andrew Tridgell
a871c87cad
AP_Compass: use state array for compass variables
10 years ago