17 #ifndef IGNITION_SENSORS_MANAGER_HH_ 18 #define IGNITION_SENSORS_MANAGER_HH_ 22 #include <type_traits> 25 #include <ignition/common/SuppressWarning.hh> 26 #include <ignition/common/Time.hh> 27 #include <ignition/common/Console.hh> 28 #include <ignition/sensors/config.hh> 29 #include <ignition/sensors/Export.hh> 37 inline namespace IGNITION_SENSORS_VERSION_NAMESPACE {
81 public:
template<
typename T>
88 T *result =
dynamic_cast<T*
>(this->
Sensor(
id));
91 ignerr <<
"SDF sensor type does not match template type\n";
96 ignerr <<
"Failed to create sensor of type[" 97 << _sdf.TypeStr() <<
"]\n";
118 public:
template<
typename T>
125 T *result =
dynamic_cast<T*
>(this->
Sensor(
id));
127 if (
nullptr == result)
129 ignerr <<
"Failed to create sensor [" <<
id <<
"] of type [" 131 <<
"]. SDF sensor type does not match template type." 138 ignerr <<
"Failed to create sensor of type [" 197 public:
void IGN_DEPRECATED(4) RunOnce(
198 const ignition::common::Time &_time,
bool _force =
false);
204 public:
void RunOnce(
const std::chrono::steady_clock::duration &_time,
205 bool _force =
false);
208 public:
void AddPluginPaths(
const std::string &_path);
214 const std::string &_filename, sdf::ElementPtr _sdf);
216 IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
219 IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
a base sensor class
Definition: Sensor.hh:60
Loads and runs sensors.
Definition: Manager.hh:52
const SensorId NO_SENSOR
Definition: Sensor.hh:50
T * CreateSensor(sdf::Sensor _sdf)
Create a sensor from SDF with a known sensor type.
Definition: Manager.hh:82
T * CreateSensor(sdf::ElementPtr _sdf)
Create a sensor from SDF with a known sensor type.
Definition: Manager.hh:119
Definition: AirPressureSensor.hh:32