Tom Pittenger
16e71ec1ce
Compass: fix compile warning re member init order
10 years ago
Tom Pittenger
bf1d128d70
Compass: fix compile warnings re float constants
...
Also fix example sketch
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
7b51c907f5
AP_Compass: zero some more variables in constructor and init
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
Víctor Mayoral Vilches
13f0aa5ecd
AP_Compass: Separate common code into backend
...
_copy_to_frontend function takes care of abstracting
this code from the driver. For now the function takes
care of the offset and rotation that is common.
10 years ago
Víctor Mayoral Vilches
d3b76cd8d3
AP_Compass: split compass into frontend/backend
10 years ago
Staroselskii Georgii
7f00dd413f
AP_Compass: fixed HMC5883's initialisation code
10 years ago
Jonathan Challinger
9054dd3f9a
AP_Compass: use apply_correction_function to eliminate duplication
10 years ago
Randy Mackay
86aac4f40c
Compass_HMC5843: use instance specific orient and external
11 years ago
Andrew Tridgell
54562b0b9a
AP_Compass: prevent bad initial values from affecting HMC5883 calibration
...
the first couple of values after we enter strap mode may be low, but
just above our 0.7 threshold. We now discard the first two values to
prevent these affecting the average.
Also added some commented out debug code and a comment on the scaling
of the calibration code
11 years ago
Andrew Tridgell
61f564d7c9
AP_Compass: support motor compensation for multiple compasses
...
Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
11 years ago
Andrew Tridgell
c538816825
AP_Compass: support compass health status on multiple compasses
11 years ago
Andrew Tridgell
bde89fd4e2
AP_Compass: added compass offsets for 2nd compass
11 years ago
Andrew Tridgell
8a97042fb1
AP_Compass: updates to support multiple compasses
11 years ago
Andrew Tridgell
cb16733918
AP_Compass: switched to a vector based interface
...
this is more consistent with other APIs and makes multi-device support
easier
11 years ago
Randy Mackay
84fdff4cd6
Compass: slightly relax HMC5843 calibration limits
...
Some users have reported Z axis values as high as 1.33. Their compasses
seem otherwise health so extending the limits slightly.
11 years ago
Andrew Tridgell
1ccd6bb7ef
AP_Compass: don't wait more than 1ms for compass sample
...
this prevents 5ms delays in compass accumulate
12 years ago
Andrew Tridgell
83c942a512
AP_Compass: prevent NULL deref on enable mag while running
12 years ago
Andrew Tridgell
da14ad2e2d
AP_Compass: neaten up HMC5883 debug
12 years ago
Andrew Tridgell
6fc5b06043
AP_Compass: fixed some old Serial.print calls
12 years ago
Mike McCauley
4c65c42411
AP_Compass: fixed ARM 32 bit compatibility
12 years ago
Andrew Tridgell
fbf79c07f0
AP_Compass: added COMPASS_EXTERNAL option
...
this allows configuring of a compass as being externally attached
12 years ago
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
12 years ago
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
12 years ago
Christopher Hrabia
9760cdf2d7
Compass: corrected space
12 years ago
Randy Mackay
b8d492b504
Compass: current based compensation added
12 years ago
Randy Mackay
bfb29ce22b
Compass: remove virtual functions to save RAM
12 years ago
Randy Mackay
d8515ff85e
Compass: basic compensation for motor interference
12 years ago
James Bielman
4fa7bb1486
Add AVR compatibility header for missing math.h definitions.
...
- Define float versions of math functions to the double versions
on AVR (eg. #define sinf sin).
- These macros appear to be missing in older versions of avr-libs.
- Include AP_Math.h rather than math.h to get these definitions.
12 years ago
James Bielman
5631f865b2
Update floating point calculations to use floats instead of doubles.
...
- Allows use of hardware floating point on the Cortex-M4.
- Added "f" suffix to floating point literals.
- Call floating point versions of stdlib math functions.
12 years ago
Andrew Tridgell
60a4447a86
AP_Compass: added set_board_orientation() method
12 years ago
Andrew Tridgell
8f424cdf21
AP_Compass: ensure we check we got the semaphore
12 years ago
James Bielman
eca1417858
AP_HAL: Add semaphores to I2C driver.
...
- Guard I2C transactions with this semaphore in the MS5611 and
HMC5843 drivers.
12 years ago
Andrew Tridgell
b70f7f57ba
AP_Compass: restore low speed change on register read failure
12 years ago
Pat Hickey
53432a1101
AP_Compass: ported to AP_HAL
12 years ago
Andrew Tridgell
daa4712078
AP_Compass: force I2C speed low in a couple more situations
12 years ago
Andrew Tridgell
6922dcdea2
Compass: added compass.accumulate() API
...
this allows us to accumulate mag readings using spare CPU cycles
13 years ago
uncrustify
4f9c6bbb19
uncrustify libraries/AP_Compass/AP_Compass_HMC5843.cpp
13 years ago
Andrew Tridgell
7daaadf776
Compass: fixed the order of rotations in the compass driver
...
this should fix the massive heading issues that people have been
reporting. Please test!
13 years ago
Andrew Tridgell
0da64e98f8
Compass: don't save the orientation to EEPROM
...
there is no point in saving this, the value is only configurable at
compile time for now, and is always set
13 years ago
Andrew Tridgell
cb96dd975f
Compass: update the compass driver to use the new vector.rotate() method
13 years ago
Andrew Tridgell
6eff9107ea
Compass: change last_update to be in microseconds
13 years ago
Andrew Tridgell
d0a6359b37
Compass: use constructor to set initial values for _learn and _use_for_yaw
...
this ensures they are set if you have MAG_ENABLE==0
13 years ago
Andrew Tridgell
f59297d7a7
Compass: catch the case of a user enabling a compass mid-flight
...
if a compass has not been initialised at startup we can't enable it
mid-flight, as we don't have the orientation
13 years ago
Andrew Tridgell
664622523d
Compass: added COMPASS_LEARN and COMPASS_USE parameters
...
these allow you to control if the compass should be used for yaw and
if it should learn its offsets. This is useful for locking in compass
offsets once they are confirmed to be good, and for learning offsets
without using them in flights.
The default is to behave the same as previously, which is
COMPASS_LEARN=1 and COMPASS_USE=1
13 years ago
Andrew Tridgell
8c58d95187
modify the compass code for AP_Param
13 years ago
Randy Mackay
ed19c25a97
Arduino 1.0 - changed all #includes of "WProgram.h", "wiring.h" and "WConstants.h to "Arduino.h".
...
Modified FastSerial's write function to return size_t (number of bytes written).
13 years ago
Andrew Tridgell
60185509f4
AP_Compass: when I2c fails, don't retry for 1s
13 years ago