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,
238 const std::string& temp_ip);
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);
295 virtual std::string
IP();
307 const BootMode& mode = ifm3d::Device::BootMode::PRODUCTIVE);
356 virtual bool AmI(DeviceFamily family);
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();
Software interface to an ifm 3D device.
Definition: device.h:134
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:173
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:164
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:204
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:464
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:183
OperatingMode
Device operating modes: run (streaming pixel data), edit (configuring the device/applications).
Definition: device.h:155
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:145
TemporalFilter
Convenience constants for temporal filter types.
Definition: device.h:194
Device specialization for O3D.
Definition: o3d.h:20
Device specialization for O3R.
Definition: o3r.h:43
Device specialization for O3X.
Definition: o3x.h:20