8 #ifndef IFM3D_DEVICE_DEVICE_H
9 #define IFM3D_DEVICE_DEVICE_H
12 #include <ifm3d/common/json.hpp>
13 #include <ifm3d/device/ifm_network_device.h>
14 #include <ifm3d/device/module_device.h>
15 #include <ifm3d/device/semver.h>
21 extern IFM3D_EXPORT
const std::string DEFAULT_IP;
22 extern IFM3D_EXPORT
const std::uint16_t DEFAULT_XMLRPC_PORT;
23 extern IFM3D_EXPORT
const int DEFAULT_PCIC_PORT;
24 extern IFM3D_EXPORT
const std::uint16_t PCIC_PORT;
25 extern IFM3D_EXPORT
const std::string DEFAULT_PASSWORD;
26 extern IFM3D_EXPORT
const int MAX_HEARTBEAT;
27 extern IFM3D_EXPORT
const std::size_t SESSION_ID_SZ;
28 extern IFM3D_EXPORT
const std::string DEFAULT_SESSION_ID;
29 extern IFM3D_EXPORT
const std::string DEFAULT_APPLICATION_TYPE;
30 extern IFM3D_EXPORT
const long DEFAULT_CURL_CONNECT_TIMEOUT;
31 extern IFM3D_EXPORT
const long DEFAULT_CURL_TRANSACTION_TIMEOUT;
33 extern IFM3D_EXPORT
const int DEV_O3D_MIN;
34 extern IFM3D_EXPORT
const int DEV_O3D_MAX;
35 extern IFM3D_EXPORT
const int DEV_O3R_MIN;
36 extern IFM3D_EXPORT
const int DEV_O3R_MAX;
37 extern IFM3D_EXPORT
const int DEV_O3X_MIN;
38 extern IFM3D_EXPORT
const int DEV_O3X_MAX;
39 extern IFM3D_EXPORT
const std::string ASSUME_DEVICE;
41 extern IFM3D_EXPORT
const unsigned int O3D_TIME_SUPPORT_MAJOR;
42 extern IFM3D_EXPORT
const unsigned int O3D_TIME_SUPPORT_MINOR;
43 extern IFM3D_EXPORT
const unsigned int O3D_TIME_SUPPORT_PATCH;
45 extern IFM3D_EXPORT
const unsigned int O3D_TMP_PARAMS_SUPPORT_MAJOR;
46 extern IFM3D_EXPORT
const unsigned int O3D_TMP_PARAMS_SUPPORT_MINOR;
47 extern IFM3D_EXPORT
const unsigned int O3D_TMP_PARAMS_SUPPORT_PATCH;
49 extern IFM3D_EXPORT
const unsigned int O3D_INTRINSIC_PARAM_SUPPORT_MAJOR;
50 extern IFM3D_EXPORT
const unsigned int O3D_INTRINSIC_PARAM_SUPPORT_MINOR;
51 extern IFM3D_EXPORT
const unsigned int O3D_INTRINSIC_PARAM_SUPPORT_PATCH;
53 extern IFM3D_EXPORT
const unsigned int
54 O3D_INVERSE_INTRINSIC_PARAM_SUPPORT_MAJOR;
55 extern IFM3D_EXPORT
const unsigned int
56 O3D_INVERSE_INTRINSIC_PARAM_SUPPORT_MINOR;
57 extern IFM3D_EXPORT
const unsigned int
58 O3D_INVERSE_INTRINSIC_PARAM_SUPPORT_PATCH;
60 extern IFM3D_EXPORT
const unsigned int
61 O3X_DISTANCE_NOISE_IMAGE_SUPPORT_MAJOR;
62 extern IFM3D_EXPORT
const unsigned int
63 O3X_DISTANCE_NOISE_IMAGE_SUPPORT_MINOR;
64 extern IFM3D_EXPORT
const unsigned int
65 O3X_DISTANCE_NOISE_IMAGE_SUPPORT_PATCH;
67 enum class PixelFormat : std::uint32_t
82 enum class ImageChunk : std::uint32_t
84 RADIAL_DISTANCE_IMAGE = 100,
85 NORM_AMPLITUDE_IMAGE = 101,
86 AMPLITUDE_IMAGE = 103,
87 GRAYSCALE_IMAGE = 104,
88 RADIAL_DISTANCE_NOISE = 105,
90 CARTESIAN_X_COMPONENT = 200,
91 CARTESIAN_Y_COMPONENT = 201,
92 CARTESIAN_Z_COMPONENT = 202,
94 UNIT_VECTOR_ALL = 223,
95 MONOCHROM_2D_12BIT = 250,
98 CONFIDENCE_IMAGE = 300,
100 JSON_DIAGNOSTIC = 305,
101 EXTRINSIC_CALIB = 400,
102 INTRINSIC_CALIB = 401,
103 INVERSE_INTRINSIC_CALIBRATION = 402,
105 O3R_DISTANCE_IMAGE_INFO [[deprecated]] =
106 static_cast<uint32_t
>(ifm3d::ImageChunk::TOF_INFO),
108 O3R_RGB_IMAGE_INFO [[deprecated]] =
109 static_cast<uint32_t
>(ifm3d::ImageChunk::RGB_INFO),
112 O3R_ODS_OCCUPANCY_GRID = 1000,
114 O3R_RESULT_JSON = 1002,
115 O3R_RESULT_ARRAY2D = 1003,
116 O3R_RESULT_IMU = 1004,
117 O3R_ODS_POLAR_OCC_GRID = 1006,
118 O3R_ODS_EXTRINSIC_CALIBRATION_CORRECTION = 1007,
119 O3R_ODS_RENDERED_ZONES = 1008
136 using Ptr = std::shared_ptr<Device>;
209 enum class DeviceFamily : int
217 enum class SWUVersion : int
219 SWU_NOT_SUPPORTED = 0,
230 static std::vector<ifm3d::IFMNetworkDevice> DeviceDiscovery();
237 static void SetTempIPAddress(
const std::string& mac,
238 const std::string& temp_ip);
260 static Ptr MakeShared(
261 const std::string& ip = ifm3d::DEFAULT_IP,
262 std::uint16_t xmlrpc_port = ifm3d::DEFAULT_XMLRPC_PORT,
263 const std::string& password = ifm3d::DEFAULT_PASSWORD,
264 bool throw_if_unavailable =
true);
277 Device(
const std::string& ip = ifm3d::DEFAULT_IP,
278 std::uint16_t xmlrpc_port = ifm3d::DEFAULT_XMLRPC_PORT);
287 Device(Device&&) =
delete;
288 Device& operator=(Device&&) =
delete;
289 Device(Device&) =
delete;
290 Device& operator=(Device&) =
delete;
295 virtual std::string IP();
298 virtual std::uint16_t XMLRPCPort();
307 const BootMode& mode = ifm3d::Device::BootMode::PRODUCTIVE);
316 virtual void ForceTrigger();
339 virtual std::string DeviceType(
bool use_cached =
true);
346 virtual DeviceFamily WhoAmI();
356 virtual bool AmI(DeviceFamily family);
362 virtual std::string DeviceParameter(
const std::string& key);
372 virtual std::vector<std::string> TraceLogs(
int count);
391 virtual json ToJSON();
400 virtual std::string ToJSONStr();
420 virtual void FromJSON(
const json& j);
428 virtual void FromJSONStr(
const std::string& jstr);
439 bool CheckMinimumFirmwareVersion(
unsigned int major,
453 virtual ifm3d::Device::SWUVersion SwUpdateVersion();
459 std::unique_ptr<Impl> _impl;
473 bool check_device_id(
int device_id,
int min_id,
int max_id);
475 std::shared_ptr<XMLRPC> x_wrapper();
481 #endif // IFM3D_DEVICE_DEVICE_H