A factory class for creating sensors This class wll load a sensor plugin based on the given sensor type and instantiates a sensor object. More...
#include <SensorFactory.hh>
Public Member Functions | |
SensorFactory () | |
Constructor. More... | |
~SensorFactory () | |
Destructor. More... | |
void | AddPluginPaths (const std::string &_path) |
Add additional path to search for sensor plugins. More... | |
template<typename T > | |
std::unique_ptr< T > | CreateSensor (const sdf::Sensor &_sdf) |
Create a sensor from a SDF DOM object with a known sensor type. More... | |
std::unique_ptr< Sensor > | CreateSensor (const sdf::Sensor &_sdf) |
Create a sensor from an SDF Sensor DOM object without a known sensor type. More... | |
template<typename T > | |
std::unique_ptr< T > | CreateSensor (sdf::ElementPtr _sdf) |
Create a sensor from SDF with a known sensor type. More... | |
std::unique_ptr< Sensor > | CreateSensor (sdf::ElementPtr _sdf) |
Create a sensor from SDF without a known sensor type. More... | |
Detailed Description
A factory class for creating sensors This class wll load a sensor plugin based on the given sensor type and instantiates a sensor object.
Constructor & Destructor Documentation
◆ SensorFactory()
SensorFactory | ( | ) |
Constructor.
◆ ~SensorFactory()
~SensorFactory | ( | ) |
Destructor.
Member Function Documentation
◆ AddPluginPaths()
void AddPluginPaths | ( | const std::string & | _path | ) |
Add additional path to search for sensor plugins.
- Parameters
-
[in] _path Search path
◆ CreateSensor() [1/4]
|
inline |
Create a sensor from a SDF DOM object with a known sensor type.
This creates sensors by looking at the given SDF DOM object. Sensors created with this API offer an ignition-transport interface. If you need a direct C++ interface to the data, you must get the sensor pointer and cast to the correct type.
- See also
- Sensor()
- Parameters
-
[in] _sdf SDF Sensor DOM object.
- Returns
- A pointer to the created sensor. nullptr returned on error.
Referenced by SensorFactory::CreateSensor().
◆ CreateSensor() [2/4]
std::unique_ptr<Sensor> CreateSensor | ( | const sdf::Sensor & | _sdf | ) |
Create a sensor from an SDF Sensor DOM object without a known sensor type.
This creates sensors by looking at the given SDF Sensor DOM object. Sensors created with this API offer an ignition-transport interface. If you need a direct C++ interface to the data, you must get the sensor pointer and cast to the correct type.
- See also
- Sensor()
- Parameters
-
[in] _sdf SDF Sensor DOM object.
- Returns
- A sensor id that refers to the created sensor. Null is is returned on error.
◆ CreateSensor() [3/4]
|
inline |
Create a sensor from SDF with a known sensor type.
This creates sensors by looking at the given sdf element. Sensors created with this API offer an ignition-transport interface. If you need a direct C++ interface to the data, you must get the sensor pointer and cast to the correct type.
- See also
- Sensor()
- Parameters
-
[in] _sdf pointer to the sdf element
- Returns
- A pointer to the created sensor. nullptr returned on error.
References SensorFactory::CreateSensor().
◆ CreateSensor() [4/4]
std::unique_ptr<Sensor> CreateSensor | ( | sdf::ElementPtr | _sdf | ) |
Create a sensor from SDF without a known sensor type.
This creates sensors by looking at the given sdf element. Sensors created with this API offer an ignition-transport interface. If you need a direct C++ interface to the data, you must get the sensor pointer and cast to the correct type.
- See also
- Sensor()
- Parameters
-
[in] _sdf pointer to the sdf element
- Returns
- A sensor id that refers to the created sensor. Null is is returned on error.
The documentation for this class was generated from the following file: