![]() |
Xavia SDK c++ API 2.1.0
API description of the xavia library
|
Sensor object interface. More...
Public Member Functions | |
| virtual std::shared_ptr< ICamera > | GetCamera () const =0 |
| Get the camera associated with this sensor. | |
| virtual SensorState | GetCurrentState () const =0 |
| Provides the current state of the sensor (running, idle, error). | |
| virtual std::vector< SensorError > | GetErrors (const std::size_t &timeoutMS=DEFAULT_STATE_CHANGE_TIMEOUT_MS)=0 |
| Retrieves the state from the sensor and reports a list of errors. | |
| virtual SerialNumber | GetSerialNumber () const =0 |
| Provides the serial number of the sensor from local memory. | |
| virtual void | Poweroff ()=0 |
| Sends a 'poweroff' signal to the sensor. | |
| virtual void | Reboot ()=0 |
| Sends a 'reboot' signal to the sensor. | |
| virtual void | Start (const std::size_t &timeoutMS=DEFAULT_STATE_CHANGE_TIMEOUT_MS)=0 |
| Starts the sensor. | |
| virtual void | Stop (const std::size_t &timeoutMS=DEFAULT_STATE_CHANGE_TIMEOUT_MS)=0 |
| Stop the sensor. | |
Sensor object interface.
This class defines the interface for a sensor. It provides methods to start, stop, and get the current state and other information of the sensor.
|
pure virtual |
Get the camera associated with this sensor.
Returns a pointer to the camera object if a camera was configured during sensor creation via SensorFactory. If no camera was configured, returns nullptr.
The camera can be controlled independently from the sensor using its own Start(), Stop(), and exposure control methods.
|
pure virtual |
Provides the current state of the sensor (running, idle, error).
This function does not interact with the hardware but serves previously received information. Use GetErrors() to trigger an update if you suspect desynchronisation.
|
pure virtual |
Retrieves the state from the sensor and reports a list of errors.
| timeoutMS | The maximum amount of time to wait the response (optional, default 5 sec) |
| sdk::exception | if no valid response is received in the timeout |
This function send a TCP message to the sensor to request the sensor state. The return will contain information like the current state (idle, running, error), and more information on the errors if any.
A side effect of this function is that the state of the sensor object in the SDK is updated to match the state of the hardware.
|
pure virtual |
Provides the serial number of the sensor from local memory.
This function does not interact with the hardware but serves previously received information. Use GetErrors() to trigger an update if you suspect desynchronisation.
|
pure virtual |
Sends a 'poweroff' signal to the sensor.
Poweroff means that all software will stop, the components will be powered down and the sensor will remain powered off. In order to restart the sensor either toggle the ignition line or unplug and re-plug the power cord.
When the sensor powers off, the current sensor object is invalidated. Destroy all references to it and build a new sensor object if you need it.
|
pure virtual |
Sends a 'reboot' signal to the sensor.
Reboot means that all the components will be powered down and restarted as if from a clean boot.
When the sensor reboots, the current sensor object is invalidated. Destroy all references to it and build a new sensor object once the system has time to restart.
|
pure virtual |
Starts the sensor.
| timeoutMS | Timeout in milliseconds in which success response is expected (optional, default is 5 sec) |
| sdk::exception | object if no response is received within timeoutMS, or if the new state is not running. |
Start means that the sensor is moved from idle to running state. It is only valid to call this function if the current state is idle. An exception is thrown otherwise. An exception is also thrown if the sensor did not respond timely or if the response is unexpected.
|
pure virtual |
Stop the sensor.
| timeoutMS | Timeout in milliseconds in which success response is expected (optional, default is 5 sec) |
| sdk::exception | object if no response is received within timeoutMS, or if the new state is not idle. |
Stop means that the sensor is moved from running to idle state. It is only valid to call this function if the current state is running. An exception is thrown otherwise. An exception is also thrown if the sensor did not respond timely or if the response is unexpected.