Public Member Functions | Protected Member Functions | Protected Attributes
swri_transform_util::LocalXyWgs84Util Class Reference

Utility class for converting between WGS84 lat/lon and an ortho-rectified LocalXY coordinate system. More...

#include <local_xy_util.h>

List of all members.

Public Member Functions

std::string Frame () const
 Return the TF frame ID corresponding to the local origin.
bool Initialized () const
 Return whether the object has been initialized.
 LocalXyWgs84Util (double reference_latitude, double reference_longitude, double reference_angle=0, double reference_altitude=0)
 Initializing constructor.
 LocalXyWgs84Util ()
 Zero-argument constructor.
double ReferenceAltitude () const
 Return the altitude coordinate of the local origin.
double ReferenceAngle () const
 Return the reference angle in degrees ENU.
double ReferenceLatitude () const
 Return the latitude coordinate of the local origin.
double ReferenceLongitude () const
 Return the longitude coordinate of the local origin.
bool ToLocalXy (double latitude, double longitude, double &x, double &y) const
 Convert WGS84 latitude and longitude to LocalXY.
bool ToWgs84 (double x, double y, double &latitude, double &longitude) const
 Convert LocalXY to WGS84 latitude and longitude.

Protected Member Functions

void HandleOrigin (const topic_tools::ShapeShifter::ConstPtr origin)
void Initialize ()

Protected Attributes

double cos_angle_
std::string frame_
bool initialized_
ros::Subscriber origin_sub_
double reference_altitude_
double reference_angle_
double reference_latitude_
double reference_longitude_
double rho_lat_
double rho_lon_
double sin_angle_

Detailed Description

Utility class for converting between WGS84 lat/lon and an ortho-rectified LocalXY coordinate system.

To use this class, first construct it with a reference origin. The reference origin should be a latitude, longitude, angle, and altitude in WGS84 coordinates. Once initialized, a LocalXyWgs84Util can be used to convert WGS84 coordinates to and from an ortho-rectified frame with its origin at the reference origin. Because the earth is spherical, the error in the ortho-rectified frame will accumulate as the distance from the reference origin increases. For this reason, the reference origin should be chosen to be close to the region of interest (<10 km).

It is strongly recommended to use 0 degrees for the angle. This corresponds to the X-axis of the ortho-rectified frame pointing east.

Definition at line 99 of file local_xy_util.h.


Constructor & Destructor Documentation

swri_transform_util::LocalXyWgs84Util::LocalXyWgs84Util ( double  reference_latitude,
double  reference_longitude,
double  reference_angle = 0,
double  reference_altitude = 0 
)

Initializing constructor.

This constructor creates and initializes a LocalXyWgs84Util.

Parameters:
[in]reference_latitudeReference latitude in degrees.
[in]reference_longitudeReference longitude in degrees.
[in]reference_angleReference angle in degrees ENU.
[in]reference_altitudeReference altitude in meters.

Zero-argument constructor.

This constructor creates an uninitialized LocalXyWgs84Util. This constructor is only used to create placeholder objects in containers that require a zero-argument constructor.


Member Function Documentation

std::string swri_transform_util::LocalXyWgs84Util::Frame ( ) const [inline]

Return the TF frame ID corresponding to the local origin.

Returns:
The TF frame ID corresponding to the local origin

Definition at line 168 of file local_xy_util.h.

Return whether the object has been initialized.

The object is not usable unless it has been initialized (see the two constructors).

Returns:
True if initialized, false otherwise.

Definition at line 135 of file local_xy_util.h.

Return the altitude coordinate of the local origin.

Returns:
The WGS84 altitude coordinate of the local origin in meters

Return the reference angle in degrees ENU.

Return the latitude coordinate of the local origin.

Returns:
The WGS84 latitude coordinate of the local origin in degrees

Return the longitude coordinate of the local origin.

Returns:
The WGS84 longitude coordinate of the local origin in degrees
bool swri_transform_util::LocalXyWgs84Util::ToLocalXy ( double  latitude,
double  longitude,
double &  x,
double &  y 
) const

Convert WGS84 latitude and longitude to LocalXY.

Parameters:
[in]latitudeLatitude value in degrees.
[in]longitudeLongitude value in degrees.
[out]xX coordinate in meters from origin.
[out]yY coordinate in meters from origin.
Returns:
True if the conversion is possible.
bool swri_transform_util::LocalXyWgs84Util::ToWgs84 ( double  x,
double  y,
double &  latitude,
double &  longitude 
) const

Convert LocalXY to WGS84 latitude and longitude.

Parameters:
[in]xX coordinate in meters from origin.
[in]yY coordinate in meters from origin.
[out]latitudeLatitude value in degrees.
[out]longitudeLongitude value in degrees.
Returns:
True if the conversion is possible.

Member Data Documentation

Definition at line 210 of file local_xy_util.h.

Definition at line 213 of file local_xy_util.h.

Definition at line 216 of file local_xy_util.h.

Definition at line 215 of file local_xy_util.h.

Definition at line 206 of file local_xy_util.h.

Definition at line 205 of file local_xy_util.h.

Definition at line 203 of file local_xy_util.h.

Definition at line 204 of file local_xy_util.h.

Definition at line 208 of file local_xy_util.h.

Definition at line 209 of file local_xy_util.h.

Definition at line 211 of file local_xy_util.h.


The documentation for this class was generated from the following file:


swri_transform_util
Author(s): Marc Alban
autogenerated on Tue Oct 3 2017 03:19:48