Go to the documentation of this file.
17 #ifndef _GAZEBO_SPHERICALCOORDINATES_HH_
18 #define _GAZEBO_SPHERICALCOORDINATES_HH_
22 #include <ignition/math/Angle.hh>
23 #include <ignition/math/Vector3.hh>
32 class SphericalCoordinatesPrivate;
81 const ignition::math::Angle &_latitude,
82 const ignition::math::Angle &_longitude,
84 const ignition::math::Angle &_heading);
93 public: ignition::math::Vector3d SphericalFromLocal(
94 const ignition::math::Vector3d &_xyz)
const;
100 public: ignition::math::Vector3d GlobalFromLocal(
101 const ignition::math::Vector3d &_xyz)
const;
106 public:
static SurfaceType
Convert(
const std::string &_str);
117 public:
static double Distance(
const ignition::math::Angle &_latA,
118 const ignition::math::Angle &_lonA,
119 const ignition::math::Angle &_latB,
120 const ignition::math::Angle &_lonB);
124 public: SurfaceType GetSurfaceType()
const;
128 public: ignition::math::Angle LatitudeReference()
const;
132 public: ignition::math::Angle LongitudeReference()
const;
136 public:
double GetElevationReference()
const;
142 public: ignition::math::Angle HeadingOffset()
const;
146 public:
void SetSurfaceType(
const SurfaceType &_type);
150 public:
void SetLatitudeReference(
const ignition::math::Angle &_angle);
154 public:
void SetLongitudeReference(
const ignition::math::Angle &_angle);
158 public:
void SetElevationReference(
double _elevation);
162 public:
void SetHeadingOffset(
const ignition::math::Angle &_angle);
167 public: ignition::math::Vector3d LocalFromSpherical(
168 const ignition::math::Vector3d &_xyz)
const;
174 public: ignition::math::Vector3d LocalFromGlobal(
175 const ignition::math::Vector3d &_xyz)
const;
178 public:
void UpdateTransformationMatrix();
185 public: ignition::math::Vector3d
186 PositionTransform(
const ignition::math::Vector3d &_pos,
187 const CoordinateType &_in,
const CoordinateType &_out)
const;
194 public: ignition::math::Vector3d VelocityTransform(
195 const ignition::math::Vector3d &_vel,
196 const CoordinateType &_in,
const CoordinateType &_out)
const;
200 private: SphericalCoordinatesPrivate *dataPtr;
ignition::math::Vector3d LocalFromGlobal(const ignition::math::Vector3d &_xyz) const
Convert a Cartesian vector with components East, North, Up to a local Gazebo cartesian frame vector X...
Forward declarations for the common classes.
Definition: Animation.hh:26
void UpdateTransformationMatrix()
Update coordinate transformation matrix with reference location.
CoordinateType
Unique identifiers for coordinate types.
Definition: SphericalCoordinates.hh:52
Convert spherical coordinates for planetary surfaces.
Definition: SphericalCoordinates.hh:39
ignition::math::Vector3d LocalFromSpherical(const ignition::math::Vector3d &_xyz) const
Convert a geodetic position vector to Cartesian coordinates.
common
Definition: FuelModelDatabase.hh:37
SurfaceType
Unique identifiers for planetary surface models.
Definition: SphericalCoordinates.hh:43
void SetLongitudeReference(const ignition::math::Angle &_angle)
Set reference longitude.
GAZEBO_VISIBLE msgs::Vector3d Convert(const ignition::math::Vector3d &_v)
Convert a ignition::math::Vector3 to a msgs::Vector3d.
ignition::math::Angle HeadingOffset() const
Get heading offset for gazebo reference frame, expressed as angle from East to gazebo x-axis,...
void SetHeadingOffset(const ignition::math::Angle &_angle)
Set heading angle offset for gazebo frame.
ignition::math::Vector3d VelocityTransform(const ignition::math::Vector3d &_vel, const CoordinateType &_in, const CoordinateType &_out) const
Convert between velocity in SPHERICAL/ECEF/LOCAL/GLOBAL frame.
ignition::math::Angle LatitudeReference() const
Get reference geodetic latitude.
double GetElevationReference() const
Get reference elevation in meters.
SurfaceType GetSurfaceType() const
Get SurfaceType currently in use.
void SetSurfaceType(const SurfaceType &_type)
Set SurfaceType for planetary surface model.
@ SPHERICAL
Latitude, Longitude and Altitude by SurfaceType.
Definition: SphericalCoordinates.hh:55
static SurfaceType Convert(const std::string &_str)
Convert a string to a SurfaceType.
static double Distance(const ignition::math::Angle &_latA, const ignition::math::Angle &_lonA, const ignition::math::Angle &_latB, const ignition::math::Angle &_lonB)
Get the distance between two points expressed in geographic latitude and longitude.
void SetElevationReference(double _elevation)
Set reference elevation above sea level in meters.
@ GLOBAL
Local tangent plane (East, North, Up)
Definition: SphericalCoordinates.hh:61
ignition::math::Angle LongitudeReference() const
Get reference longitude.
ignition::math::Vector3d SphericalFromLocal(const ignition::math::Vector3d &_xyz) const
Convert a Cartesian position vector to geodetic coordinates.
@ EARTH_WGS84
Model of reference ellipsoid for earth, based on WGS 84 standard.
Definition: SphericalCoordinates.hh:47
ignition::math::Vector3d PositionTransform(const ignition::math::Vector3d &_pos, const CoordinateType &_in, const CoordinateType &_out) const
Convert between positions in SPHERICAL/ECEF/LOCAL/GLOBAL frame.
~SphericalCoordinates()
Destructor.
ignition::math::Vector3d GlobalFromLocal(const ignition::math::Vector3d &_xyz) const
Convert a Cartesian velocity vector in the local gazebo frame to a global Cartesian frame with compon...
@ ECEF
Earth centered, earth fixed Cartesian.
Definition: SphericalCoordinates.hh:58
void SetLatitudeReference(const ignition::math::Angle &_angle)
Set reference geodetic latitude.
@ LOCAL
Heading-adjusted tangent plane (X, Y, Z)
Definition: SphericalCoordinates.hh:64
SphericalCoordinates()
Constructor.