SphericalCoordinates.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef _GAZEBO_SPHERICALCOORDINATES_HH_
18 #define _GAZEBO_SPHERICALCOORDINATES_HH_
19 
20 #include <string>
21 
22 #include <ignition/math/Angle.hh>
23 #include <ignition/math/Vector3.hh>
24 
26 #include "gazebo/math/Angle.hh"
27 #include "gazebo/math/Vector3.hh"
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
32  namespace common
33  {
34  class SphericalCoordinatesPrivate;
35 
38 
42  {
45  public: enum SurfaceType
46  {
49  EARTH_WGS84 = 1
50  };
51 
53  public: SphericalCoordinates();
54 
57  public: SphericalCoordinates(const SurfaceType _type);
58 
67  public: SphericalCoordinates(const SurfaceType _type,
68  const math::Angle &_latitude,
69  const math::Angle &_longitude,
70  double _elevation,
71  const math::Angle &_heading) GAZEBO_DEPRECATED(6.0);
72 
79  public: SphericalCoordinates(const SurfaceType _type,
80  const ignition::math::Angle &_latitude,
81  const ignition::math::Angle &_longitude,
82  double _elevation,
83  const ignition::math::Angle &_heading);
84 
86  public: ~SphericalCoordinates();
87 
94  public: math::Vector3 SphericalFromLocal(const math::Vector3 &_xyz) const
95  GAZEBO_DEPRECATED(6.0);
96 
101  public: ignition::math::Vector3d SphericalFromLocal(
102  const ignition::math::Vector3d &_xyz) const;
103 
110  public: math::Vector3 GlobalFromLocal(const math::Vector3 &_xyz) const
111  GAZEBO_DEPRECATED(6.0);
112 
117  public: ignition::math::Vector3d GlobalFromLocal(
118  const ignition::math::Vector3d &_xyz) const;
119 
123  public: static SurfaceType Convert(const std::string &_str);
124 
136  public: static double Distance(const math::Angle &_latA,
137  const math::Angle &_lonA,
138  const math::Angle &_latB,
139  const math::Angle &_lonB) GAZEBO_DEPRECATED(6.0);
140 
150  public: static double Distance(const ignition::math::Angle &_latA,
151  const ignition::math::Angle &_lonA,
152  const ignition::math::Angle &_latB,
153  const ignition::math::Angle &_lonB);
154 
155 
158  public: SurfaceType GetSurfaceType() const;
159 
164  public: math::Angle GetLatitudeReference() const GAZEBO_DEPRECATED(6.0);
165 
168  public: ignition::math::Angle LatitudeReference() const;
169 
174  public: math::Angle GetLongitudeReference() const GAZEBO_DEPRECATED(6.0);
175 
178  public: ignition::math::Angle LongitudeReference() const;
179 
182  public: double GetElevationReference() const;
183 
190  public: math::Angle GetHeadingOffset() const GAZEBO_DEPRECATED(6.0);
191 
196  public: ignition::math::Angle HeadingOffset() const;
197 
200  public: void SetSurfaceType(const SurfaceType &_type);
201 
206  public: void SetLatitudeReference(const math::Angle &_angle)
207  GAZEBO_DEPRECATED(6.0);
208 
211  public: void SetLatitudeReference(const ignition::math::Angle &_angle);
212 
217  public: void SetLongitudeReference(const math::Angle &_angle)
218  GAZEBO_DEPRECATED(6.0);
219 
222  public: void SetLongitudeReference(const ignition::math::Angle &_angle);
223 
226  public: void SetElevationReference(double _elevation);
227 
232  public: void SetHeadingOffset(const math::Angle &_angle)
233  GAZEBO_DEPRECATED(6.0);
234 
237  public: void SetHeadingOffset(const ignition::math::Angle &_angle);
238 
241  private: SphericalCoordinatesPrivate *dataPtr;
242  };
244  }
245 }
246 #endif
Convert spherical coordinates for planetary surfaces.
Definition: SphericalCoordinates.hh:41
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:47
GAZEBO_VISIBLE msgs::Vector3d Convert(const math::Vector3 &_v) GAZEBO_DEPRECATED(6.0)
Convert a math::Vector3 to a msgs::Vector3d.
#define GZ_COMMON_VISIBLE
Definition: system.hh:91
commmon/common.hh
Definition: SphericalCoordinatesPrivate.hh:39
An angle and related functions.
Definition: Angle.hh:53
SurfaceType
Unique identifiers for planetary surface models.
Definition: SphericalCoordinates.hh:45