Xavia SDK c++ API 2.1.0
API description of the xavia library
Loading...
Searching...
No Matches
sensorFactory.h
1#pragma once
2
3#include "xmsdk_export.h"
4#include "pixelFormat.h"
5
6#include <functional>
7#include <memory>
8#include <optional>
9#include <string_view>
10
11
12namespace xavia::sdk
13{
14 class ISensor;
15 class IPointCloud;
16 class IImage;
17 class SerialNumber;
18 class Exception;
19 enum class Alert;
20
21 inline constexpr std::string_view DEFAULT_XMANAGER_IP_ADDRESS{"10.10.100.11"};
22 inline constexpr int DEFAULT_XMANAGER_PORT{4000};
23
37 class XMSDK_EXPORT SensorFactory
38 {
39 public:
40 SensorFactory();
41 virtual ~SensorFactory();
42
43 using pcCallback = std::function<void(std::unique_ptr<IPointCloud>)>;
44 using imgCallback = std::function<void(std::unique_ptr<IImage>)>;
45 using errCallback = std::function<void(const Exception&)>;
46 using alertCallback = std::function<void(Alert, std::optional<bool>)>;
47
67 void SetPointCloudCallback(pcCallback callback);
68
79 void SetErrorCallback(errCallback callback);
80
98 void SetAlertCallback(alertCallback callback);
99
114 void SetPointCloudBufferSize(std::size_t bufferSize);
115
132 void SetImageCallback(imgCallback callback);
133
147 void SetCameraIPAddress(const std::string_view& ip4String);
148
159 void SetImageBufferSize(std::size_t bufferSize);
160
187 void SetImageOutputFormat(const PixelFormat format);
188
204 std::shared_ptr<ISensor> Build(const std::string_view& ip4String = DEFAULT_XMANAGER_IP_ADDRESS,
205 const int port = DEFAULT_XMANAGER_PORT);
206
207 private:
208 class Impl;
209 std::unique_ptr<Impl> pImpl;
210 };
211}
Exception base class for the Xavia SDK exceptions.
Definition error.h:18
The interface of the point cloud object.
Definition iPointCloud.h:62
Sensor object interface.
Definition iSensor.h:25
void SetErrorCallback(errCallback callback)
Register a function where the SDK will report errors.
void SetPointCloudBufferSize(std::size_t bufferSize)
Allows control over the amount of incoming point cloud messages that are buffered by the SDK.
void SetImageBufferSize(std::size_t bufferSize)
Allows control over the amount of incoming image messages that are buffered by the SDK.
std::shared_ptr< ISensor > Build(const std::string_view &ip4String=DEFAULT_XMANAGER_IP_ADDRESS, const int port=DEFAULT_XMANAGER_PORT)
Build the sensor object.
void SetImageCallback(imgCallback callback)
Register a function where the SDK will report incoming camera image data.
void SetPointCloudCallback(pcCallback callback)
Register a function where the SDK will report incoming point cloud data.
void SetCameraIPAddress(const std::string_view &ip4String)
Configure the camera IP address for this sensor.
void SetAlertCallback(alertCallback callback)
Register a function where the SDK will report alerts.
void SetImageOutputFormat(const PixelFormat format)
Configure the pixel format of output images.
utility class that holds a serial number and allows interpretation.
Definition serialNumber.h:31