| 1 | #ifndef _GLUE_HPP |
| 2 | #define _GLUE_HPP |
| 3 | |
| 4 | #include "BodyEnvironment.hpp" |
| 5 | |
| 6 | namespace yasim { |
| 7 | |
| 8 | // The XYZ coordinate system has Z as the earth's axis, the Y axis |
| 9 | // pointing out the equator at zero longitude, and the X axis pointing |
| 10 | // out the middle of the western hemisphere. |
| 11 | class Glue { |
| 12 | public: |
| 13 | static void calcAlphaBeta(State* s, float* wind, float* alpha, float* beta); |
| 14 | |
| 15 | // Calculates the instantaneous rotation velocities about each |
| 16 | // axis. |
| 17 | static void calcEulerRates(State* s, |
| 18 | float* roll, float* pitch, float* hdg); |
| 19 | |
| 20 | // Returns a global to "local" (north, east, down) matrix. Note |
| 21 | // that the latitude passed in is geoDETic. |
| 22 | static void xyz2nedMat(double lat, double lon, float* out); |
| 23 | |
| 24 | // Conversion between a euler triplet and a matrix that transforms |
| 25 | // "local" (north/east/down) coordinates to the aircraft frame. |
| 26 | static void euler2orient(float roll, float pitch, float hdg, |
| 27 | float* out); |
| 28 | static void orient2euler(float* o, |
| 29 | float* roll, float* pitch, float* hdg); |
| 30 | |
| 31 | static void geodUp(double lat, double lon, float* up); |
| 32 | static void geodUp(double* pos, float* up); |
| 33 | }; |
| 34 | |
| 35 | }; // namespace yasim |
| 36 | #endif // _GLUE_HPP |