Commit Graph

83 Commits

Author SHA1 Message Date
Peter Barker 6193d6cf69 AP_Compass: fix example by instantiating Baro
Baro is required to get location, and Compass tries to get the declination based on current location
2019-09-13 08:54:21 +09:00
Peter Barker 7b52c41287 AP_Compass: fix example by instantiating serial_manager 2019-07-01 19:11:03 +10:00
Pierre Kancir 427a88a1fe AP_Compass: fix AP_Compass_test 2019-05-01 14:17:34 -07:00
Peter Barker 7ae7c48362 AP_Compass: remove set_and_save_offsets taking integer parameters
because the only caller that mattered had floats to offer...
2019-04-05 06:09:25 -07:00
Sagnik Bhattacharya 4c809888de AP_Compass: add more comments to example 2019-04-02 19:41:45 +11:00
Peter Barker 2d16c37844 AP_Compass: examples: compass init never fails 2019-03-13 13:06:50 +11:00
Randy Mackay c88926f227 Compass: remove accumulate from example sketch 2018-08-06 11:05:34 +10:00
Andrew Tridgell 57a3bc1397 AP_Compass: new compass learning system
this learns compass offsets using magnetic tables and compass
observations
2018-02-08 17:36:33 +11:00
Andrew Tridgell f326377a5c AP_Compass: removed create() method for objects
See discussion here:

  https://github.com/ArduPilot/ardupilot/issues/7331

we were getting some uninitialised variables. While it only showed up in
AP_SbusOut, it means we can't be sure it won't happen on other objects,
so safest to remove the approach

Thanks to assistance from Lucas, Peter and Francisco
2017-12-14 08:12:28 +11:00
Lucas De Marchi 69b6d95cb2 global: use static method to construct AP_Board_Config{,_CAN} 2017-09-26 03:01:21 +01:00
Lucas De Marchi c1a957fbf3 global: use static method to construct Compass 2017-09-26 03:01:21 +01:00
Pierre Kancir d3e27d8720 AP_Compass: example fix travis warning
missing function declaration
implicit cast
some style fix
2017-04-13 19:56:16 +01:00
murata af47a8e91c AP_Compass: Unify from print or println to printf. 2017-01-27 18:20:22 +11:00
Lucas De Marchi ae53920e5b build: don't build examples with old build system
We currently check examples are buildable with waf which doesn't need
the libraries to be specified in a make.inc file.  Having the makefiles
there is misleading since people try to build and realize the build is
broken.
2016-10-11 13:03:08 +11:00
Andy Little 0d113b265c Examples: fix examples for px4
The change to use AP_BoardConfig messed up the examples. Here are some
updated but there are plenty more to do.
2016-10-04 12:50:47 -03:00
Lucas De Marchi 4595a2b7d8 AP_Compass: Remove i2c lockup count
This was returned only for a single bus and on all supported platforms
this is hardcoded to 0.
2016-07-28 18:03:09 -03:00
Gustavo Jose de Sousa e5de4f2348 AP_Compass: AP_Compass_test: code enhancements
- Use panic() instead of looping forever.
- Readability improvement with the use of MAX() and MIN().
2016-03-09 10:12:14 -03:00
Gustavo Jose de Sousa a61f9855d3 AP_Compass: AP_Compass_test: report multiple compasses
Report data from all available compasses, not just the primary one.
2016-03-09 10:12:10 -03:00
Gustavo Jose de Sousa 16acca865f AP_Compass: AP_Compass_test: fix style
Used uncrustify and some manual changes.
2016-03-09 10:12:05 -03:00
Gustavo Jose de Sousa c2e3f05dbf waf: ardupilotwaf: prefix build context methods with ap_
It helps to distinguish between things from waf and things from ardupilotwaf.
2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa 3d22490397 waf: examples: use methods from bld instead of ardupilotwaf 2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa d281067bcc waf: make example binaries be placed in 'examples' dir
This commit makes examples' wscripts use ardupilotwaf.example() instead of
ardupilot.program().
2016-01-15 16:46:41 -02:00
Jonathan Challinger 9b5644fdb6 AP_Compass: fix example build 2015-12-29 10:46:35 -08:00
Lucas De Marchi a096703b06 Global: don't link with AP_Progmem
AP_Progmem is not used anymore.
2015-12-27 15:58:12 -02:00
Lucas De Marchi 0bcbcd07cc AP_Compass: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Caio Marcelo de Oliveira Filho 6e7b73610d waf: add waf support 2015-12-03 07:54:30 +11:00
Caio Marcelo de Oliveira Filho cd7cfdef91 AP_Compass: examples use millis/micros/panic functions 2015-11-20 12:30:20 +09:00
Andrew Tridgell 8f4ce7f20b build: removed all nocore.inoflag files
these were APM2 specific
2015-11-16 08:05:17 +11:00
Caio Marcelo de Oliveira Filho a3169d0a34 AP_Compass: remove unnecessary includes from example 2015-10-21 09:16:11 +11:00
Caio Marcelo de Oliveira Filho ec52df991c build: compile only the HAL files needed by the board
Instead of requiring every program to specify the HAL related modules,
let the build system do it (in practice everything we compiled depended
on HAL anyway). This allow including only the necessary files in the
compilation.
2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 2e464a53c2 AP_HAL: make code not depend on concrete HAL implementations
The switching between different AP_HAL was happening by giving different
definitions of AP_HAL_BOARD_DRIVER, and the programs would use it to
instantiate.

A program or library code would have to explicitly include (and depend)
on the concrete implementation of the HAL, even when using it only via
interface.

The proposed change move this dependency to be link time. There is a
AP_HAL::get_HAL() function that is used by the client code. Each
implementation of HAL provides its own definition of this function,
returning the appropriate concrete instance.

Since this replaces the job of AP_HAL_BOARD_DRIVER, the definition was
removed.

The static variables for PX4 and VRBRAIN were named differently to avoid
shadowing the extern symbol 'hal'.
2015-10-21 09:16:07 +11:00
Gustavo Jose de Sousa 99a55f9379 AP_Compass: use compass get_{field,offsets}() functions
Both functions are equivalent, so we're going to simply use
get_{field,offsets}() instead of get_{field,offsets}_milligauss().
2015-10-15 19:56:02 +09:00
Randy Mackay 825abdbedc Compass: example sketch displays in milligauss 2015-10-07 21:35:24 +09: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 d6a1bd98e6 AP_Compass: convert example from .pde to .cpp 2015-06-01 16:58:11 +10:00
Randy Mackay ade4f81c77 Compass: fix example sketch 2015-05-15 11:53:28 +09:00
Tom Pittenger bf1d128d70 Compass: fix compile warnings re float constants
Also fix example sketch
2015-04-24 12:29:07 +09:00
Andrew Tridgell c8b0970e61 AP_Compass: show compass count in example 2015-03-14 20:00:29 +11:00
Andrew Tridgell f4455d063e AP_Compass: fixed example 2015-03-14 17:07:39 +11:00
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
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
Randy Mackay 635ff92d6b Compass: fix example sketch 2015-01-28 17:15:39 +09:00
mirkix 9a65a8c8fb AP_Compass: add AK8963 to auto-detect in test suite 2015-01-22 14:34:23 +11:00
mirkix e9d4165a8d AP_Compass: add AK8963 support to test suite 2015-01-22 14:34:17 +11:00
Andrew Tridgell a686494127 AP_Compass: fixed example build 2014-11-28 10:40:34 +11:00
Andrew Tridgell c49981c03d AP_Compass: fixed example build 2014-08-13 22:11:25 +10:00
Andrew Tridgell 1e20f89f90 AP_Compass: use HAL_COMPASS_DEFAULT in example code 2014-07-14 09:44:36 +10:00
Randy Mackay cf7e1a6339 Compass: example sketch update for set_and_save_offsets 2014-07-10 20:25:13 +09:00
Andrew Tridgell 9bb8f73d56 Compass: split compass learning out to its own C++ file 2014-02-16 13:21:06 +11:00
Andrew Tridgell c538816825 AP_Compass: support compass health status on multiple compasses 2013-12-09 17:46:41 +11:00