8 #ifndef IFM3D_DEVICE_DEVICE_H
9 #define IFM3D_DEVICE_DEVICE_H
14 #include <ifm3d/common/json.hpp>
15 #include <ifm3d/device/device_export.h>
16 #include <ifm3d/device/ifm_network_device.h>
17 #include <ifm3d/device/semver.h>
21 extern IFM3D_DEVICE_EXPORT
const std::string DEFAULT_IP;
22 extern IFM3D_DEVICE_EXPORT
const std::uint16_t DEFAULT_XMLRPC_PORT;
23 extern IFM3D_DEVICE_EXPORT
const int DEFAULT_PCIC_PORT;
24 extern IFM3D_DEVICE_EXPORT
const std::uint16_t PCIC_PORT;
25 extern IFM3D_DEVICE_EXPORT
const std::string DEFAULT_PASSWORD;
26 extern IFM3D_DEVICE_EXPORT
const int MAX_HEARTBEAT;
27 extern IFM3D_DEVICE_EXPORT
const std::size_t SESSION_ID_SZ;
28 extern IFM3D_DEVICE_EXPORT
const std::string DEFAULT_SESSION_ID;
29 extern IFM3D_DEVICE_EXPORT
const std::string DEFAULT_APPLICATION_TYPE;
30 extern IFM3D_DEVICE_EXPORT
const long DEFAULT_CURL_CONNECT_TIMEOUT;
31 extern IFM3D_DEVICE_EXPORT
const long DEFAULT_CURL_TRANSACTION_TIMEOUT;
33 extern IFM3D_DEVICE_EXPORT
const int DEV_O3D_MIN;
34 extern IFM3D_DEVICE_EXPORT
const int DEV_O3D_MAX;
35 extern IFM3D_DEVICE_EXPORT
const int DEV_O3R_MIN;
36 extern IFM3D_DEVICE_EXPORT
const int DEV_O3R_MAX;
37 extern IFM3D_DEVICE_EXPORT
const int DEV_O3X_MIN;
38 extern IFM3D_DEVICE_EXPORT
const int DEV_O3X_MAX;
39 extern IFM3D_DEVICE_EXPORT
const std::string ASSUME_DEVICE;
41 extern IFM3D_DEVICE_EXPORT
const unsigned int O3D_TIME_SUPPORT_MAJOR;
42 extern IFM3D_DEVICE_EXPORT
const unsigned int O3D_TIME_SUPPORT_MINOR;
43 extern IFM3D_DEVICE_EXPORT
const unsigned int O3D_TIME_SUPPORT_PATCH;
45 extern IFM3D_DEVICE_EXPORT
const unsigned int O3D_TMP_PARAMS_SUPPORT_MAJOR;
46 extern IFM3D_DEVICE_EXPORT
const unsigned int O3D_TMP_PARAMS_SUPPORT_MINOR;
47 extern IFM3D_DEVICE_EXPORT
const unsigned int O3D_TMP_PARAMS_SUPPORT_PATCH;
49 extern IFM3D_DEVICE_EXPORT
const unsigned int
50 O3D_INTRINSIC_PARAM_SUPPORT_MAJOR;
51 extern IFM3D_DEVICE_EXPORT
const unsigned int
52 O3D_INTRINSIC_PARAM_SUPPORT_MINOR;
53 extern IFM3D_DEVICE_EXPORT
const unsigned int
54 O3D_INTRINSIC_PARAM_SUPPORT_PATCH;
56 extern IFM3D_DEVICE_EXPORT
const unsigned int
57 O3D_INVERSE_INTRINSIC_PARAM_SUPPORT_MAJOR;
58 extern IFM3D_DEVICE_EXPORT
const unsigned int
59 O3D_INVERSE_INTRINSIC_PARAM_SUPPORT_MINOR;
60 extern IFM3D_DEVICE_EXPORT
const unsigned int
61 O3D_INVERSE_INTRINSIC_PARAM_SUPPORT_PATCH;
63 extern IFM3D_DEVICE_EXPORT
const unsigned int
64 O3X_DISTANCE_NOISE_IMAGE_SUPPORT_MAJOR;
65 extern IFM3D_DEVICE_EXPORT
const unsigned int
66 O3X_DISTANCE_NOISE_IMAGE_SUPPORT_MINOR;
67 extern IFM3D_DEVICE_EXPORT
const unsigned int
68 O3X_DISTANCE_NOISE_IMAGE_SUPPORT_PATCH;
70 enum class pixel_format : std::uint32_t
85 enum class image_chunk : std::uint32_t
87 RADIAL_DISTANCE_IMAGE = 100,
88 NORM_AMPLITUDE_IMAGE = 101,
89 AMPLITUDE_IMAGE = 103,
90 GRAYSCALE_IMAGE = 104,
91 RADIAL_DISTANCE_NOISE = 105,
93 CARTESIAN_X_COMPONENT = 200,
94 CARTESIAN_Y_COMPONENT = 201,
95 CARTESIAN_Z_COMPONENT = 202,
97 UNIT_VECTOR_ALL = 223,
98 MONOCHROM_2D_12BIT = 250,
101 CONFIDENCE_IMAGE = 300,
103 JSON_DIAGNOSTIC = 305,
104 EXTRINSIC_CALIB = 400,
105 INTRINSIC_CALIB = 401,
106 INVERSE_INTRINSIC_CALIBRATION = 402,
108 O3R_DISTANCE_IMAGE_INFO [[deprecated]] =
109 static_cast<uint32_t
>(ifm3d::image_chunk::TOF_INFO),
111 O3R_RGB_IMAGE_INFO [[deprecated]] =
112 static_cast<uint32_t
>(ifm3d::image_chunk::RGB_INFO),
115 O3R_ODS_OCCUPANCY_GRID = 1000,
117 O3R_RESULT_JSON = 1002,
118 O3R_RESULT_ARRAY2D = 1003,
119 O3R_RESULT_IMU = 1004,
136 using Ptr = std::shared_ptr<Device>;
209 enum class device_family : int
217 enum class swu_version : int
219 SWU_NOT_SUPPORTED = 0,
230 static std::vector<ifm3d::IFMNetworkDevice> DeviceDiscovery();
252 static Ptr MakeShared(
253 const std::string& ip = ifm3d::DEFAULT_IP,
254 const std::uint16_t xmlrpc_port = ifm3d::DEFAULT_XMLRPC_PORT,
255 const std::string& password = ifm3d::DEFAULT_PASSWORD,
256 bool throwIfUnavailable =
true);
269 Device(
const std::string& ip = ifm3d::DEFAULT_IP,
270 const std::uint16_t xmlrpc_port = ifm3d::DEFAULT_XMLRPC_PORT);
279 Device(Device&&) =
delete;
280 Device& operator=(Device&&) =
delete;
281 Device(Device&) =
delete;
282 Device& operator=(Device&) =
delete;
287 virtual std::string IP();
290 virtual std::uint16_t XMLRPCPort();
299 const boot_mode& mode = ifm3d::Device::boot_mode::PRODUCTIVE);
308 virtual void ForceTrigger();
331 virtual std::string DeviceType(
bool use_cached =
true);
338 virtual device_family WhoAmI();
348 virtual bool AmI(device_family family);
354 virtual std::string DeviceParameter(
const std::string& key);
364 virtual std::vector<std::string> TraceLogs(
int count);
383 virtual json ToJSON();
392 virtual std::string ToJSONStr();
412 virtual void FromJSON(
const json& j);
420 virtual void FromJSONStr(
const std::string& jstr);
431 bool CheckMinimumFirmwareVersion(
unsigned int major,
445 virtual ifm3d::Device::swu_version SwUpdateVersion();
449 std::unique_ptr<Impl> pImpl;
463 bool checkDeviceID(
int deviceID,
int minID,
int maxID);
465 std::shared_ptr<XMLRPCWrapper> XWrapper();
471 #endif // IFM3D_DEVICE_DEVICE_H