From cefebb9699760b23b1298ee46a0d72ae22b6ecd8 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 4 Jul 2013 15:48:01 +0200 Subject: Small improvements in system lib --- src/modules/systemlib/conversions.h | 6 +----- src/modules/systemlib/geo/geo.h | 16 ++++++++++++++++ src/modules/systemlib/pid/pid.h | 3 +++ 3 files changed, 20 insertions(+), 5 deletions(-) (limited to 'src/modules') diff --git a/src/modules/systemlib/conversions.h b/src/modules/systemlib/conversions.h index 5d485b01f..064426f21 100644 --- a/src/modules/systemlib/conversions.h +++ b/src/modules/systemlib/conversions.h @@ -43,11 +43,7 @@ #define CONVERSIONS_H_ #include #include - -#define CONSTANTS_ONE_G 9.80665f // m/s^2 -#define CONSTANTS_AIR_DENSITY_SEA_LEVEL_15C 1.225f // kg/m^3 -#define CONSTANTS_AIR_GAS_CONST 287.1f // J/(kg * K) -#define CONSTANTS_ABSOLUTE_NULL_CELSIUS -273.15f // °C +#include __BEGIN_DECLS diff --git a/src/modules/systemlib/geo/geo.h b/src/modules/systemlib/geo/geo.h index 84097b49f..dadec51ec 100644 --- a/src/modules/systemlib/geo/geo.h +++ b/src/modules/systemlib/geo/geo.h @@ -45,9 +45,23 @@ * Additional functions - @author Doug Weibel */ +#pragma once + +__BEGIN_DECLS #include +#define CONSTANTS_ONE_G 9.80665f /* m/s^2 */ +#define CONSTANTS_AIR_DENSITY_SEA_LEVEL_15C 1.225f /* kg/m^3 */ +#define CONSTANTS_AIR_GAS_CONST 287.1f /* J/(kg * K) */ +#define CONSTANTS_ABSOLUTE_NULL_CELSIUS -273.15f /* °C */ +#define CONSTANTS_RADIUS_OF_EARTH 6371000 /* meters (m) */ + +/* compatibility aliases */ +#define RADIUS_OF_EARTH CONSTANTS_RADIUS_OF_EARTH +#define GRAVITY_MSS CONSTANTS_ONE_G + +// XXX remove struct crosstrack_error_s { bool past_end; // Flag indicating we are past the end of the line/arc segment float distance; // Distance in meters to closest point on line/arc @@ -111,3 +125,5 @@ __EXPORT float _wrap_180(float bearing); __EXPORT float _wrap_360(float bearing); __EXPORT float _wrap_pi(float bearing); __EXPORT float _wrap_2pi(float bearing); + +__END_DECLS diff --git a/src/modules/systemlib/pid/pid.h b/src/modules/systemlib/pid/pid.h index 714bf988f..eca228464 100644 --- a/src/modules/systemlib/pid/pid.h +++ b/src/modules/systemlib/pid/pid.h @@ -53,6 +53,8 @@ #include +__BEGIN_DECLS + /* PID_MODE_DERIVATIV_CALC calculates discrete derivative from previous error * val_dot in pid_calculate() will be ignored */ #define PID_MODE_DERIVATIV_CALC 0 @@ -87,5 +89,6 @@ __EXPORT float pid_calculate(PID_t *pid, float sp, float val, float val_dot, flo __EXPORT void pid_reset_integral(PID_t *pid); +__END_DECLS #endif /* PID_H_ */ -- cgit v1.2.3