00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2010 University of Malaga | 00007 | | 00008 | This software was written by the Machine Perception and Intelligent | 00009 | Robotics Lab, University of Malaga (Spain). | 00010 | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> | 00011 | | 00012 | This file is part of the MRPT project. | 00013 | | 00014 | MRPT is free software: you can redistribute it and/or modify | 00015 | it under the terms of the GNU General Public License as published by | 00016 | the Free Software Foundation, either version 3 of the License, or | 00017 | (at your option) any later version. | 00018 | | 00019 | MRPT is distributed in the hope that it will be useful, | 00020 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00021 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 00022 | GNU General Public License for more details. | 00023 | | 00024 | You should have received a copy of the GNU General Public License | 00025 | along with MRPT. If not, see <http://www.gnu.org/licenses/>. | 00026 | | 00027 +---------------------------------------------------------------------------+ */ 00028 #ifndef conversions_H 00029 #define conversions_H 00030 00031 #include <mrpt/utils/utils_defs.h> 00032 #include <mrpt/math/lightweight_geom_data.h> 00033 00034 namespace mrpt 00035 { 00036 /** This namespace provides topography helper functions, coordinate transformations. 00037 */ 00038 namespace topography 00039 { 00040 00041 /** Coordinates transformation from longitude/latitude/height to X/Y/Z coordinates 00042 * The WGS84 ellipsoid is used for the transformation. The coordinates are in 3D 00043 * relative to some user-provided point, with local X axis being east-ward, Y north-ward, Z up-ward. 00044 * For an explanation, refer to http://en.wikipedia.org/wiki/Reference_ellipsoid 00045 * \sa coordinatesTransformation_WGS84_geocentric, ENU_axes_from_WGS84 00046 */ 00047 void MRPTDLLIMPEXP coordinatesTransformation_WGS84( 00048 double in_longitude_degrees, 00049 double in_latitude_degrees, 00050 double in_height_meters, 00051 double &out_x_meters, 00052 double &out_y_meters, 00053 double &out_z_meters, 00054 double in_longitude_reference_degrees, 00055 double in_latitude_reference_degrees, 00056 double in_height_reference_meters 00057 ); 00058 00059 /** Returns the East-North-Up (ENU) coordinate system associated to the given point. 00060 * This is the reference employed in coordinatesTransformation_WGS84 00061 * \param only_angles If set to true, the (x,y,z) fields will be left zeroed. 00062 * \sa coordinatesTransformation_WGS84 00063 */ 00064 void MRPTDLLIMPEXP ENU_axes_from_WGS84( 00065 double in_longitude_reference_degrees, 00066 double in_latitude_reference_degrees, 00067 double in_height_reference_meters, 00068 mrpt::math::TPose3D &out_ENU, 00069 bool only_angles = false 00070 ); 00071 00072 /** Coordinates transformation from longitude/latitude/height to geocentric X/Y/Z coordinates. 00073 * The WGS84 ellipsoid is used for the transformation. The coordinates are in 3D 00074 * where the reference is the center of the Earth. 00075 * For an explanation, refer to http://en.wikipedia.org/wiki/Reference_ellipsoid 00076 * \sa coordinatesTransformation_WGS84 00077 */ 00078 void MRPTDLLIMPEXP coordinatesTransformation_WGS84_geocentric( 00079 double in_longitude_degrees, 00080 double in_latitude_degrees, 00081 double in_height_meters, 00082 double &out_x_meters, 00083 double &out_y_meters, 00084 double &out_z_meters 00085 ); 00086 00087 /** Convert latitude and longitude coordinates into UTM coordinates, computing the corresponding UTM zone and latitude band. 00088 * This method is based on public code by Gabriel Ruiz Martinez and Rafael Palacios. 00089 * Example: 00090 \code 00091 Input: 00092 Lat=40.3154333 Lon=-3.4857166 00093 Output: 00094 x = 458731 00095 y = 4462881 00096 utm_zone = 30 00097 utm_band = T 00098 \endcode 00099 \sa http://www.mathworks.com/matlabcentral/fileexchange/10915 00100 */ 00101 void MRPTDLLIMPEXP LatLonToUTM( 00102 double in_latitude_degrees, 00103 double in_longitude_degrees, 00104 double &out_UTM_x, 00105 double &out_UTM_y, 00106 int &out_UTM_zone, 00107 char &out_UTM_latitude_band ); 00108 00109 } // End of namespace 00110 00111 } // End of namespace 00112 00113 #endif
| Page generated by Doxygen 1.6.2 for MRPT 0.8.1 SVN:exported at Mon Feb 15 22:01:07 UTC 2010 |
