API Documentation
Loading...
Searching...
No Matches
GPSTypes.h
Go to the documentation of this file.
1#pragma once
2#include <NDEVR/Vertex.h>
3#if _WIN32
4#pragma warning( push )
5#pragma warning( disable : 4127)
6#include <Eigen/Core>
7#include <Eigen/Geometry>
8#pragma warning( pop )
9
10namespace NDEVR
11{
12 class GlobalPosition
13 {
14 protected:
15 GlobalPosition()
16 {}
17 GlobalPosition(int id, double timestamp)
18 : timestamp(timestamp)
19 , id(id)
20 {}
21
22 public:
23 virtual ~GlobalPosition() {}
24 virtual Eigen::Vector3d getRelativeFromOrigin(const GlobalPosition& origin) const = 0;
25 virtual Eigen::MatrixXd getCovariance() const = 0;
26 double timestamp;
27 int id;
28 };
29 class GpsMeasurement : public GlobalPosition
30 {
31 public:
32 GpsMeasurement() {}
33 GpsMeasurement(const int id, const double& latitude, const double& longitude, const double& altitude, const double& timestamp, const Eigen::Matrix3d& covariance, const Eigen::Vector3d noise = Eigen::Vector3d(0., 0., 0.)) :
34 GlobalPosition(id, timestamp), lat_lon_location(latitude, longitude, altitude), noise(noise), covariance(covariance) {}
35 Vertex<3, fltp08> lat_lon_location;
36 Eigen::Vector3d noise;
37 Eigen::Matrix3d covariance;
38
39 Eigen::Vector3d getRelativeFromOrigin(const GlobalPosition& origin) const override;
40 Eigen::MatrixXd getCovariance() const override;
41
42 };
43
44 class MocapMeasurement : public GlobalPosition
45 {
46 public:
47 // EIGEN_MAKE_ALIGNED_OPERATOR_NEW: http://eigen.tuxfamily.org/dox-devel/group__TopicStructHavingEigenMembers.html
48 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
49
50 MocapMeasurement() {}
51 MocapMeasurement(const int id,
52 const double& x, const double& y, const double& z,
53 const double& qx, const double& qy, const double& qz,
54 const double& qw, const double& timestamp,
55 const Eigen::Matrix3d& covariance,
56 const Eigen::Vector3d noise = Eigen::Vector3d(0., 0., 0.))
57 : GlobalPosition(id, timestamp)
58 , noise(noise)
59 , covariance(covariance)
60 {
61 position = Eigen::Vector3d(x, y, z);
62 rotation = Eigen::Quaterniond(qw, qx, qy, qz);
63 }
64 Eigen::Vector3d position;
65 Eigen::Quaterniond rotation;
66 Eigen::Vector3d noise;
67 Eigen::Matrix3d covariance;
68 Eigen::Vector3d getRelativeFromOrigin(const GlobalPosition& origin) const override;
69 Eigen::MatrixXd getCovariance() const override;
70 };
71 class GPSCalib
72 {
73 public:
74 GPSCalib(const Eigen::Vector3f& tbg)
75 : tbg(tbg)
76 , mbIsSet(true)
77 {}
78 GPSCalib()
79 : mbIsSet(false)
80 {}
81 public:
82 // Sophus/Eigen implementation
83 Eigen::Vector3f tbg;
84 bool mbIsSet;
85 };
86}
87#endif
Definition ACIColor.h:37