17 #ifndef IGNITION_SENSORS_MANAGER_HH_ 18 #define IGNITION_SENSORS_MANAGER_HH_ 22 #include <type_traits> 25 #include <ignition/common/Time.hh> 26 #include <ignition/common/Console.hh> 27 #include <ignition/sensors/config.hh> 28 #include <ignition/sensors/Export.hh> 36 inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
80 public:
template<
typename T>
87 T *result =
dynamic_cast<T*
>(this->
Sensor(
id));
90 ignerr <<
"SDF sensor type does not match template type\n";
95 ignerr <<
"Failed to create sensor of type[" 96 << _sdf.TypeStr() <<
"]\n";
117 public:
template<
typename T>
124 T *result =
dynamic_cast<T*
>(this->
Sensor(
id));
126 if (
nullptr == result)
128 ignerr <<
"Failed to create sensor [" <<
id <<
"] of type [" 130 <<
"]. SDF sensor type does not match template type." 137 ignerr <<
"Failed to create sensor of type [" 196 public:
void RunOnce(
const ignition::common::Time &_time,
197 bool _force =
false);
200 public:
void AddPluginPaths(
const std::string &_path);
206 const std::string &_filename, sdf::ElementPtr _sdf);
a base sensor class
Definition: Sensor.hh:50
Loads and runs sensors.
Definition: Manager.hh:51
const SensorId NO_SENSOR
Definition: Sensor.hh:40
T * CreateSensor(sdf::Sensor _sdf)
Create a sensor from SDF with a known sensor type.
Definition: Manager.hh:81
T * CreateSensor(sdf::ElementPtr _sdf)
Create a sensor from SDF with a known sensor type.
Definition: Manager.hh:118
Definition: AirPressureSensor.hh:31