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 #ifndef TRANSFORM_UTIL_LOCAL_XY_UTIL_H_
00031 #define TRANSFORM_UTIL_LOCAL_XY_UTIL_H_
00032
00033 #include <string>
00034
00035 #include <boost/shared_ptr.hpp>
00036
00037 #include <ros/ros.h>
00038 #include <swri_transform_util/transform_util.h>
00039 #include <topic_tools/shape_shifter.h>
00040
00041 namespace swri_transform_util
00042 {
00054 void LocalXyFromWgs84(
00055 double latitude,
00056 double longitude,
00057 double reference_latitude,
00058 double reference_longitude,
00059 double& x,
00060 double& y);
00061
00075 void Wgs84FromLocalXy(
00076 double x,
00077 double y,
00078 double reference_latitude,
00079 double reference_longitude,
00080 double& latitude,
00081 double& longitude);
00082
00100 class LocalXyWgs84Util
00101 {
00102 public:
00113 LocalXyWgs84Util(
00114 double reference_latitude,
00115 double reference_longitude,
00116 double reference_angle = 0,
00117 double reference_altitude = 0);
00118
00126 LocalXyWgs84Util();
00127
00136 bool Initialized() const { return initialized_; }
00137
00142 void ResetInitialization();
00143
00149 double ReferenceLongitude() const;
00150
00156 double ReferenceLatitude() const;
00157
00161 double ReferenceAngle() const;
00162
00168 double ReferenceAltitude() const;
00169
00175 std::string Frame() const { return frame_; }
00176
00182 std::string NormalizedFrame() const { return NormalizeFrameId(frame_); }
00183
00194 bool ToLocalXy(
00195 double latitude,
00196 double longitude,
00197 double& x,
00198 double& y) const;
00199
00210 bool ToWgs84(
00211 double x,
00212 double y,
00213 double& latitude,
00214 double& longitude) const;
00215
00216 protected:
00217 double reference_latitude_;
00218 double reference_longitude_;
00219 double reference_angle_;
00220 double reference_altitude_;
00221
00222 double rho_lat_;
00223 double rho_lon_;
00224 double cos_angle_;
00225 double sin_angle_;
00226
00227 std::string frame_;
00228
00229 ros::Subscriber origin_sub_;
00230 bool initialized_;
00231
00232 void Initialize();
00233
00234 void HandleOrigin(const topic_tools::ShapeShifter::ConstPtr origin);
00235 };
00236 typedef boost::shared_ptr<LocalXyWgs84Util> LocalXyWgs84UtilPtr;
00237 }
00238
00239 #endif // TRANSFORM_UTIL_LOCAL_XY_UTIL_H_