Gazebo Sim

API Reference

9.0.0
Sensor.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 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_SIM_SENSOR_HH_
18#define GZ_SIM_SENSOR_HH_
19
20#include <memory>
21#include <optional>
22#include <string>
23
24#include <gz/utils/ImplPtr.hh>
25
26#include <gz/math/Pose3.hh>
27
28#include <sdf/Sensor.hh>
29
30#include "gz/sim/config.hh"
32#include "gz/sim/Export.hh"
33#include "gz/sim/Types.hh"
34
35namespace gz
36{
37 namespace sim
38 {
39 // Inline bracket to help doxygen filtering.
40 inline namespace GZ_SIM_VERSION_NAMESPACE {
41 //
61 class GZ_SIM_VISIBLE Sensor
62 {
65 public: explicit Sensor(sim::Entity _entity = kNullEntity);
66
69 public: sim::Entity Entity() const;
70
73 public: void ResetEntity(sim::Entity _newEntity);
74
79 public: bool Valid(const EntityComponentManager &_ecm) const;
80
85 public: std::optional<std::string> Name(
86 const EntityComponentManager &_ecm) const;
87
92 public: std::optional<math::Pose3d> Pose(
93 const EntityComponentManager &_ecm) const;
94
99 public: std::optional<std::string> Topic(
100 const EntityComponentManager &_ecm) const;
101
106 public: std::optional<sim::Entity> Parent(
107 const EntityComponentManager &_ecm) const;
108
110 GZ_UTILS_IMPL_PTR(dataPtr)
111 };
112 }
113 }
114}
115#endif