Gazebo Sim
API Reference
8.7.0
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-sim
include
gz
sim
components
Environment.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2022 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 GZ_SIM_ENVIRONMENT_HH_
19
#define GZ_SIM_ENVIRONMENT_HH_
20
21
#include <memory>
22
#include <string>
23
#include <utility>
24
25
#include <
gz/common/DataFrame.hh
>
26
#include <gz/math/SphericalCoordinates.hh>
27
#include <
gz/math/TimeVaryingVolumetricGrid.hh
>
28
29
#include <
gz/sim/components/Factory.hh
>
30
#include <
gz/sim/components/Component.hh
>
31
32
namespace
gz
33
{
34
namespace
sim
35
{
36
// Inline bracket to help doxygen filtering.
37
inline
namespace
GZ_SIM_VERSION_NAMESPACE {
38
namespace
components
39
{
43
struct
GZ_SIM_VISIBLE
EnvironmentalData
44
{
45
using
T
=
math::InMemoryTimeVaryingVolumetricGrid<double>
;
46
using
FrameT
=
common::DataFrame<std::string, T>
;
47
using
ReferenceT
=
math::SphericalCoordinates::CoordinateType
;
48
50
enum class
ReferenceUnits
{
51
RADIANS = 0,
52
DEGREES
53
};
54
61
static
std::shared_ptr<EnvironmentalData>
62
MakeShared
(
FrameT
_frame,
ReferenceT
_reference,
63
ReferenceUnits
_units = ReferenceUnits::RADIANS,
64
bool
_ignoreTimeStep =
false
)
65
{
66
auto
data = std::make_shared<EnvironmentalData>();
67
data->frame =
std::move
(_frame);
68
data->reference = _reference;
69
data->units = _units;
70
data->staticTime = _ignoreTimeStep;
71
return
data;
72
}
73
75
FrameT
frame
;
76
78
ReferenceT
reference
;
79
81
ReferenceUnits
units
;
82
84
bool
staticTime
;
85
};
86
89
using
Environment
=
90
Component<std::shared_ptr<EnvironmentalData>
,
class
EnvironmentalDataTag>;
91
92
GZ_SIM_REGISTER_COMPONENT
(
93
"gz_sim_components.Environment"
,
Environment
)
94
}
95
}
96
}
97
}
98
99
#endif