Commit Graph

67 Commits

Author SHA1 Message Date
Daniel Agar fa3b3df061 astyle src/lib/geo 2017-01-29 01:18:32 +01:00
Carlo Wood 90f3e3b5d3 Do not include headers inside __BEGIN_DECLS ... __END_DECLS blocks.
We don't have C++ unsafe headers (anymore).

I added a test to fix_headers.sh that checks if certain "unsafe"
headers are ONLY included inside a __BEGIN_DECLS ... __END_DECLS
(because after all, they are unsafe), as well as checking that
no other header files are included inside such a block. The rationale
of the latter is that if a file is a C header and it declares
function prototypes (otherwise it doesn't matter) and is sometimes
included outside a __BEGIN_DECLS ... __END_DECLS block (from a C++
source file) then it has to be C++ safe and doesn't ever to be
included from inside such a block; while if a file is a C++ header
then obviously it should never be included from such a block.

fix_headers.sh subsequently found several safe headers to be
included from inside such a block, and those that were (apparently
in the past) unsafe were included only sometimes inside such a
block and often outside it. I had a look at those files and saw
that at least an attempt has been made to make them C++ safe,
but especially because they already are included OFTEN outside
a __BEGIN_DECLS ... __END_DECLS (from C++ source files) the
best decision seems to treat them as safe.

This is not risky: .c files that define such functions still
generate C-linkage for their functions. If a C++ unsafe C header
is included outside a __BEGIN_DECLS ... __END_DECLS block then
the only possible result would be an undefined reference to
a function with C++-linkage that will not exist. Aka, when
something links after this commit, then the commit was correct.
I did build all targets and they all linked.
2016-10-28 11:57:08 +02:00
Peter Duerr 6b78b72ab2 Fix code style according to astyle 2015-12-04 14:53:59 +09:00
Peter Duerr c070d326e0 Avoid violation of acos' domain in map_projection
* There are pathological cases (e.g., setpoint very close to reference
  for certain reference latitudes), where numerical errors lead to a sum
  larger than 1.0 passed to acos, resulting in NaN values.

This should fix issue #2813
2015-12-04 14:14:31 +09:00
Lorenz Meier 352b1692d1 Geo lib: Do not hardcode assumptions about process name. 2015-11-22 14:00:31 +01:00
tumbili 154fa07a46 fixes after review 2015-11-17 22:28:09 +01:00
Roman c989c21269 fixed geo functions 2015-11-17 22:28:09 +01:00
Roman e48cf53ce8 fix code style 2015-11-17 22:28:09 +01:00
Andreas Antener 5b1c7321e7 reverted navigation on landing back to old heading hold 2015-11-17 22:28:09 +01:00
Roman 896dff40cf added geo functions to create new waypoints from given setting 2015-11-17 22:28:09 +01:00
Lorenz Meier af1fe6ab9b Geo lib: Fix code style 2015-10-19 13:48:23 +02:00
Lorenz Meier fa5071b3c5 Remove module.mk files to prevent confusion of adopters upgrading 2015-10-06 11:23:20 +02:00
James Goppert 1d6b31d196 Switch to cmake build system. 2015-09-07 20:37:45 -04:00
Mark Charlebois 62f8bd6679 Linux build support for some libs
The following libs can now be built under Linux:

   lib/mathlib
   lib/geo
   lib/geo_lookup

The constants used for ROS are now shared with Linux in
px4_defines.h

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:57:01 -07:00
Mark Charlebois 9758112e31 Use px4_config.h instead of nuttx/config.h
Modified code to use OS independent header file for config settings.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:55:41 -07:00
Thomas Gubler 5056b03ab0 geo: fix include 2015-01-06 19:14:01 +01:00
Thomas Gubler 9520983e08 lots' of header juggling and small changes to make mc att control compile for NuttX and ROS 2014-12-16 08:24:51 +01:00
Lorenz Meier b7b4804791 GEO: fix compile warnings 2014-10-11 00:28:48 +02:00
Thomas Gubler 5baf9cea0d geo: fix some warnings 2014-08-11 15:29:59 +02:00
Thomas Gubler af1ad04c23 Merge remote-tracking branch 'origin/master' into geo 2014-08-11 13:37:08 +02:00
Don Gagne 278aafe939 Bring everything up to double 2014-07-06 11:06:14 -07:00
Don Gagne b9299e68d4 Compiler warning fixes 2014-07-05 13:35:12 -07:00
Lorenz Meier 34c13df3dd geo: Fix a series of warnings, some which actually pointed to real issues 2014-07-01 09:50:48 +02:00
Lorenz Meier efc992b4d9 Merged master into geo 2014-07-01 09:34:26 +02:00
Don Gagne 92adbe9216 Fix compiler warnings 2014-06-29 17:47:24 -07:00
Lorenz Meier 2bd5511d09 geo lookup lib: Moved to separate module and compiling with -Os to save some precious flash 2014-06-28 12:37:26 +02:00
Thomas Gubler a43e963bdb geo: fix logic of globallocal converter initialization to depend on map projection initialization 2014-05-30 16:09:52 +02:00
Thomas Gubler e0042ec12c geo: add functions to get global projection/transformation reference values 2014-05-22 13:26:15 +02:00
Anton Babushkin bd9d58f565 attitude_estimator_ekf: auto detect mag declination using GPS coordinates 2014-05-12 23:06:45 +02:00
Thomas Gubler 548c7f4aaf geo: introduce global/local coordinate frame converter which uses the map projection but also converts altitude 2014-05-06 14:56:47 +02:00
Thomas Gubler fc204a1890 geo: map projection: fix stupid typo and use constants for deg to rad conversion 2014-05-06 13:14:15 +02:00
Thomas Gubler f24a6187b6 geo: map projection: fix variable name to highlight the unit 2014-05-06 11:24:33 +02:00
Thomas Gubler 6e0690fde1 init global map projection when gps is valid 2014-05-05 16:44:02 +02:00
Thomas Gubler 474a76b553 Merge remote-tracking branch 'upstream/master' into geo 2014-05-05 14:42:46 +02:00
Lorenz Meier 5429b82ae0 Fix last data type and casting compiler nuisances 2014-04-30 08:53:22 +02:00
Lorenz Meier 48a9ba39af Fixed typos in declination table lookup 2014-04-30 08:26:08 +02:00
Thomas Gubler a7289a3266 mavlink interface: update mapprojection usage 2014-04-29 15:39:26 +02:00
Thomas Gubler 3ec818ce1e rerwite projection interrface to not break the current implementation 2014-04-29 14:39:36 +02:00
Lorenz Meier ec50f73cbe Updated geo lib C/C++ interfacing 2014-04-28 20:44:11 +02:00
Lorenz Meier e134537ae8 Added automatic declination lookup 2014-04-28 17:44:29 +02:00
Thomas Gubler aab64af884 geo: map projection: safer initialization, only accept init from navigator, return int instead of bool 2014-04-25 14:47:37 +02:00
Thomas Gubler 9ebd6b3486 geo: interface to get reference lat lon, option to set reference timestamp on initialization 2014-04-25 09:41:46 +02:00
Thomas Gubler 4e30784d6c rename map_projection_inited to map_projection_initialized 2014-04-24 17:16:20 +02:00
Thomas Gubler b249d04e52 geo: get function for timestamp of map projection 2014-04-24 17:13:06 +02:00
Thomas Gubler 35d15720ef geo: add timestamp and function to get init state 2014-04-24 17:04:27 +02:00
Thomas Gubler 6517c201f7 geo: add missing return, make map projection reference static 2014-04-24 15:59:13 +02:00
Thomas Gubler 3a898e54ad towards a global map projection instance, WIP: need to remove local updates of the reference and add a global map update 2014-04-24 14:30:29 +02:00
Anton Babushkin 5c53797c17 Merge branch 'master' into mpc_local_pos 2014-04-02 17:09:36 +04:00
Anton Babushkin 9b71e660ad Merge branch 'beta_mavlink2' into mpc_local_pos_mavlink 2014-03-19 20:01:01 +04:00
Anton Babushkin 068b7526b7 copyright and code style fixes 2014-03-18 00:10:38 +04:00