Gazebo Math
API Reference
9.0.0~pre1
insert_drive_file
Tutorials
library_books
Classes
toc
Namespaces
insert_drive_file
Files
launch
Gazebo Website
Index
List
Hierarchy
Members: All
Members: Functions
Members: Variables
Members: Typedefs
Members: Enumerations
Members: Enumerator
List
Members
Functions
Typedefs
Variables
Enumerations
Enumerator
src
gz-math
include
gz
math
SphericalCoordinates.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2012 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 GZ_MATH_SPHERICALCOORDINATES_HH_
18
#define GZ_MATH_SPHERICALCOORDINATES_HH_
19
20
#include <optional>
21
#include <string>
22
23
#include <
gz/math/Angle.hh
>
24
#include <
gz/math/CoordinateVector3.hh
>
25
#include <
gz/math/Vector3.hh
>
26
#include <
gz/math/Helpers.hh
>
27
#include <gz/math/config.hh>
28
#include <gz/utils/ImplPtr.hh>
29
30
namespace
gz::math
31
{
32
// Inline bracket to help doxygen filtering.
33
inline
namespace
GZ_MATH_VERSION_NAMESPACE {
34
36
class
GZ_MATH_VISIBLE
SphericalCoordinates
37
{
40
public
:
enum
SurfaceType
41
{
44
EARTH_WGS84 = 1,
45
49
MOON_SCS = 2,
50
52
CUSTOM_SURFACE = 10
53
};
54
57
public
:
enum
CoordinateType
58
{
60
SPHERICAL = 1,
61
63
ECEF = 2,
64
66
GLOBAL = 3,
67
69
LOCAL = 4,
70
};
71
73
public
:
SphericalCoordinates
();
74
77
public
:
explicit
SphericalCoordinates
(
const
SurfaceType
_type
);
78
84
public
:
SphericalCoordinates
(
85
const
SurfaceType
_type
,
86
const
double
_axisEquatorial
,
87
const
double
_axisPolar
);
88
95
public
:
SphericalCoordinates
(
const
SurfaceType
_type
,
96
const
gz::math::Angle
&
_latitude
,
97
const
gz::math::Angle
&
_longitude
,
98
const
double
_elevation
,
99
const
gz::math::Angle
&
_heading
);
100
108
public
: std::optional<math::CoordinateVector3>
SphericalFromLocalPosition
(
109
const
gz::math::CoordinateVector3
&
_xyz
)
const
;
110
118
public
: std::optional<math::CoordinateVector3>
GlobalFromLocalVelocity
(
119
const
gz::math::CoordinateVector3
&
_xyz
)
const
;
120
125
public
:
static
SurfaceType
Convert
(
const
std::string
&
_str
);
126
130
public
:
static
std::string
Convert
(
SurfaceType
_type
);
131
142
public
:
static
double
DistanceWGS84
(
143
const
gz::math::Angle
&
_latA
,
144
const
gz::math::Angle
&
_lonA
,
145
const
gz::math::Angle
&
_latB
,
146
const
gz::math::Angle
&
_lonB
);
147
157
public
:
double
DistanceBetweenPoints
(
158
const
gz::math::Angle
&
_latA
,
159
const
gz::math::Angle
&
_lonA
,
160
const
gz::math::Angle
&
_latB
,
161
const
gz::math::Angle
&
_lonB
);
162
165
public
:
SurfaceType
Surface
()
const
;
166
169
public
:
double
SurfaceRadius
()
const
;
170
173
public
:
double
SurfaceAxisEquatorial
()
const
;
174
177
public
:
double
SurfaceAxisPolar
()
const
;
178
181
public
:
double
SurfaceFlattening
()
const
;
182
185
public
:
gz::math::Angle
LatitudeReference
()
const
;
186
189
public
:
gz::math::Angle
LongitudeReference
()
const
;
190
193
public
:
double
ElevationReference
()
const
;
194
199
public
:
gz::math::Angle
HeadingOffset
()
const
;
200
203
public
:
void
SetSurface
(
const
SurfaceType
&
_type
);
204
210
public
:
void
SetSurface
(
211
const
SurfaceType
&
_type
,
212
const
double
_axisEquatorial
,
213
const
double
_axisPolar
);
214
217
public
:
void
SetLatitudeReference
(
const
gz::math::Angle
&
_angle
);
218
221
public
:
void
SetLongitudeReference
(
const
gz::math::Angle
&
_angle
);
222
225
public
:
void
SetElevationReference
(
const
double
_elevation
);
226
229
public
:
void
SetHeadingOffset
(
const
gz::math::Angle
&
_angle
);
230
236
public
: std::optional<math::CoordinateVector3>
LocalFromSphericalPosition
(
237
const
gz::math::CoordinateVector3
&
_latLonEle
)
const
;
238
244
public
: std::optional<math::CoordinateVector3>
LocalFromGlobalVelocity
(
245
const
gz::math::CoordinateVector3
&
_xyz
)
const
;
246
248
public
:
void
UpdateTransformationMatrix
();
249
256
public
: std::optional<gz::math::CoordinateVector3>
257
PositionTransform
(
const
gz::math::CoordinateVector3
&
_pos
,
258
const
CoordinateType
&
_in
,
const
CoordinateType
&
_out
)
const
;
259
266
public
: std::optional<gz::math::CoordinateVector3>
VelocityTransform
(
267
const
gz::math::CoordinateVector3
&
_vel
,
268
const
CoordinateType
&
_in
,
const
CoordinateType
&
_out
)
const
;
269
273
public
:
bool
operator==
(
const
SphericalCoordinates
&
_sc
)
const
;
274
278
public
:
bool
operator!=
(
const
SphericalCoordinates
&
_sc
)
const
;
279
281
GZ_UTILS_IMPL_PTR
(dataPtr)
282
};
283
}
// namespace GZ_MATH_VERSION_NAMESPACE
284
}
// namespace gz::math
285
#endif
// GZ_MATH_SPHERICALCOORDINATES_HH_