Commit Graph

92 Commits

Author SHA1 Message Date
Andrew Tridgell d6c258e9d0 AP_Declination: update magnetic field tables
now using igrf13
2023-01-03 11:01:32 +11:00
Andy Piper 41c319e257 AP_Declination: avoid undefined floating point exceptions on macOS when using implicit casts 2022-08-24 17:34:17 +10:00
Andy Piper b112f8dba1 AP_Declination: ensure indexing into declination tables is always correct
add constants for table sizes
2022-03-15 10:15:22 +11:00
murata 66193bde3a AP_Declination: Remove meaningless semicolons 2022-02-07 08:27:34 +09:00
Jaaaky bfb9b1ac73 AP_Declination: Fix multi #include's 2021-12-21 10:38:46 +11:00
Andrew Tridgell eacdd017d7 AP_Declination: added a test suite for AP_Declination
use test vectors from MAVProxy mavextra
2021-09-03 14:45:17 +10:00
Andrew Tridgell 71c5c624ce AP_Declination: fixed rounding in mag field
thanks to Angela for noticing this
2021-09-03 14:45:17 +10:00
Andrew Tridgell 7b4b88d568 AP_Declination: re-generate mag tables
max interpolate error between -60 and 60 latitude is 13.86 mGauss
2019-12-24 11:33:10 +11:00
Andrew Tridgell 79bbd3ce9f AP_Declination: update generate script
added ability to display max error
2019-12-24 11:33:10 +11:00
Andrew Tridgell be62bf32cb AP_Declination: added get_earth_field_ga() interface
this gives a more convenient API for getting the earth field as a
vector
2019-06-03 12:21:29 +10:00
Andrew Tridgell 0f7281fbb6 AP_Declination: added generator doc 2019-04-09 10:12:14 +10:00
Peter Barker 57b33acb89 AP_Declination: generate tables with float designator 2019-04-08 12:59:17 -07:00
Michael du Breuil 0c6b382f2a AP_Declination: Remove unneeded AP_Buffer include 2018-12-31 11:41:43 +09:00
Michael du Breuil f06b27e4a3 AP_Declination: Fixes ups for pyigrf 2018-09-04 09:02:25 +10:00
scivision 67a503d5d8 AP_Declination: 2to3, IGRF API update
use built-in IGRF total, incl, decl computations
2018-09-04 09:02:25 +10:00
Andrew Tridgell 27442e4a7b AP_Declination: use floorf() 2018-05-07 11:43:23 +10:00
Peter Barker 36fab0209e AP_Declination: flake8 compliance for new generate script 2018-03-07 14:36:24 +00:00
Andrew Tridgell c642deafde AP_Declination: updated tables for Feb 2018 2018-03-03 09:56:57 +11:00
Andrew Tridgell 444588aaef AP_Declination: added generation of field tables
we can re-generate with a python script. This also extends the tables
from -90 to +90 latitude
2018-03-03 09:56:57 +11:00
Andrew Tridgell 03b1fdca97 AP_Declination: split tables into a separate file
to make re-generation easier
2018-03-03 09:56:57 +11:00
Andrew Tridgell 252fc9c757 AP_Declination: added inclination and intensity tables
moved from SITL/SIM_Aircraft.h
2018-02-08 17:36:33 +11:00
Pierre Kancir 7fb816c812 AP_Declination: example fix travis warning
missing function declaration
implicit cast
some style fix
2017-04-13 19:56:16 +01:00
murata 37873717de AP_Declination: Unify from print or println to printf. 2017-01-27 18:20:22 +11:00
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 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
Ricardo de Almeida Gonzaga af13e2cca4 AP_Declination: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga 5bd034a5a8 Global: start using cmath instead of math.h 2016-04-05 21:06:19 -07: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
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 88319f52f7 AP_Declination: remove line continuation slashes
These are not necessary and only clutter the code.
2015-12-27 15:58:12 -02:00
Lucas De Marchi 3ae0082f52 AP_Declination: stop using Progmem.h
Since the headers were re-ordered we also had to add inttypes.h to
AP_Declination.h following a include-what-you-use approach.
2015-12-27 15:58:12 -02:00
Caio Marcelo de Oliveira Filho 6e7b73610d waf: add waf support 2015-12-03 07:54:30 +11:00
Caio Marcelo de Oliveira Filho 0ae2fe6fcd AP_Declination: example uses millis/micros/panic functions 2015-11-20 12:30:27 +09:00
Andrew Tridgell 8f4ce7f20b build: removed all nocore.inoflag files
these were APM2 specific
2015-11-16 08:05:17 +11:00
Andrew Tridgell c81d4fa07b AP_Declination: fixed example build 2015-11-16 07:59:18 +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
Lucas De Marchi 1b07dabeb7 Replace prog_char and prog_char_t with char
prog_char and prog_char_t are now the same as char on supported
platforms. So, just change all places that use them and prefer char
instead.

AVR-specific places were not changed.
2015-10-30 14:35:30 +09:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Lucas De Marchi e4b313d2ca Replace use of memcpy_P() with memcpy() 2015-10-30 14:35:11 +09:00
Caio Marcelo de Oliveira Filho 918a339660 AP_Declination: remove unnecessary board include from example 2015-10-21 09:16:12 +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 23f634835d AP_Declination: 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 c18c84fbe1 AP_Declination: convert example from .pde to .cpp 2015-06-01 16:58:11 +10:00
Andrew Tridgell 2502ca3ec7 AP_Declination: fixed example build 2014-08-13 22:11:30 +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 82aec0ef6c AP_Declination: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell 261eb6d841 AP_Declination: fixed example build 2013-05-02 12:48:14 +10:00