Skip to content

Commit

Permalink
math: added some headers and doxygen comments
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed Feb 20, 2011
1 parent f0b56f3 commit a61e72f
Show file tree
Hide file tree
Showing 6 changed files with 233 additions and 32 deletions.
41 changes: 41 additions & 0 deletions sw/airborne/math/pprz_algebra_double.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
/*
* Copyright (C) 2008-2011 The Paparazzi Team
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/

/**
* @file pprz_algebra_double.h
* @brief Paparazzi double precision floating point algebra.
*
* This is the more detailed description of this file.
*
*/

#ifndef PPRZ_ALGEBRA_DOUBLE_H
#define PPRZ_ALGEBRA_DOUBLE_H

Expand All @@ -15,6 +44,9 @@ struct DoubleVect3 {
double z;
};

/**
* @brief Roation quaternion
*/
struct DoubleQuat {
double qi;
double qx;
Expand All @@ -26,16 +58,25 @@ struct DoubleMat33 {
double m[3*3];
};

/**
* @brief rotation matrix
*/
struct DoubleRMat {
double m[3*3];
};

/**
* @brief euler angles
* @details Units: radians */
struct DoubleEulers {
double phi;
double theta;
double psi;
};

/**
* @brief angular rates
* @details Units: rad/s^2 */
struct DoubleRates {
double p;
double q;
Expand Down
29 changes: 23 additions & 6 deletions sw/airborne/math/pprz_algebra_float.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* $Id$
*
* Copyright (C) 2008-2010 The Paparazzi Team
* Copyright (C) 2008-2011 The Paparazzi Team
*
* This file is part of paparazzi.
*
Expand All @@ -16,9 +14,16 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* along with paparazzi; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/

/**
* @file pprz_algebra_float.h
* @brief Paparazzi floating point algebra.
*
* This is the more detailed description of this file.
*
*/

Expand Down Expand Up @@ -46,6 +51,9 @@ struct FloatVect3 {
float z;
};

/**
* @brief Roation quaternion
*/
struct FloatQuat {
float qi;
float qx;
Expand All @@ -57,16 +65,25 @@ struct FloatMat33 {
float m[3*3];
};

/**
* @brief rotation matrix
*/
struct FloatRMat {
float m[3*3];
};

/**
* @brief euler angles
* @details Units: radians */
struct FloatEulers {
float phi;
float theta;
float psi;
};

/**
* @brief angular rates
* @details Units: rad/s^2 */
struct FloatRates {
float p;
float q;
Expand Down
30 changes: 24 additions & 6 deletions sw/airborne/math/pprz_algebra_int.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* $Id$
*
* Copyright (C) 2008-2010 The Paparazzi Team
* Copyright (C) 2008-2011 The Paparazzi Team
*
* This file is part of paparazzi.
*
Expand All @@ -16,9 +14,16 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* along with paparazzi; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/

/**
* @file pprz_algebra_int.h
* @brief Paparazzi fixed point algebra.
*
* This is the more detailed description of this file.
*
*/

Expand Down Expand Up @@ -69,6 +74,9 @@ struct Int32Vect3 {

/* Rotation quaternions */
#define INT32_QUAT_FRAC 15
/**
* @brief Roation quaternion
* @details Units: INT32_QUAT_FRAC */
struct Int32Quat {
int32_t qi;
int32_t qx;
Expand Down Expand Up @@ -104,6 +112,9 @@ struct Int16Eulers {
int16_t psi;
};

/**
* @brief euler angles
* @details Units: rad with INT32_ANGLE_FRAC */
struct Int32Eulers {
int32_t phi;
int32_t theta;
Expand All @@ -113,6 +124,10 @@ struct Int32Eulers {

/* Rotation matrix. */
#define INT32_TRIG_FRAC 14

/**
* @brief rotation matrix
* @details Units: rad with INT32_TRIG_FRAC */
struct Int32RMat {
int32_t m[3*3];
};
Expand All @@ -130,6 +145,9 @@ struct Int16Rates {
};

/* Rotational speed */
/**
* @brief angular rates
* @details Units: rad/s^2 with INT32_RATE_FRAC */
struct Int32Rates {
int32_t p;
int32_t q;
Expand Down
54 changes: 48 additions & 6 deletions sw/airborne/math/pprz_geodetic_double.h
Original file line number Diff line number Diff line change
@@ -1,39 +1,81 @@
/*
* Copyright (C) 2008-2011 The Paparazzi Team
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/

/**
* @file pprz_geodetic_double.h
* @brief Paparazzi double-precision floating point math for geodetic calculations.
*
* This is the more detailed description of this file.
*
*/

#ifndef PPRZ_GEODETIC_DOUBLE_H
#define PPRZ_GEODETIC_DOUBLE_H

#include "pprz_geodetic.h"
#include "pprz_algebra_double.h"

/* Earth Centered Earth Fixed in meters */
/**
* @brief vector in EarthCenteredEarthFixed coordinates
* @details Units: meters */
struct EcefCoor_d {
double x;
double y;
double z;
};

/* lon, lat in radians */
/* alt in meters */
/**
* @brief vector in Latitude, Longitude and Altitude
* @details Units lat,lon: radians
* Unit alt: meters above MSL
*/
struct LlaCoor_d {
double lon;
double lat;
double alt;
};

/* North East Down local tangeant plane */
/**
* @brief vector in North East Down coordinates
* Units: meters */
struct NedCoor_d {
double x;
double y;
double z;
};

/* East North Up local tangeant plane */
/**
* @brief vector in East North Up coordinates
* Units: meters */
struct EnuCoor_d {
double x;
double y;
double z;
};

/* Local tangeant plane reference */
/**
* @brief definition of the local (flat earth) coordinate system
* @details Defines the origin of the local coordinate system
* in ECEF and LLA coordinates and the roation matrix from
* ECEF to local frame */
struct LtpDef_d {
struct EcefCoor_d ecef;
struct LlaCoor_d lla;
Expand Down
54 changes: 48 additions & 6 deletions sw/airborne/math/pprz_geodetic_float.h
Original file line number Diff line number Diff line change
@@ -1,39 +1,81 @@
/*
* Copyright (C) 2008-2011 The Paparazzi Team
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/

/**
* @file pprz_geodetic_float.h
* @brief Paparazzi floating point math for geodetic calculations.
*
* This is the more detailed description of this file.
*
*/

#ifndef PPRZ_GEODETIC_FLOAT_H
#define PPRZ_GEODETIC_FLOAT_H

#include "pprz_geodetic.h"
#include "pprz_algebra_float.h"

/* Earth Centered Earth Fixed in meters */
/**
* @brief vector in EarthCenteredEarthFixed coordinates
* @details Units: meters */
struct EcefCoor_f {
float x;
float y;
float z;
};

/* lon, lat in radians */
/* alt in meters */
/**
* @brief vector in Latitude, Longitude and Altitude
* @details Units lat,lon: radians
* Unit alt: meters above MSL
*/
struct LlaCoor_f {
float lon;
float lat;
float alt;
};

/* North East Down local tangeant plane */
/**
* @brief vector in North East Down coordinates
* Units: meters */
struct NedCoor_f {
float x;
float y;
float z;
};

/* East North Up local tangeant plane */
/**
* @brief vector in East North Up coordinates
* Units: meters */
struct EnuCoor_f {
float x;
float y;
float z;
};

/* Local tangeant plane reference */
/**
* @brief definition of the local (flat earth) coordinate system
* @details Defines the origin of the local coordinate system
* in ECEF and LLA coordinates and the roation matrix from
* ECEF to local frame */
struct LtpDef_f {
struct EcefCoor_f ecef;
struct LlaCoor_f lla;
Expand Down
Loading

0 comments on commit a61e72f

Please sign in to comment.