8 #ifndef IFM3D_DEVICE_DEVICE_H
9 #define IFM3D_DEVICE_DEVICE_H
14 #include <ifm3d/common/json.hpp>
15 #include <ifm3d/device/module_device.h>
16 #include <ifm3d/device/ifm_network_device.h>
17 #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 pixel_format : std::uint32_t
82 enum class image_chunk : 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::image_chunk::TOF_INFO),
108 O3R_RGB_IMAGE_INFO [[deprecated]] =
109 static_cast<uint32_t
>(ifm3d::image_chunk::RGB_INFO),
112 O3R_ODS_OCCUPANCY_GRID = 1000,
114 O3R_RESULT_JSON = 1002,
115 O3R_RESULT_ARRAY2D = 1003,
116 O3R_RESULT_IMU = 1004,
133 using Ptr = std::shared_ptr<Device>;
206 enum class device_family : int
214 enum class swu_version : int
216 SWU_NOT_SUPPORTED = 0,
227 static std::vector<ifm3d::IFMNetworkDevice> DeviceDiscovery();
234 static void SetTempIPAddress(std::string mac, std::string temp_ip);
256 static Ptr MakeShared(
257 const std::string& ip = ifm3d::DEFAULT_IP,
258 const std::uint16_t xmlrpc_port = ifm3d::DEFAULT_XMLRPC_PORT,
259 const std::string& password = ifm3d::DEFAULT_PASSWORD,
260 bool throwIfUnavailable =
true);
273 Device(
const std::string& ip = ifm3d::DEFAULT_IP,
274 const std::uint16_t xmlrpc_port = ifm3d::DEFAULT_XMLRPC_PORT);
283 Device(Device&&) =
delete;
284 Device& operator=(Device&&) =
delete;
285 Device(Device&) =
delete;
286 Device& operator=(Device&) =
delete;
291 virtual std::string IP();
294 virtual std::uint16_t XMLRPCPort();
303 const boot_mode& mode = ifm3d::Device::boot_mode::PRODUCTIVE);
312 virtual void ForceTrigger();
335 virtual std::string DeviceType(
bool use_cached =
true);
342 virtual device_family WhoAmI();
352 virtual bool AmI(device_family family);
358 virtual std::string DeviceParameter(
const std::string& key);
368 virtual std::vector<std::string> TraceLogs(
int count);
387 virtual json ToJSON();
396 virtual std::string ToJSONStr();
416 virtual void FromJSON(
const json& j);
424 virtual void FromJSONStr(
const std::string& jstr);
435 bool CheckMinimumFirmwareVersion(
unsigned int major,
449 virtual ifm3d::Device::swu_version SwUpdateVersion();
455 std::unique_ptr<Impl> pImpl;
469 bool checkDeviceID(
int deviceID,
int minID,
int maxID);
471 std::shared_ptr<XMLRPCWrapper> XWrapper();
477 #endif // IFM3D_DEVICE_DEVICE_H