All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SphericalCoordinates.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2014 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 
18 #ifndef _SPHERICALCOORDINATES_HH_
19 #define _SPHERICALCOORDINATES_HH_
20 
21 #include <string>
22 
23 #include "gazebo/math/Angle.hh"
24 #include "gazebo/math/Vector3.hh"
25 
26 namespace gazebo
27 {
28  namespace common
29  {
32 
36  {
39  public: enum SurfaceType
40  {
44  };
45 
47  public: SphericalCoordinates();
48 
51  public: SphericalCoordinates(const SurfaceType _type);
52 
59  public: SphericalCoordinates(const SurfaceType _type,
60  const math::Angle &_latitude,
61  const math::Angle &_longitude,
62  double _elevation,
63  const math::Angle &_heading);
64 
66  public: ~SphericalCoordinates();
67 
73  const;
74 
79  public: math::Vector3 GlobalFromLocal(const math::Vector3 &_xyz)
80  const;
81 
85  public: static SurfaceType Convert(const std::string &_str);
86 
89  public: SurfaceType GetSurfaceType() const;
90 
93  public: math::Angle GetLatitudeReference() const;
94 
97  public: math::Angle GetLongitudeReference() const;
98 
101  public: double GetElevationReference() const;
102 
107  public: math::Angle GetHeadingOffset() const;
108 
111  public: void SetSurfaceType(const SurfaceType &_type);
112 
115  public: void SetLatitudeReference(const math::Angle &_angle);
116 
119  public: void SetLongitudeReference(const math::Angle &_angle);
120 
123  public: void SetElevationReference(double _elevation);
124 
127  public: void SetHeadingOffset(const math::Angle &_angle);
128 
130  private: SurfaceType surfaceType;
131 
133  private: math::Angle latitudeReference;
134 
136  private: math::Angle longitudeReference;
137 
139  private: double elevationReference;
140 
143  private: math::Angle headingOffset;
144  };
146  }
147 }
148 #endif