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_O3C_MIN;
38 extern IFM3D_EXPORT
const int DEV_O3C_MAX;
39 extern IFM3D_EXPORT
const int DEV_O3X_MIN;
40 extern IFM3D_EXPORT
const int DEV_O3X_MAX;
41 extern IFM3D_EXPORT
const std::string ASSUME_DEVICE;
43 extern IFM3D_EXPORT
const unsigned int O3D_TIME_SUPPORT_MAJOR;
44 extern IFM3D_EXPORT
const unsigned int O3D_TIME_SUPPORT_MINOR;
45 extern IFM3D_EXPORT
const unsigned int O3D_TIME_SUPPORT_PATCH;
47 extern IFM3D_EXPORT
const unsigned int O3D_TMP_PARAMS_SUPPORT_MAJOR;
48 extern IFM3D_EXPORT
const unsigned int O3D_TMP_PARAMS_SUPPORT_MINOR;
49 extern IFM3D_EXPORT
const unsigned int O3D_TMP_PARAMS_SUPPORT_PATCH;
51 extern IFM3D_EXPORT
const unsigned int O3D_INTRINSIC_PARAM_SUPPORT_MAJOR;
52 extern IFM3D_EXPORT
const unsigned int O3D_INTRINSIC_PARAM_SUPPORT_MINOR;
53 extern IFM3D_EXPORT
const unsigned int O3D_INTRINSIC_PARAM_SUPPORT_PATCH;
55 extern IFM3D_EXPORT
const unsigned int
56 O3D_INVERSE_INTRINSIC_PARAM_SUPPORT_MAJOR;
57 extern IFM3D_EXPORT
const unsigned int
58 O3D_INVERSE_INTRINSIC_PARAM_SUPPORT_MINOR;
59 extern IFM3D_EXPORT
const unsigned int
60 O3D_INVERSE_INTRINSIC_PARAM_SUPPORT_PATCH;
62 extern IFM3D_EXPORT
const unsigned int
63 O3X_DISTANCE_NOISE_IMAGE_SUPPORT_MAJOR;
64 extern IFM3D_EXPORT
const unsigned int
65 O3X_DISTANCE_NOISE_IMAGE_SUPPORT_MINOR;
66 extern IFM3D_EXPORT
const unsigned int
67 O3X_DISTANCE_NOISE_IMAGE_SUPPORT_PATCH;
69 enum class PixelFormat : std::uint32_t
84 enum class ImageChunk : std::uint32_t
86 RADIAL_DISTANCE_IMAGE = 100,
87 NORM_AMPLITUDE_IMAGE = 101,
88 AMPLITUDE_IMAGE = 103,
89 GRAYSCALE_IMAGE = 104,
90 RADIAL_DISTANCE_NOISE = 105,
92 CARTESIAN_X_COMPONENT = 200,
93 CARTESIAN_Y_COMPONENT = 201,
94 CARTESIAN_Z_COMPONENT = 202,
96 UNIT_VECTOR_ALL = 223,
97 MONOCHROM_2D_12BIT = 250,
100 CONFIDENCE_IMAGE = 300,
102 JSON_DIAGNOSTIC = 305,
103 EXTRINSIC_CALIB = 400,
104 INTRINSIC_CALIB = 401,
105 INVERSE_INTRINSIC_CALIBRATION = 402,
107 O3R_DISTANCE_IMAGE_INFO [[deprecated]] =
108 static_cast<uint32_t
>(ifm3d::ImageChunk::TOF_INFO),
110 O3R_RGB_IMAGE_INFO [[deprecated]] =
111 static_cast<uint32_t
>(ifm3d::ImageChunk::RGB_INFO),
114 O3R_ODS_OCCUPANCY_GRID = 1000,
116 O3R_RESULT_JSON = 1002,
117 O3R_RESULT_ARRAY2D = 1003,
118 O3R_RESULT_IMU = 1004,
119 O3R_ODS_POLAR_OCC_GRID = 1006,
120 O3R_ODS_EXTRINSIC_CALIBRATION_CORRECTION = 1007,
121 O3R_ODS_RENDERED_ZONES = 1008
138 using Ptr = std::shared_ptr<Device>;
211 enum class DeviceFamily : int
220 enum class SWUVersion : int
222 SWU_NOT_SUPPORTED = 0,
241 const std::string& temp_ip);
264 const std::string& ip = ifm3d::DEFAULT_IP,
265 std::uint16_t xmlrpc_port = ifm3d::DEFAULT_XMLRPC_PORT,
266 const std::string& password = ifm3d::DEFAULT_PASSWORD,
267 bool throw_if_unavailable =
true);
280 Device(
const std::string& ip = ifm3d::DEFAULT_IP,
281 std::uint16_t xmlrpc_port = ifm3d::DEFAULT_XMLRPC_PORT);
298 virtual std::string
IP();
310 const BootMode& mode = ifm3d::Device::BootMode::PRODUCTIVE);
359 virtual bool AmI(DeviceFamily family);
462 std::unique_ptr<Impl> _impl;
476 bool check_device_id(
int device_id,
int min_id,
int max_id);
478 std::shared_ptr<XMLRPC> x_wrapper();
Software interface to an ifm 3D device.
Definition: device.h:136
virtual void ForceTrigger()
Sends a S/W trigger to the device over XMLRPC.
ImportFlags
Import flags used when importing a Vision Assistant configuration.
Definition: device.h:175
virtual std::string DeviceParameter(const std::string &key)
Convenience accessor for extracting a device parameters (i.e., no edit session created on the device)
virtual DeviceFamily WhoAmI()
This function can be used to retrieve the family of the connected device.
virtual ~Device()
The dtor will cancel any open edit sessions with the device.
virtual void Reboot(const BootMode &mode=ifm3d::Device::BootMode::PRODUCTIVE)
Reboot the device.
virtual void FromJSONStr(const std::string &jstr)
Accepts a string with properly formatted/escaped JSON text, converts it to a json object,...
virtual void FromJSON(const json &j)
Configures the device based on the parameter values of the passed in JSON.
virtual bool AmI(DeviceFamily family)
This is a convenience function for checking whether a device is one of the specified device family.
virtual std::vector< std::string > TraceLogs(int count)
Delivers the trace log from the device A session is not required to call this function.
TriggerMode
Image acquisition trigger modes.
Definition: device.h:166
static void SetTempIPAddress(const std::string &mac, const std::string &temp_ip)
This function Provides a way to set temporary IP.
virtual std::string DeviceType(bool use_cached=true)
This is a convenience function for extracting out the device type of the connected device.
MedianfilterMaskSize
Convenient constants for median filter mask sizes.
Definition: device.h:206
virtual std::string IP()
The IP address associated with this Device instance.
std::string _device_type
The cached device type of the connected device.
Definition: device.h:467
Device(const std::string &ip=ifm3d::DEFAULT_IP, std::uint16_t xmlrpc_port=ifm3d::DEFAULT_XMLRPC_PORT)
Initializes the device interface utilizing library defaults for password, ip, and xmlrpc port unless ...
SpatialFilter
Convenience constants for spatial filter types.
Definition: device.h:185
OperatingMode
Device operating modes: run (streaming pixel data), edit (configuring the device/applications).
Definition: device.h:157
int device_id()
Implements the serialization of the device state to JSON.
ifm3d::SemVer FirmwareVersion()
get the firmware version of the device
bool CheckMinimumFirmwareVersion(unsigned int major, unsigned int minor, unsigned int patch)
Checks for a minimum ifm device software version.
static Ptr MakeShared(const std::string &ip=ifm3d::DEFAULT_IP, std::uint16_t xmlrpc_port=ifm3d::DEFAULT_XMLRPC_PORT, const std::string &password=ifm3d::DEFAULT_PASSWORD, bool throw_if_unavailable=true)
Factory function for instantiating the proper subclass based on h/w probing.
virtual std::uint16_t XMLRPCPort()
The XMLRPC Port associated with this Device instance.
virtual json ToJSON()
Serializes the state of the device to JSON.
virtual std::string ToJSONStr()
A stringified version of the JSON object returned by ToJSON().
static std::vector< ifm3d::IFMNetworkDevice > DeviceDiscovery()
This function Provides a convinent way to find all ifm devices on the network.
virtual ifm3d::Device::SWUVersion SwUpdateVersion()
Checks the swupdater version supported by device.
BootMode
Device boot up modes:
Definition: device.h:147
TemporalFilter
Convenience constants for temporal filter types.
Definition: device.h:196
Device specialization for O3C.
Definition: o3c.h:26
Device specialization for O3D.
Definition: o3d.h:20
Device specialization for O3R.
Definition: o3r.h:43
Device specialization for O3X.
Definition: o3x.h:20