APM:Libraries
Macros | Variables
definitions.h File Reference
#include <cmath>
#include <AP_HAL/AP_HAL.h>
Include dependency graph for definitions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define M_PI   (3.141592653589793f)
 
#define M_PI_2   (M_PI / 2)
 
#define M_GOLDEN   1.6180339f
 
#define M_2PI   (M_PI * 2)
 
#define MATH_CHECK_INDEXES   0
 
#define DEG_TO_RAD   (M_PI / 180.0f)
 
#define RAD_TO_DEG   (180.0f / M_PI)
 
#define DEGX100   5729.57795f
 
#define RadiansToCentiDegrees(x)   (static_cast<float>(x) * RAD_TO_DEG * static_cast<float>(100))
 
#define GRAVITY_MSS   9.80665f
 
#define RADIUS_OF_EARTH   6378100
 
#define LATLON_TO_M   0.01113195f
 
#define LATLON_TO_CM   1.113195f
 
#define C_TO_KELVIN   273.15f
 
#define ISA_GAS_CONSTANT   287.26f
 
#define ISA_LAPSE_RATE   0.0065f
 
#define SSL_AIR_DENSITY   1.225f
 
#define SSL_AIR_PRESSURE   101325.01576f
 
#define SSL_AIR_TEMPERATURE   288.15f
 
#define AP_NSEC_PER_SEC   1000000000ULL
 
#define AP_NSEC_PER_USEC   1000ULL
 
#define AP_USEC_PER_SEC   1000000ULL
 
#define AP_USEC_PER_MSEC   1000ULL
 
#define AP_MSEC_PER_SEC   1000ULL
 
#define AP_SEC_PER_WEEK   (7ULL * 86400ULL)
 
#define AP_MSEC_PER_WEEK   (AP_SEC_PER_WEEK * AP_MSEC_PER_SEC)
 

Variables

static const double WGS84_A = 6378137.0
 
static const double WGS84_IF = 298.257223563
 
static const double WGS84_F = ((double)1.0 / WGS84_IF)
 
static const double WGS84_B = (WGS84_A * (1 - WGS84_F))
 

Macro Definition Documentation

◆ AP_MSEC_PER_SEC

#define AP_MSEC_PER_SEC   1000ULL

Definition at line 94 of file definitions.h.

Referenced by gps_time(), and AP_GPS_Backend::make_gps_time().

◆ AP_MSEC_PER_WEEK

#define AP_MSEC_PER_WEEK   (AP_SEC_PER_WEEK * AP_MSEC_PER_SEC)

◆ AP_NSEC_PER_SEC

#define AP_NSEC_PER_SEC   1000000000ULL

Definition at line 90 of file definitions.h.

Referenced by hz_to_nsec(), now_nsec(), and nsec_to_hz().

◆ AP_NSEC_PER_USEC

#define AP_NSEC_PER_USEC   1000ULL

Definition at line 91 of file definitions.h.

Referenced by Linux::TimerPollable::adjust_timer(), nsec_to_usec(), and usec_to_nsec().

◆ AP_SEC_PER_WEEK

#define AP_SEC_PER_WEEK   (7ULL * 86400ULL)

Definition at line 95 of file definitions.h.

Referenced by gps_time(), and AP_GPS_Backend::make_gps_time().

◆ AP_USEC_PER_MSEC

#define AP_USEC_PER_MSEC   1000ULL

◆ AP_USEC_PER_SEC

#define AP_USEC_PER_SEC   1000000ULL

◆ C_TO_KELVIN

#define C_TO_KELVIN   273.15f

◆ DEG_TO_RAD

#define DEG_TO_RAD   (M_PI / 180.0f)

◆ DEGX100

#define DEGX100   5729.57795f

Definition at line 34 of file definitions.h.

Referenced by get_bearing_cd(), and AC_Circle::update().

◆ GRAVITY_MSS

#define GRAVITY_MSS   9.80665f

Definition at line 47 of file definitions.h.

Referenced by SITL::Calibration::_calibration_poses(), AP_InertialSensor_BMI160::_configure_accel(), AP_PitchController::_get_coordination_rate_offset(), AP_InertialSensor_LSM9DS1::_set_accel_scale(), AP_InertialSensor_LSM9DS0::_set_accel_scale(), AP_TECS::_update_energies(), AP_TECS::_update_pitch(), AP_TECS::_update_STE_rate_lim(), AC_WPNav::AC_WPNav(), AC_PosControl::accel_to_lean_angles(), AccelCalibrator::accept_result(), AC_Loiter::calc_desired_velocity(), AccelCalibrator::calc_residual(), NavEKF2_core::calcOutputStates(), NavEKF3_core::calcOutputStates(), SITL::Frame::calculate_forces(), SITL::Submarine::calculate_forces(), AP_AHRS_DCM::drift_correction(), SITL::Aircraft::extrapolate_sensors(), AP_YawController::get_servo_out(), NavEKF2_core::getAccelNED(), NavEKF3_core::getAccelNED(), AP_AHRS_NavEKF::getCorrectedDeltaVelocityNED(), SITL::Helicopter::Helicopter(), SITL::Frame::init(), AC_Loiter::init_target(), AC_PosControl::lean_angles_to_accel(), DataFlash_Class::Log_Write_Rate(), AP_L1_Control::loiter_radius(), SITL::Plane::Plane(), SoloGimbalEKF::predictStates(), SITL::XPlane::receive_data(), AP_InertialSensor::register_accel(), AC_PosControl::relax_alt_hold_controllers(), AC_PosControl::run_xy_controller(), AC_PosControl::run_z_controller(), AC_Loiter::sanity_check_params(), GCS_MAVLINK::send_raw_imu(), AC_Loiter::set_pilot_desired_acceleration(), AP_InertialSensor::simple_accel_cal(), AP_Baro::SimpleUnderWaterAtmosphere(), SITL::SingleCopter::SingleCopter(), SITL::Aircraft::smooth_sensors(), AccelCalibrator::start(), AP_InertialSensor_Invensense::start(), SITL::Tracker::update(), SITL::Helicopter::update(), SITL::SimRover::update(), SITL::Balloon::update(), SITL::SingleCopter::update(), SITL::FlightAxis::update(), Variometer::update(), AP_TECS::update_50hz(), SITL::Aircraft::update_dynamics(), NavEKF2_core::UpdateStrapdownEquationsNED(), and NavEKF3_core::UpdateStrapdownEquationsNED().

◆ ISA_GAS_CONSTANT

#define ISA_GAS_CONSTANT   287.26f

Definition at line 77 of file definitions.h.

Referenced by AP_Airspeed_SDP3X::_correct_pressure(), and AP_Baro::get_EAS2TAS().

◆ ISA_LAPSE_RATE

#define ISA_LAPSE_RATE   0.0065f

Definition at line 78 of file definitions.h.

Referenced by AP_Baro::get_EAS2TAS().

◆ LATLON_TO_CM

#define LATLON_TO_CM   1.113195f

Definition at line 55 of file definitions.h.

Referenced by Location_Class::get_vector_xy_from_origin_NE().

◆ LATLON_TO_M

#define LATLON_TO_M   0.01113195f

Definition at line 54 of file definitions.h.

◆ M_2PI

#define M_2PI   (M_PI * 2)

◆ M_GOLDEN

#define M_GOLDEN   1.6180339f

Definition at line 17 of file definitions.h.

◆ M_PI

#define M_PI   (3.141592653589793f)

◆ M_PI_2

#define M_PI_2   (M_PI / 2)

◆ MATH_CHECK_INDEXES

#define MATH_CHECK_INDEXES   0

Definition at line 27 of file definitions.h.

◆ RAD_TO_DEG

#define RAD_TO_DEG   (180.0f / M_PI)

Definition at line 31 of file definitions.h.

Referenced by AP_Mount_Alexmos::control_axis(), and degrees().

◆ RadiansToCentiDegrees

#define RadiansToCentiDegrees (   x)    (static_cast<float>(x) * RAD_TO_DEG * static_cast<float>(100))

◆ RADIUS_OF_EARTH

#define RADIUS_OF_EARTH   6378100

Definition at line 50 of file definitions.h.

◆ SSL_AIR_DENSITY

#define SSL_AIR_DENSITY   1.225f

Definition at line 82 of file definitions.h.

Referenced by AP_Airspeed_SDP3X::_correct_pressure(), and AP_Baro::get_EAS2TAS().

◆ SSL_AIR_PRESSURE

#define SSL_AIR_PRESSURE   101325.01576f

◆ SSL_AIR_TEMPERATURE

#define SSL_AIR_TEMPERATURE   288.15f

Definition at line 84 of file definitions.h.

Referenced by AP_Baro::SimpleAtmosphere().

Variable Documentation

◆ WGS84_A

const double WGS84_A = 6378137.0
static

Definition at line 58 of file definitions.h.

Referenced by wgsecef2llh(), and wgsllh2ecef().

◆ WGS84_B

const double WGS84_B = (WGS84_A * (1 - WGS84_F))
static

Definition at line 67 of file definitions.h.

Referenced by wgsecef2llh().

◆ WGS84_F

const double WGS84_F = ((double)1.0 / WGS84_IF)
static

Definition at line 64 of file definitions.h.

◆ WGS84_IF

const double WGS84_IF = 298.257223563
static

Definition at line 61 of file definitions.h.