![]() |
An open-source, flexible 3D physical simulation framework
|
"SensorManagerInterface" declares the interfaces for all sensor operations that are used for the communication between the simulation modules. More...
#include <SensorManagerInterface.h>
Public Member Functions | |
virtual | ~SensorManagerInterface () |
Destructor. More... | |
virtual void | getListSensors (std::vector< core_objects_exchange > *sensorList) const =0 |
Add a sensor to the simulation. More... | |
virtual const BaseSensor * | getFullSensor (unsigned long index) const =0 |
Gives information about core exchange data for camera sensors. More... | |
virtual unsigned long | getSensorID (std::string name) const =0 |
virtual void | removeSensor (unsigned long index)=0 |
Removes a sensor from the simulation. More... | |
virtual BaseSensor * | getSimSensor (unsigned long index) const =0 |
This function returns the SimSensor object for a given index. More... | |
virtual int | getSensorData (unsigned long id, sReal **data) const =0 |
This function returns the GridSensor object for a given index. More... | |
virtual int | getSensorCount () const =0 |
Returns the number of sensors that are currently present in the simulation. More... | |
virtual void | clearAllSensors (bool clear_all=false)=0 |
Destroys all sensors in the simulation. More... | |
virtual void | reloadSensors (void)=0 |
This function reloads all sensors from a temporary sensor pool. More... | |
virtual BaseSensor * | createAndAddSensor (configmaps::ConfigMap *config, bool reload=true)=0 |
Adds an sensor to the known sensors list. More... | |
virtual BaseSensor * | createAndAddSensor (const std::string &type_name, BaseConfig *config, bool reload=false)=0 |
"SensorManagerInterface" declares the interfaces for all sensor operations that are used for the communication between the simulation modules.
The class defines only pure virtual functions that are implemented within the simulation and can be used everywhere by accessing this interface via the ControlCenter class.
It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of the functions is only guaranteed by calling it within the main thread (update callback from gui_thread
).
Definition at line 64 of file SensorManagerInterface.h.
|
inlinevirtual |
Destructor.
Definition at line 70 of file SensorManagerInterface.h.
|
pure virtual |
Destroys all sensors in the simulation.
The clear_all
flag indicates if the reload sensors should be destroyed as well. If set to false
they are left intact.
clear_all | Indicates if the reload sensors should be destroyed as well. If set to false they are left intact. |
Implemented in mars::sim::SensorManager.
|
pure virtual |
Adds an sensor to the known sensors list.
Implemented in mars::sim::SensorManager.
|
pure virtual |
Implemented in mars::sim::SensorManager.
|
pure virtual |
Gives information about core exchange data for camera sensors.
cameraList | A pointer to a vector that is filled with a core_objects_exchange struct for every camera sensor. The vector is cleared in the beginning of this function. Gives all information of a certain sensor. |
index | The unique id of the sensor to get information for. |
Implemented in mars::sim::SensorManager.
|
pure virtual |
Add a sensor to the simulation.
sensorS | A pointer to the sensorStruct that defines the new sensor. |
reload | Used internally by the simulation. The default value is false . If this param is set to true the new sensor will not be reloaded after a reset of the simulation. |
sensorList | A pointer to a vector that is filled with a core_objects_exchange struct for every sensor. The vector is cleared in the beginning of this function. |
Implemented in mars::sim::SensorManager.
|
pure virtual |
Returns the number of sensors that are currently present in the simulation.
Implemented in mars::sim::SensorManager.
|
pure virtual |
This function returns the GridSensor object for a given index.
name | The index of the sensor to get the core sensor object. |
cs | The cameraStruct of the sensor. |
index | The index of the sensor to get the cameraStruct |
data | The sensor data of the sensor. |
index | The index of the sensor to get the data |
Implemented in mars::sim::SensorManager.
|
pure virtual |
Implemented in mars::sim::SensorManager.
|
pure virtual |
This function returns the SimSensor object for a given index.
name | The index of the sensor to get the core sensor object. |
Implemented in mars::sim::SensorManager.
|
pure virtual |
This function reloads all sensors from a temporary sensor pool.
All sensors that have been added with reload
value as true
are added back to the simulation again with a reload
value of true
.
Implemented in mars::sim::SensorManager.
|
pure virtual |
Removes a sensor from the simulation.
index | The unique id of the sensor to remove form the simulation. |
Implemented in mars::sim::SensorManager.