You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
2.1 KiB

7 years ago
​
​
7 years ago
​
​
​
​
7 years ago
​
​
​
5 years ago
7 years ago
​
​
​
​
​
5 years ago
7 years ago
5 years ago
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
7 years ago
​
​
5 years ago
7 years ago
​
​
  1. #ifndef __POSITION_SYSTEM_SANCHOR_HEADER__
  2. #define __POSITION_SYSTEM_SANCHOR_HEADER__
  3. #include "../base/basicPosition.h"
  4. #include "../base/basicSettingsProvider.h"
  5. #include <string.h>
  6. #define TAG_POSITION_LAT "POSITION_LATITUDE"
  7. #define TAG_POSITION_LON "POSITION_LONGITUDE"
  8. #define TAG_POSITION_SOUTH_HS "SOUTH_HEMISPHERE"
  9. #define TAG_POSITION_ALT "POSITION_ALT"
  10. #define TAG_POSITION_ROLL "ORIENTATION_ROLL"
  11. #define TAG_POSITION_PITCH "ORIENTATION_PITCH"
  12. #define TAG_POSITION_YAW "ORIENTATION_YAW"
  13. #define TAG_POSITION_LOCAL "POSITION_LOCAL_DIFF"
  14. class systemAnchor: public position3D {
  15. private:
  16. config_setting_t *m_pSettings;
  17. coordConverter m_SCC;
  18. bool m_bSouthHemisphere;
  19. bool m_bUseJustLocalDiffCoords;
  20. public:
  21. static systemAnchor *getInstance( bool SOUTH = false, C3D_WGS84_LOC *ptr = NULL, bool jl = false );
  22. virtual ~systemAnchor( void );
  23. // local - C3D_SPH_RADIANS/C3D_SPH_DEGREES
  24. // system - C3D_DECART
  25. // global - C3D_WGS84_LOC
  26. bool convertToLocal(basicPosition *SP, C3D_WGS84_LOC POS, C3D_SPH_DEGREES &LOC);
  27. bool convertToLocal(basicPosition *SP, C3D_WGS84_LOC POS, C3D_SPH_RADIANS& LOC);
  28. bool convertToLocal(basicPosition *SP, C3D_DECART POS, C3D_SPH_DEGREES& LOC);
  29. bool convertToLocal(basicPosition *SP, C3D_DECART POS, C3D_SPH_RADIANS& LOC);
  30. bool convertToSystem(basicPosition *SP, C3D_WGS84_LOC POS, C3D_DECART& LOC);
  31. bool convertToSystem(basicPosition *SP, C3D_SPH_DEGREES POS, C3D_DECART& LOC);
  32. bool convertToSystem(basicPosition *SP, C3D_SPH_RADIANS POS, C3D_DECART& LOC);
  33. bool convertToGlobal(basicPosition *SP, C3D_SPH_DEGREES POS, C3D_WGS84_LOC& LOC);
  34. bool convertToGlobal(basicPosition *SP, C3D_SPH_RADIANS POS, C3D_WGS84_LOC& LOC);
  35. bool convertToGlobal(basicPosition *SP, C3D_DECART POS, C3D_WGS84_LOC& LOC);
  36. bool beLocal( void ){ return m_bUseJustLocalDiffCoords; };
  37. private:
  38. static systemAnchor *_instance;
  39. protected:
  40. explicit systemAnchor( bool SOUTH, C3D_WGS84_LOC *ptr, bool beJustLocal );
  41. };
  42. #endif