##

SphericalCoordinates.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _GAZEBO_SPHERICALCOORDINATES_HH_
#define _GAZEBO_SPHERICALCOORDINATES_HH_
#include <string>
#include <ignition/math/Angle.hh>
#include <ignition/math/Vector3.hh>
#include "gazebo/common/CommonTypes.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace common
{
class SphericalCoordinatesPrivate;
class GZ_COMMON_VISIBLE SphericalCoordinates
{
public: enum SurfaceType
{
EARTH_WGS84 = 1
};
public: enum CoordinateType
{
SPHERICAL = 1,
ECEF = 2,
GLOBAL = 3,
LOCAL = 4
};
public: SphericalCoordinates();
public: explicit SphericalCoordinates(const SurfaceType _type);
public: SphericalCoordinates(const SurfaceType _type,
const ignition::math::Angle &_latitude,
const ignition::math::Angle &_longitude,
double _elevation,
const ignition::math::Angle &_heading);
public: ~SphericalCoordinates();
public: ignition::math::Vector3d SphericalFromLocal(
const ignition::math::Vector3d &_xyz) const;
public: ignition::math::Vector3d GlobalFromLocal(
const ignition::math::Vector3d &_xyz) const;
public: static SurfaceType Convert(const std::string &_str);
public: static double Distance(const ignition::math::Angle &_latA,
const ignition::math::Angle &_lonA,
const ignition::math::Angle &_latB,
const ignition::math::Angle &_lonB);
public: SurfaceType GetSurfaceType() const;
public: ignition::math::Angle LatitudeReference() const;
public: ignition::math::Angle LongitudeReference() const;
public: double GetElevationReference() const;
public: ignition::math::Angle HeadingOffset() const;
public: void SetSurfaceType(const SurfaceType &_type);
public: void SetLatitudeReference(const ignition::math::Angle &_angle);
public: void SetLongitudeReference(const ignition::math::Angle &_angle);
public: void SetElevationReference(double _elevation);
public: void SetHeadingOffset(const ignition::math::Angle &_angle);
public: ignition::math::Vector3d LocalFromSpherical(
const ignition::math::Vector3d &_xyz) const;
public: ignition::math::Vector3d LocalFromGlobal(
const ignition::math::Vector3d &_xyz) const;
public: void UpdateTransformationMatrix();
public: ignition::math::Vector3d
PositionTransform(const ignition::math::Vector3d &_pos,
const CoordinateType &_in, const CoordinateType &_out) const;
public: ignition::math::Vector3d VelocityTransform(
const ignition::math::Vector3d &_vel,
const CoordinateType &_in, const CoordinateType &_out) const;
private: SphericalCoordinatesPrivate *dataPtr;
};
}
}
#endif
gazebo::common::SphericalCoordinates::LocalFromGlobal
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...
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::common::SphericalCoordinates::UpdateTransformationMatrix
void UpdateTransformationMatrix()
Update coordinate transformation matrix with reference location.
gazebo::common::SphericalCoordinates::CoordinateType
CoordinateType
Unique identifiers for coordinate types.
Definition: SphericalCoordinates.hh:52
gazebo::common::SphericalCoordinates
Convert spherical coordinates for planetary surfaces.
Definition: SphericalCoordinates.hh:39
gazebo::common::SphericalCoordinates::LocalFromSpherical
ignition::math::Vector3d LocalFromSpherical(const ignition::math::Vector3d &_xyz) const
Convert a geodetic position vector to Cartesian coordinates.
common
common
Definition: FuelModelDatabase.hh:37
gazebo::common::SphericalCoordinates::SurfaceType
SurfaceType
Unique identifiers for planetary surface models.
Definition: SphericalCoordinates.hh:43
gazebo::common::SphericalCoordinates::SetLongitudeReference
void SetLongitudeReference(const ignition::math::Angle &_angle)
Set reference longitude.
gazebo::msgs::Convert
GAZEBO_VISIBLE msgs::Vector3d Convert(const ignition::math::Vector3d &_v)
Convert a ignition::math::Vector3 to a msgs::Vector3d.
system.hh
gazebo::common::SphericalCoordinates::HeadingOffset
ignition::math::Angle HeadingOffset() const
Get heading offset for gazebo reference frame, expressed as angle from East to gazebo x-axis,...
gazebo::common::SphericalCoordinates::SetHeadingOffset
void SetHeadingOffset(const ignition::math::Angle &_angle)
Set heading angle offset for gazebo frame.
CommonTypes.hh
gazebo::common::SphericalCoordinates::VelocityTransform
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.
gazebo::common::SphericalCoordinates::LatitudeReference
ignition::math::Angle LatitudeReference() const
Get reference geodetic latitude.
gazebo::common::SphericalCoordinates::GetElevationReference
double GetElevationReference() const
Get reference elevation in meters.
gazebo::common::SphericalCoordinates::GetSurfaceType
SurfaceType GetSurfaceType() const
Get SurfaceType currently in use.
gazebo::common::SphericalCoordinates::SetSurfaceType
void SetSurfaceType(const SurfaceType &_type)
Set SurfaceType for planetary surface model.
gazebo::common::SphericalCoordinates::SPHERICAL
Latitude, Longitude and Altitude by SurfaceType.
Definition: SphericalCoordinates.hh:55
gazebo::common::SphericalCoordinates::Convert
static SurfaceType Convert(const std::string &_str)
Convert a string to a SurfaceType.
gazebo::common::SphericalCoordinates::Distance
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.
gazebo::common::SphericalCoordinates::SetElevationReference
void SetElevationReference(double _elevation)
Set reference elevation above sea level in meters.
gazebo::common::SphericalCoordinates::GLOBAL
Local tangent plane (East, North, Up)
Definition: SphericalCoordinates.hh:61
gazebo::common::SphericalCoordinates::LongitudeReference
ignition::math::Angle LongitudeReference() const
Get reference longitude.
gazebo::common::SphericalCoordinates::SphericalFromLocal
ignition::math::Vector3d SphericalFromLocal(const ignition::math::Vector3d &_xyz) const
Convert a Cartesian position vector to geodetic coordinates.
gazebo::common::SphericalCoordinates::EARTH_WGS84
Model of reference ellipsoid for earth, based on WGS 84 standard.
Definition: SphericalCoordinates.hh:47
gazebo::common::SphericalCoordinates::PositionTransform
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.
gazebo::common::SphericalCoordinates::~SphericalCoordinates
~SphericalCoordinates()
Destructor.
gazebo::common::SphericalCoordinates::GlobalFromLocal
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...
gazebo::common::SphericalCoordinates::ECEF
Earth centered, earth fixed Cartesian.
Definition: SphericalCoordinates.hh:58
gazebo::common::SphericalCoordinates::SetLatitudeReference
void SetLatitudeReference(const ignition::math::Angle &_angle)
Set reference geodetic latitude.
gazebo::common::SphericalCoordinates::LOCAL
Heading-adjusted tangent plane (X, Y, Z)
Definition: SphericalCoordinates.hh:64
gazebo::common::SphericalCoordinates::SphericalCoordinates
SphericalCoordinates()
Constructor.