Mech-Eye API 2.3.3
API reference documentation for Mech-Eye Industrial 3D Camera
Loading...
Searching...
No Matches
MechEyeLNXApi.h
1/*******************************************************************************
2 *BSD 3-Clause License
3 *
4 *Copyright (c) 2016-2024, Mech-Mind Robotics
5 *All rights reserved.
6 *
7 *Redistribution and use in source and binary forms, with or without
8 *modification, are permitted provided that the following conditions are met:
9 *
10 *1. Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 *2. Redistributions in binary form must reproduce the above copyright notice,
14 * this list of conditions and the following disclaimer in the documentation
15 * and/or other materials provided with the distribution.
16 *
17 *3. Neither the name of the copyright holder nor the names of its
18 * contributors may be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 *THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 *AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 *IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 *DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 *DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 *SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 *CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 *OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 *OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 ******************************************************************************/
32
33#pragma once
34#include <memory>
35#include <vector>
36#include "api_global.h"
37#include "MechEyeFrame.hpp"
38#include "MechEyeDataType.h"
39#include "MechEyeSettings.h"
40
41namespace mmind {
42
43namespace api {
44
45class MechEyeDeviceImpl;
46
47namespace lnxapi {
48
53std::string MMIND_API_EXPORT getApiInformation();
54
59class MMIND_API_EXPORT MechEyeDevice
60{
61public:
66
71
78 static std::vector<api::MechEyeDeviceInfo> enumerateMechEyeDeviceList();
79
87 ErrorStatus connect(const MechEyeDeviceInfo& info, const int timeout = 10000);
88
96 ErrorStatus connect(const std::string& ipAddress, const int port = 5577,
97 const int timeout = 10000);
98
103
110
116
123 ErrorStatus setCurrentUserSet(const std::string& userSetName) const;
124
131 ErrorStatus getCurrentUserSet(std::string& userSetName) const;
132
139 ErrorStatus getAllUserSets(std::vector<std::string>& userSetNames) const;
140
149 ErrorStatus deleteUserSet(const std::string& userSetName) const;
150
158 ErrorStatus addUserSet(const std::string& userSetName) const;
159
166
176 ErrorStatus getLnxBatchRollData(float* depth, unsigned char* intensity, unsigned int* encoder,
177 long long* frameId, int& lineCount) const;
178
185
191
197
203 ErrorStatus setLnxCaptureMode(CaptureMode value) const;
204
210 ErrorStatus getLnxCaptureMode(CaptureMode& value) const;
211
218
225
232
239
245 ErrorStatus getLnxXDataWidth(int& xDataWidth) const;
246
252 ErrorStatus getLnxXScale(float& xScale) const;
253
259 ErrorStatus setLnxLaserPowerLevel(int powerLevel) const;
260
266 ErrorStatus getLnxLaserPowerLevel(int& powerLevel) const;
267
273 ErrorStatus setScanExposureMode(ExposureMode mode) const;
274
280 ErrorStatus getScanExposureMode(ExposureMode& mode) const;
281
288
294 ErrorStatus getLnxExposure(int& time) const;
295
303 ErrorStatus setScan3DHDRExposureSequence(int time1, int time2, int time3) const;
304
312 ErrorStatus getScan3DHDRExposureSequence(int& time1, int& time2, int& time3) const;
313
320
327
334
341
347 ErrorStatus setScan3DAnalogGain(ImageAnalogGain gainVal) const;
348
354 ErrorStatus getScan3DAnalogGain(ImageAnalogGain& gainVal) const;
355
361 ErrorStatus setScan3DAnalogGainFor8030(ImageAnalogGainFor8030 gainVal) const;
362
368 ErrorStatus getScan3DAnalogGainFor8030(ImageAnalogGainFor8030& gainVal) const;
369
376
383
389 ErrorStatus setLnxROIMode(ROIMode mode) const;
390
396 ErrorStatus getLnxROIMode(ROIMode& mode) const;
397
404
411
419 ErrorStatus setLnxDepthTriggerSource(TriggerSource triggerSource) const;
420
426 ErrorStatus getLnxDepthTriggerSource(TriggerSource& triggerSource) const;
427
433 ErrorStatus setLnxLineRate(double rate) const;
434
440 ErrorStatus getLnxLineRate(double& rate) const;
441
447 ErrorStatus setLnxProfileNum(int profileNum) const;
448
454 ErrorStatus getLnxProfileNum(int& profileNum) const;
455
461 ErrorStatus setLnxEncoderTriggerMode(EncoderTriggerMode mode) const;
462
468 ErrorStatus getLnxEncoderTriggerMode(EncoderTriggerMode& mode) const;
469
476 ErrorStatus setLnxEncoderDivide(int interval) const;
477
483 ErrorStatus getLnxEncoderDivide(int& interval) const;
484
490 ErrorStatus setLnxEncoderMultiplier(EncoderMultiplier multiple) const;
491
497 ErrorStatus getLnxEncoderMultiplier(EncoderMultiplier& multiple) const;
498
504 ErrorStatus setLnxFilterType(FilterType type) const;
505
511 ErrorStatus getLnxFilterType(FilterType& type) const;
512
518 ErrorStatus setLnxMeanFilterWindow(MeanFilterWindow window) const;
519
525 ErrorStatus getLnxMeanFilterWindow(MeanFilterWindow& window) const;
526
532 ErrorStatus setLnxMedianFilterWindow(MedianFilterWindow window) const;
533
539 ErrorStatus getLnxMedianFilterWindow(MedianFilterWindow& window) const;
540
547
554
560 ErrorStatus setLnxProfileStrategy(ProfileStrategy value) const;
561
567 ErrorStatus getLnxProfileStrategy(ProfileStrategy& value) const;
568
576
583
590
597
604
611
618
625
632
639
645 ErrorStatus getLnxEncoderValue(unsigned int& value) const;
646
647private:
648 MechEyeDeviceImpl* _d;
649};
650} // namespace lnxapi
651} // namespace api
652} // namespace mmind
Definition of data structure in device capturing image.
Interface that is used to connect the LNX Mech-Eye device and access basic information of the device.
ErrorStatus setLnxEncoderTriggerMode(EncoderTriggerMode mode) const
Set the encoder trigger mode.
ErrorStatus setLnxCaptureMode(CaptureMode value) const
Set scan mode.
ErrorStatus getLnxHDRDualSlope(int &value) const
Get the current y-coordinate of the first HDR knee point.
ErrorStatus setLnxHDRDualSlope(int value) const
Set the y-coordinate of the first HDR knee point.
ErrorStatus setLnxROIMode(ROIMode mode) const
Set the ROI mode.
ErrorStatus getLnxCaptureMode(CaptureMode &value) const
Get the current scan mode.
ErrorStatus getLnxFilterType(FilterType &type) const
Get the filter type.
ErrorStatus setScanExposureMode(ExposureMode mode) const
Set the exposure mode.
ErrorStatus getScan3DAnalogGainFor8030(ImageAnalogGainFor8030 &gainVal) const
Get the current analog gain of LNX-8030.
ErrorStatus getLnxProfileStrategy(ProfileStrategy &value) const
Get the current profile extraction strategy.
ErrorStatus setLnxDepthTimeout(int time) const
Set the timeout value for obtaining the depth map.
ErrorStatus setLnxEncoderDivide(int interval) const
Set the encoder divider value. Camera frame rate = encoder signal rate * encoder multiplier / encoder...
ErrorStatus setLnxMeanFilterWindow(MeanFilterWindow window) const
Set the window size for mean filtering.
ErrorStatus setLnxTriggerDelay(int delay) const
Set the trigger delay time.
ErrorStatus getLnxEncoderValue(unsigned int &value) const
Get the current encoder value.
ErrorStatus setLnxProfileStrategy(ProfileStrategy value) const
Set profile extraction strategy.
ErrorStatus getLnxMedianFilterWindow(MedianFilterWindow &window) const
Get the current window size for median filtering.
ErrorStatus getLnxMaxStripeWidth(int &value) const
Get the current maximum laser line width.
ErrorStatus getLnxXScale(float &xScale) const
Get the X resolution.
ErrorStatus getScan3DDigitalGain(int &gainVal) const
Get the current digital gain.
ErrorStatus setCurrentUserSet(const std::string &userSetName) const
ErrorStatus saveAllSettingsToUserSets() const
Save all parameter values to the current parameter group.
ErrorStatus setLnxHDRTripleSlope(int value) const
Set the y-coordinate of the second HDR knee point.
ErrorStatus getLnxMinStripeWidth(int &value) const
Get the current minimum laser line width.
ErrorStatus setLnxMinStripeWidth(int value)
Set the minimum laser line width.
ErrorStatus getScan3DHDRExposureSequence(int &time1, int &time2, int &time3) const
Get the current exposure sequence for the HDR exposure mode.
ErrorStatus addUserSet(const std::string &userSetName) const
ErrorStatus setLnxRawTimeout(int time) const
Set the timeout value for obtaining the line scan image.
ErrorStatus setLnxMaxFillingPointCount(int value) const
Set the maximum number of invalid points to be interpolated.
ErrorStatus setScan3DDigitalGain(int gainVal) const
Set the digital gain.
ErrorStatus getLnxEncoderTriggerMode(EncoderTriggerMode &mode) const
Get the current encoder trigger mode.
ErrorStatus setLnxMaxStripeWidth(int value)
Set the maximum laser line width.
ErrorStatus getLnxBatchRollData(LineBatch &LineBatch) const
Get the acquired batch data.
ErrorStatus setLnxMedianFilterWindow(MedianFilterWindow window) const
Set the window size for median filtering.
ErrorStatus getLnxLaserPowerLevel(int &powerLevel) const
Get the current laser power level.
ErrorStatus getLnxMaxStripeIntensity(int &value) const
Get the current maximum laser line intensity.
ErrorStatus setLnxEncoderMultiplier(EncoderMultiplier multiple) const
Set the encoder multiplier value.
ErrorStatus setLnxLineRate(double rate) const
Set the line rate for the Software trigger source.
ErrorStatus getLnxMeanFilterWindow(MeanFilterWindow &window) const
Get the current window size for mean filtering.
ErrorStatus getLnxDepthTriggerSource(TriggerSource &triggerSource) const
Get the current trigger source for the Depth scan mode.
ErrorStatus setScan3DHDRExposureSequence(int time1, int time2, int time3) const
Set the exposure sequence for the HDR exposure mode.
ErrorStatus setLnxLaserPowerLevel(int powerLevel) const
Set the laser power level.
ErrorStatus getLnxHDRTripleSlope(int &value) const
Get the current y-coordinate of the second HDR knee point.
ErrorStatus setScan3DAnalogGainFor8030(ImageAnalogGainFor8030 gainVal) const
Set the analog gain of LNX-8030.
ErrorStatus getScan3DAnalogGain(ImageAnalogGain &gainVal) const
Get the current analog gain.
ErrorStatus getLnxEncoderMultiplier(EncoderMultiplier &multiple) const
Get the current encoder multiplier value.
ErrorStatus getLnxExposure(int &time) const
Get the current exposure time for the Timed exposure mode.
ErrorStatus getLnxDepthTimeout(int &time) const
Get the current timeout value for obtaining the depth map.
ErrorStatus getLnxMaxFillingPointCount(int &value) const
Get the current maximum number of invalid points to be interpolated.
ErrorStatus captureLnx2DImage(ColorMap &colorMap) const
Perform scanning of one line and obtain the line scan image.
ErrorStatus getLnxProfileNum(int &profileNum) const
Get the current maximum number of lines to be scanned.
ErrorStatus stopLnxCaptureImage()
Stop scanning.
ErrorStatus getLnxBatchRollData(float *depth, unsigned char *intensity, unsigned int *encoder, long long *frameId, int &lineCount) const
Get the acquired batch data.
ErrorStatus setLnxFilterType(FilterType type) const
Set the filter type.
ErrorStatus getDeviceInfo(api::MechEyeDeviceInfo &info) const
Get the basic information of the connected device.
ErrorStatus connect(const MechEyeDeviceInfo &info, const int timeout=10000)
Connect to the device by the MechEyeDeviceInfo identifying a device.
ErrorStatus getLnxEncoderDivide(int &interval) const
Get the current encoder divider value.
ErrorStatus getLnxLineRate(double &rate) const
Get the current line rate for the Software trigger source.
ErrorStatus getLnxRawTimeout(int &time) const
Get the current timeout value for obtaining the line scan image.
ErrorStatus getLnxROIMode(ROIMode &mode) const
Get the current ROI mode.
ErrorStatus setLnxDepthTriggerSource(TriggerSource triggerSource) const
Set the trigger source for the Depth scan mode. Note: this function can only be used in CaptureMode:...
void disconnect()
Disconnect from the device.
ErrorStatus getLnxTriggerDelay(int &delay) const
Get the current trigger delay time.
ErrorStatus getAllUserSets(std::vector< std::string > &userSetNames) const
Get the names of all available parameter groups.
ErrorStatus getLnxGrayFilterThresh(int &value) const
Get the current grayscale value threshold.
ErrorStatus getLnxXDataWidth(int &xDataWidth) const
Get the line width in the X direction.
ErrorStatus setLnxMinStripeIntensity(int value)
Set the minimum laser line intensity.
ErrorStatus getScanExposureMode(ExposureMode &mode) const
Get the current exposure mode.
ErrorStatus setLnxMaxStripeIntensity(int value)
Set the maximum laser line intensity.
ErrorStatus setScan3DAnalogGain(ImageAnalogGain gainVal) const
Set the analog gain.
ErrorStatus getCurrentUserSet(std::string &userSetName) const
Get the name of the currently selected parameter group.
ErrorStatus deleteUserSet(const std::string &userSetName) const
static std::vector< api::MechEyeDeviceInfo > enumerateMechEyeDeviceList()
Enumerate Mech-Eye devices by the MechEyeDeviceInfo identifying the device.
ErrorStatus connect(const std::string &ipAddress, const int port=5577, const int timeout=10000)
Connects to a device by the IP address and port of the device.
ErrorStatus getLnxMinStripeIntensity(int &value) const
Get the current minimum laser line intensity.
ErrorStatus setLnxProfileNum(int profileNum) const
Set the maximum number of lines to be scanned.
ErrorStatus setLnxGrayFilterThresh(int value) const
Set the grayscale value threshold. Grayscale values of pixels below this threshold are set to zero be...
ErrorStatus startLnxCaptureImage()
Start scanning.
ErrorStatus setLnxExposure(int time) const
Set the exposure time for the Timed exposure mode.
This enumeration defines the types of errors.
This struct defines device information.