Gazebo Sim

API Reference

8.6.0
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>
28 
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  {
48 
50  enum class ReferenceUnits {
51  RADIANS = 0,
52  DEGREES
53  };
54 
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 
76 
79 
82 
84  bool staticTime;
85  };
86 
89  using Environment =
90  Component<std::shared_ptr<EnvironmentalData>, class EnvironmentalDataTag>;
91 
93  "gz_sim_components.Environment", Environment)
94 }
95 }
96 }
97 }
98 
99 #endif