Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef GEODETICCOORDS_H_
00044 #define GEODETICCOORDS_H_
00045
00046 #include <rtabmap/core/RtabmapExp.h>
00047
00048 #include <opencv2/core/core.hpp>
00049
00050 namespace rtabmap {
00051
00052 class RTABMAP_EXP GeodeticCoords
00053 {
00054 public:
00055 GeodeticCoords();
00056 GeodeticCoords(double latitude, double longitude, double altitude);
00057
00058 const double & latitude() const {return latitude_;}
00059 const double & longitude() const {return longitude_;}
00060 const double & altitude() const {return altitude_;}
00061
00062 void setLatitude(const double & value) {latitude_ = value;}
00063 void setLongitude(const double & value) {longitude_ = value;}
00064 void setAltitude(const double & value) {altitude_ = value;}
00065
00066 cv::Point3d toGeocentric_WGS84() const;
00067 cv::Point3d toENU_WGS84(const GeodeticCoords & origin) const;
00068
00069 void fromGeocentric_WGS84(const cv::Point3d& geocentric);
00070 void fromENU_WGS84(const cv::Point3d & enu, const GeodeticCoords & origin);
00071
00072 static cv::Point3d ENU_WGS84ToGeocentric_WGS84(const cv::Point3d & enu, const GeodeticCoords & origin);
00073
00074 private:
00075 double latitude_;
00076 double longitude_;
00077 double altitude_;
00078 };
00079
00080 class GPS
00081 {
00082 public:
00083 GPS():
00084 stamp_(0.0),
00085 longitude_(0.0),
00086 latitude_(0.0),
00087 altitude_(0.0),
00088 error_(0.0),
00089 bearing_(0.0)
00090 {}
00091 GPS(const double & stamp,
00092 const double & longitude,
00093 const double & latitude,
00094 const double & altitude,
00095 const double & error,
00096 const double & bearing):
00097 stamp_(stamp),
00098 longitude_(longitude),
00099 latitude_(latitude),
00100 altitude_(altitude),
00101 error_(error),
00102 bearing_(bearing)
00103 {}
00104 const double & stamp() const {return stamp_;}
00105 const double & longitude() const {return longitude_;}
00106 const double & latitude() const {return latitude_;}
00107 const double & altitude() const {return altitude_;}
00108 const double & error() const {return error_;}
00109 const double & bearing() const {return bearing_;}
00110
00111 GeodeticCoords toGeodeticCoords() const {return GeodeticCoords(latitude_, longitude_, altitude_);}
00112 private:
00113 double stamp_;
00114 double longitude_;
00115 double latitude_;
00116 double altitude_;
00117 double error_;
00118 double bearing_;
00119 };
00120
00121 }
00122
00123 #endif