17 #ifndef GZ_SENSORS_MANAGER_HH_
18 #define GZ_SENSORS_MANAGER_HH_
23 #include <type_traits>
26 #include <gz/common/SuppressWarning.hh>
27 #include <gz/common/Console.hh>
28 #include <gz/sensors/config.hh>
29 #include <gz/sensors/Export.hh>
38 inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
73 public:
template<
typename SensorType,
typename SdfType>
77 auto sensor = sensorFactory.
CreateSensor<SensorType>(_sdf);
78 if (
nullptr == sensor)
80 ignerr <<
"Failed to create sensor." <<
std::endl;
83 auto result = sensor.get();
86 ignerr <<
"Failed to add sensor." <<
std::endl;
113 sdf::ElementPtr _sdf);
135 public: gz::sensors::
SensorId IGN_DEPRECATED(6) CreateSensor(
154 public:
bool Remove(const gz::sensors::
SensorId _id);
160 public:
void RunOnce(const
std::chrono::steady_clock::duration &_time,
161 bool _force = false);
164 public:
void IGN_DEPRECATED(6) AddPluginPaths(const
std::
string &_path);
166 IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
168 private:
std::unique_ptr<ManagerPrivate> dataPtr;
169 IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Loads and runs sensors.
Definition: gz/sensors/Manager.hh:54
virtual ~Manager()
destructor
SensorType * CreateSensor(SdfType _sdf)
Create a sensor from an SDF ovject with a known sensor type.
Definition: gz/sensors/Manager.hh:74
bool Init()
Initialize the sensor library without rendering or physics.
A factory class for creating sensors This class instantiates sensor objects based on the sensor type ...
Definition: gz/sensors/SensorFactory.hh:73
std::unique_ptr< SensorType > CreateSensor(const sdf::Sensor &_sdf)
Create a sensor from a SDF DOM object with a known sensor type.
Definition: gz/sensors/SensorFactory.hh:92
a base sensor class
Definition: gz/sensors/Sensor.hh:60
std::size_t SensorId
A string used to identify a sensor.
Definition: gz/sensors/Sensor.hh:48
const SensorId NO_SENSOR
Definition: gz/sensors/Sensor.hh:49
Definition: gz/sensors/AirPressureSensor.hh:32