GeodeticCoords.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 /*
29  * The methods in this file were modified from the originals of the MRPT toolkit (see notice below):
30  * https://github.com/MRPT/mrpt/blob/master/libs/topography/src/conversions.cpp
31  */
32 
33 /* +---------------------------------------------------------------------------+
34  | Mobile Robot Programming Toolkit (MRPT) |
35  | http://www.mrpt.org/ |
36  | |
37  | Copyright (c) 2005-2016, Individual contributors, see AUTHORS file |
38  | See: http://www.mrpt.org/Authors - All rights reserved. |
39  | Released under BSD License. See details in http://www.mrpt.org/License |
40  +---------------------------------------------------------------------------+ */
41 
42 
43 #ifndef GEODETICCOORDS_H_
44 #define GEODETICCOORDS_H_
45 
47 
48 #include <opencv2/core/core.hpp>
49 
50 namespace rtabmap {
51 
53 {
54 public:
56  GeodeticCoords(double latitude, double longitude, double altitude);
57 
58  const double & latitude() const {return latitude_;}
59  const double & longitude() const {return longitude_;}
60  const double & altitude() const {return altitude_;}
61 
62  void setLatitude(const double & value) {latitude_ = value;}
63  void setLongitude(const double & value) {longitude_ = value;}
64  void setAltitude(const double & value) {altitude_ = value;}
65 
66  cv::Point3d toGeocentric_WGS84() const;
67  cv::Point3d toENU_WGS84(const GeodeticCoords & origin) const; // East=X, North=Y
68 
69  void fromGeocentric_WGS84(const cv::Point3d& geocentric);
70  void fromENU_WGS84(const cv::Point3d & enu, const GeodeticCoords & origin);
71 
72  static cv::Point3d ENU_WGS84ToGeocentric_WGS84(const cv::Point3d & enu, const GeodeticCoords & origin);
73  static cv::Point3d Geocentric_WGS84ToENU_WGS84(
74  const cv::Point3d & geocentric_WGS84,
75  const cv::Point3d & origin_geocentric_WGS84,
76  const GeodeticCoords & origin);
77 
78 private:
79  double latitude_; // deg
80  double longitude_; // deg
81  double altitude_; // m
82 };
83 
84 }
85 
86 #endif /* GEODETICCOORDS_H_ */
void setLongitude(const double &value)
const double & altitude() const
const double & longitude() const
#define RTABMAP_EXP
Definition: RtabmapExp.h:38
const double & latitude() const
void setLatitude(const double &value)
void setAltitude(const double &value)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:34:58