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 #ifndef HECTOR_POSE_ESTIMATION_GLOBAL_REFERENCE_H
00030 #define HECTOR_POSE_ESTIMATION_GLOBAL_REFERENCE_H
00031
00032 #include <hector_pose_estimation/types.h>
00033 #include <hector_pose_estimation/parameters.h>
00034
00035 namespace hector_pose_estimation {
00036
00037 class PoseEstimation;
00038
00039 class GlobalReference {
00040 public:
00041 struct Position {
00042 Position() : latitude(0.0), longitude(0.0), altitude(0.0) {}
00043 double latitude;
00044 double longitude;
00045 double altitude;
00046 };
00047
00048 struct Heading {
00049 Heading() : value(0.0), cos(1.0), sin(0.0) {}
00050 double value;
00051 double cos;
00052 double sin;
00053 operator double() const { return value; }
00054 };
00055
00056 struct Radius {
00057 Radius() : north(0.0), east(0.0) {}
00058 double north;
00059 double east;
00060 };
00061
00062 const Position& position() const { return position_; }
00063 const Heading& heading() const { return heading_; }
00064 const Radius& radius() const { return radius_; }
00065
00066 GlobalReference& setPosition(double latitude, double longitude, bool quiet = false);
00067 GlobalReference& setHeading(double heading, bool quiet = false);
00068 GlobalReference& setAltitude(double altitude, bool quiet = false);
00069
00070 GlobalReference& setCurrentPosition(const State& state, double latitude, double longitude);
00071 GlobalReference& setCurrentHeading(const State& state, double heading);
00072 GlobalReference& setCurrentAltitude(const State& state, double altitude);
00073
00074 bool hasPosition() const { return has_position_; }
00075 bool hasHeading() const { return has_heading_; }
00076 bool hasAltitude() const { return has_altitude_; }
00077
00078 void fromWGS84(double latitude, double longitude, double &x, double &y);
00079 void toWGS84(double x, double y, double &latitude, double &longitude);
00080 void fromNorthEast(double north, double east, double &x, double &y);
00081 void toNorthEast(double x, double y, double &north, double &east);
00082
00083 ParameterList& parameters();
00084
00085 static const GlobalReferencePtr &Instance();
00086
00087 void updated();
00088 void reset();
00089
00090 private:
00091 GlobalReference();
00092
00093 Position position_;
00094 Heading heading_;
00095 Radius radius_;
00096
00097 bool has_position_;
00098 bool has_heading_;
00099 bool has_altitude_;
00100
00101 ParameterList parameters_;
00102 };
00103
00104 }
00105
00106 #endif // HECTOR_POSE_ESTIMATION_GLOBAL_REFERENCE_H