46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <Eigen/Core>
|
|
#include <GeographicLib/Ellipsoid.hpp>
|
|
#include <GeographicLib/Geocentric.hpp>
|
|
#include <GeographicLib/Geodesic.hpp>
|
|
#include <GeographicLib/GeodesicLine.hpp>
|
|
#include <GeographicLib/Constants.hpp>
|
|
#include <memory>
|
|
|
|
namespace SimCore {
|
|
class Position {
|
|
public:
|
|
Position();
|
|
Position(double X, double Y, double Z);
|
|
|
|
/**
|
|
* @brief returns a eigen vector3d with the X, Y, Z coordinates
|
|
* @return Eigen::Vector3d
|
|
*/
|
|
Eigen::Vector3d getGeocentricPos();
|
|
|
|
/**
|
|
* @brief returns a eigen vector3d with the lat, lon, height coordinates
|
|
* @return Eigen::Vector3d
|
|
*/
|
|
Eigen::Vector3d getGeodesicPos();
|
|
|
|
void setGeocentricPos(double X, double Y, double Z);
|
|
void setGeodesicPos(double lat, double lon, int height);
|
|
|
|
|
|
private:
|
|
std::shared_ptr<GeographicLib::Geocentric> earth_ = nullptr;
|
|
std::shared_ptr<GeographicLib::Geodesic> geod_ = nullptr;
|
|
std::shared_ptr<GeographicLib::Ellipsoid> wgs84_ = nullptr;
|
|
|
|
Eigen::Vector3d GeodesicPos_; // lat long height
|
|
Eigen::Vector3d GeocentricPos_; ///x y z
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
} |