Go to the documentation of this file.
17 #ifndef IGNITION_SENSORS_MANAGER_HH_
18 #define IGNITION_SENSORS_MANAGER_HH_
23 #include <type_traits>
26 #include <ignition/common/SuppressWarning.hh>
27 #include <ignition/common/Console.hh>
28 #include <ignition/sensors/config.hh>
29 #include <ignition/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;
101 sdf::ElementPtr _sdf);
136 public:
void RunOnce(const
std::chrono::steady_clock::duration &_time,
137 bool _force = false);
140 public:
void IGN_DEPRECATED(6) AddPluginPaths(const
std::
string &_path);
142 IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
144 private:
std::unique_ptr<ManagerPrivate> dataPtr;
145 IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Definition: AirPressureSensor.hh:31
SensorType * CreateSensor(SdfType _sdf)
Create a sensor from an SDF ovject with a known sensor type.
Definition: Manager.hh:74
virtual ~Manager()
destructor
Loads and runs sensors.
Definition: Manager.hh:53
void RunOnce(const std::chrono::steady_clock::duration &_time, bool _force=false)
Run the sensor generation one step.
const SensorId NO_SENSOR
Definition: Sensor.hh:49
void AddPluginPaths(const std::string &_path)
Adds colon delimited paths sensor plugins may be.
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: SensorFactory.hh:72
Sensor * Sensor(SensorId _id)
Get an instance of a loaded sensor by sensor id.
a base sensor class
Definition: Sensor.hh:59
bool Remove(const SensorId _id)
Remove a sensor by ID.
std::unique_ptr< SensorType > CreateSensor(const sdf::Sensor &_sdf)
Create a sensor from a SDF DOM object with a known sensor type.
Definition: SensorFactory.hh:86
SensorId AddSensor(std::unique_ptr< Sensor > _sensor)
Add a sensor for this manager to manage.