Commit Graph

119 Commits

Author SHA1 Message Date
Andrew Tridgell e2eda63d2c AP_Math: added new rotation for PITCH_7 2019-05-29 17:12:32 +10:00
Pierre Kancir 1854681e09 AP_Math: use past_interval_finish_line and line_path_proportion from Location 2019-04-23 09:20:43 +10:00
Pierre Kancir 88b29ff18c AP_Math: move get_bearing_cd to Location and rename to get_bearing_to 2019-04-06 09:10:28 +11:00
Dr.-Ing. Amilcar do Carmo Lucas 65ccef04b9 AP_Math: replace location_offset() and get_distance() C function calls with Location object member (C++) function calls
This allows removing duplicated code in the AP_Math/location.cpp file
2019-02-28 11:44:09 +11:00
Peter Barker 2fa0b61f8b AP_Math: update example/test for Location_Class merge 2019-01-16 11:45:29 +11:00
Andrew Tridgell 61c8dfac31 AP_Math: split out double precision location functions
this allows ALLOW_DOUBLE_MATH_FUNCTIONS to be used
2018-05-07 11:43:23 +10:00
Andrew Tridgell 4ce696a520 AP_Math: fixed example build on ChibiOS 2018-01-15 11:46:02 +11:00
Andrew Tridgell 3f226cd2b9 AP_Math: added from_rotation() method to Matrix3
this is used to get a rotation matrix from a rotation enum
2017-11-23 14:26:11 +11:00
Pierre Kancir f2812c1efd AP_Math: example fix travis warning
missing function declaration
implicit cast
some style fix
2017-04-13 19:56:16 +01:00
murata ec4cce15a1 AP_Math: 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
Andrew Tridgell 3969bde84a AP_Math: fixed coverity warning in example 2016-06-05 07:20:46 +10:00
Peter Barker cb16d0b6c6 AP_Math: correct examples build on px4 2016-06-04 12:31:36 -03:00
Andrew Tridgell 6165c42535 AP_Math: added from_axis_angle() method on Matrix3f
for arbitrary rotations in simulator
2016-04-22 10:28:15 +10:00
Gustavo Jose de Sousa 6729475b25 AP_Math: fix eulers example for PX4 2016-03-14 11:54:31 -03:00
Gustavo Jose de Sousa d9bb696fa3 AP_Math: avoid bias in rand_num() in eulers example
Use RAND_MAX to avoid bias.
2016-03-14 11:54:31 -03:00
dgrat 5148e41c1a AP_Math: Cleaned macro definitions
Moved Definitions into a separate header. Replaced PI with M_PI and
removed the M_PI_*_F macros.
2016-02-27 02:51:33 -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
Lucas De Marchi ba3325ffd3 AP_Math: rename rotation
The rotations are supposed to follow the name of the enum, in order. The
ROTATION_YAW_293_PITCH_68_ROLL_90 was added with the name of an
intrinsic 321 rotation, but the matrix is actually a 123 rotation,
following the other rotations already present.

Change the name to follow the other names.
2015-12-30 20:22:27 -02:00
Jonathan Challinger 83d5a6664a AP_Math: minor changes to matrix_alg in response to review 2015-12-29 22:57:21 -08:00
bugobliterator 1a4b4fa85e AP_Math: add inverse matrix test to check if inverse(mat)*mat = I
where I is an identity matrix (a matrix with diagonal elements = 1)
2015-12-29 10:46:35 -08:00
Siddharth Bharat Purohit a0c3cbffee AP_Math: add inverse matrix test example
fix example build
2015-12-29 10:46:34 -08:00
Siddharth Bharat Purohit 5af0cc8eaf AP_Math: add inverse rotate example function 2015-12-29 10:46:34 -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 f5c03c786d AP_Math: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:43 +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 8257e6ab89 AP_Math: examples use millis/micros/panic functions 2015-11-20 12:31:55 +09:00
Andrew Tridgell 8f4ce7f20b build: removed all nocore.inoflag files
these were APM2 specific
2015-11-16 08:05:17 +11:00
Lucas De Marchi fb28f426da AP_Math: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 20c6ffc5e3 Replace use of UARTDriver::printf_P() with UARTDriver::printf()
This also starts to show warnings on places that were already using
wrong printf format strings.
2015-10-30 14:35:25 +09:00
Lucas De Marchi 6f4904189b Replace use of println_P() with println() 2015-10-30 14:35:22 +09:00
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Caio Marcelo de Oliveira Filho 5020db4481 AP_Math: remove unnecessary includes
Remove unnecessary includes, in particular the includes for specific
boards. The list of libraries for 'polygon' example was updated so that
the example compiles again.
2015-10-21 09:16:09 +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 4790371f9b AP_Math: 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:38:18 +10:00
Lucas De Marchi 0471de2342 AP_Math: use ARRAY_SIZE macro 2015-07-21 14:25:09 +09:00
Lucas De Marchi fb2eb262e7 AP_Math: use ARRAY_SIZE instead of defining another one 2015-07-21 14:24:49 +09:00
Andrew Tridgell 6009ae55b1 AP_Math: fixed build of eulers example sketch 2015-07-17 08:24:49 +10:00
Andrew Tridgell 3edac37929 AP_Math: removed unused include in example 2015-06-01 17:35:03 +10:00
Andrew Tridgell 4d040bbb94 AP_Math: convert example from .pde to .cpp 2015-06-01 17:07:04 +10:00
Andrew Tridgell 2b828a794e AP_Math: fixed example build 2015-06-01 16:36:54 +10:00
Randy Mackay 114c4f4077 AP_Match: fix example sketch 2015-05-27 09:47:24 +09:00
Andrew Tridgell 605b8b4ece AP_Math: converted rotations example to cpp
this is just a test conversion before we start converting on-mass
2015-05-21 13:41:20 +10:00
Andrew Tridgell 062c9406bd AP_Math: fixed rotations example build 2015-05-21 13:37:44 +10:00
Tom Pittenger e20ffa8c75 AP_Math: replace fabs() with fabsf() 2015-05-09 09:57:27 +10:00
Tom Pittenger a5d2f3a82f AP_Math: compiler warnings: float to double 2015-05-05 13:26:52 +10:00