Mech-Eye API 2.5.1
API reference documentation for Mech-Eye 3D Laser Profiler
Loading...
Searching...
No Matches
MechEyeLNXApi.h
Go to the documentation of this file.
1/*******************************************************************************
2 *BSD 3-Clause License
3 *
4 *Copyright (c) 2016-2025, Mech-Mind Robotics Technologies Co., Ltd.
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
54
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
204
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
274
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
348
355
362
369
376
383
390
397
404
411
420
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
462
469
476 ErrorStatus setLnxEncoderDivide(int interval) const;
477
483 ErrorStatus getLnxEncoderDivide(int& interval) const;
484
491
498
505
512
519
526
533
540
547
554
561
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
#define MMIND_API_EXPORT
Definition api_global.h:48
Definition of data structure in device capturing image.
Definition MechEyeFrame.hpp:101
Definition MechEyeFrame.hpp:223
Interface that is used to connect the LNX Mech-Eye device and access basic information of the device.
Definition MechEyeLNXApi.h:60
ErrorStatus setLnxProfileStrategy(ProfileStrategy value) const
Set profile extraction strategy.
ErrorStatus setLnxTriggerDelay(int delay) const
Set the trigger delay time.
ErrorStatus getLnxExposure(int &time) const
Get the current exposure time for the Timed exposure mode.
ErrorStatus getLnxTriggerDelay(int &delay) const
Get the current trigger delay time.
ErrorStatus connect(const MechEyeDeviceInfo &info, const int timeout=10000)
Connect to the device by the MechEyeDeviceInfo identifying a device.
ErrorStatus deleteUserSet(const std::string &userSetName) const
ErrorStatus getAllUserSets(std::vector< std::string > &userSetNames) const
Get the names of all available parameter groups.
ErrorStatus setLnxHDRTripleSlope(int value) const
Set the y-coordinate of the second HDR knee point.
ErrorStatus addUserSet(const std::string &userSetName) const
ErrorStatus getLnxMaxFillingPointCount(int &value) const
Get the current maximum number of invalid points to be interpolated.
ErrorStatus setLnxDepthTimeout(int time) const
Set the timeout value for obtaining the depth map.
ErrorStatus setLnxGrayFilterThresh(int value) const
Set the grayscale value threshold. Grayscale values of pixels below this threshold are set to zero be...
ErrorStatus getScan3DAnalogGain(ImageAnalogGain &gainVal) const
Get the current analog gain.
ErrorStatus getLnxHDRTripleSlope(int &value) const
Get the current y-coordinate of the second HDR knee point.
ErrorStatus getLnxBatchRollData(float *depth, unsigned char *intensity, unsigned int *encoder, long long *frameId, int &lineCount) const
Get the acquired batch data.
ErrorStatus getLnxRawTimeout(int &time) const
Get the current timeout value for obtaining the line scan image.
ErrorStatus setLnxExposure(int time) const
Set the exposure time for the Timed exposure mode.
ErrorStatus setLnxLineRate(double rate) const
Set the line rate for the Software trigger source.
ErrorStatus setLnxMaxFillingPointCount(int value) const
Set the maximum number of invalid points to be interpolated.
ErrorStatus setCurrentUserSet(const std::string &userSetName) const
ErrorStatus setScan3DAnalogGain(ImageAnalogGain gainVal) const
Set the analog gain.
ErrorStatus getLnxEncoderMultiplier(EncoderMultiplier &multiple) const
Get the current encoder multiplier value.
ErrorStatus getCurrentUserSet(std::string &userSetName) const
Get the name of the currently selected parameter group.
ErrorStatus getLnxBatchRollData(LineBatch &LineBatch) const
Get the acquired batch data.
ErrorStatus getLnxLaserPowerLevel(int &powerLevel) const
Get the current laser power level.
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 saveAllSettingsToUserSets() const
Save all parameter values to the current parameter group.
ErrorStatus setLnxFilterType(FilterType type) const
Set the filter type.
ErrorStatus setLnxEncoderTriggerMode(EncoderTriggerMode mode) const
Set the encoder trigger mode.
ErrorStatus getLnxMinStripeWidth(int &value) const
Get the current minimum laser line width.
ErrorStatus getLnxLineRate(double &rate) const
Get the current line rate for the Software trigger source.
ErrorStatus setLnxMaxStripeWidth(int value)
Set the maximum laser line width.
ErrorStatus setLnxEncoderMultiplier(EncoderMultiplier multiple) const
Set the encoder multiplier value.
ErrorStatus getLnxEncoderTriggerMode(EncoderTriggerMode &mode) const
Get the current encoder trigger mode.
static std::vector< api::MechEyeDeviceInfo > enumerateMechEyeDeviceList()
Enumerate Mech-Eye devices by the MechEyeDeviceInfo identifying the device.
ErrorStatus setLnxMinStripeWidth(int value)
Set the minimum laser line width.
ErrorStatus setLnxCaptureMode(CaptureMode value) const
Set scan mode.
ErrorStatus setScan3DDigitalGain(int gainVal) const
Set the digital gain.
ErrorStatus getLnxProfileStrategy(ProfileStrategy &value) const
Get the current profile extraction strategy.
ErrorStatus setLnxMinStripeIntensity(int value)
Set the minimum laser line intensity.
ErrorStatus getLnxMeanFilterWindow(MeanFilterWindow &window) const
Get the current window size for mean filtering.
ErrorStatus setLnxDepthTriggerSource(TriggerSource triggerSource) const
Set the trigger source for the Depth scan mode. Note: this function can only be used in CaptureMode:...
ErrorStatus getScan3DAnalogGainFor8030(ImageAnalogGainFor8030 &gainVal) const
Get the current analog gain of LNX-8030.
ErrorStatus getLnxEncoderDivide(int &interval) const
Get the current encoder divider value.
void disconnect()
Disconnect from the device.
ErrorStatus getLnxXScale(float &xScale) const
Get the X resolution.
ErrorStatus getLnxEncoderValue(unsigned int &value) const
Get the current encoder value.
ErrorStatus setScanExposureMode(ExposureMode mode) const
Set the exposure mode.
ErrorStatus setLnxMeanFilterWindow(MeanFilterWindow window) const
Set the window size for mean filtering.
ErrorStatus getScan3DHDRExposureSequence(int &time1, int &time2, int &time3) const
Get the current exposure sequence for the HDR exposure mode.
ErrorStatus getLnxDepthTimeout(int &time) const
Get the current 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 getLnxMaxStripeWidth(int &value) const
Get the current maximum laser line width.
ErrorStatus getLnxFilterType(FilterType &type) const
Get the filter type.
ErrorStatus setLnxMedianFilterWindow(MedianFilterWindow window) const
Set the window size for median filtering.
ErrorStatus setLnxRawTimeout(int time) const
Set the timeout value for obtaining the line scan image.
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 setScan3DHDRExposureSequence(int time1, int time2, int time3) const
Set the exposure sequence for the HDR exposure mode.
ErrorStatus getLnxGrayFilterThresh(int &value) const
Get the current grayscale value threshold.
ErrorStatus getScanExposureMode(ExposureMode &mode) const
Get the current exposure mode.
ErrorStatus getLnxXDataWidth(int &xDataWidth) const
Get the line width in the X direction.
ErrorStatus getLnxProfileNum(int &profileNum) const
Get the current maximum number of lines to be scanned.
ErrorStatus startLnxCaptureImage()
Start scanning.
ErrorStatus stopLnxCaptureImage()
Stop scanning.
ErrorStatus setLnxLaserPowerLevel(int powerLevel) const
Set the laser power level.
ErrorStatus setLnxMaxStripeIntensity(int value)
Set the maximum laser line intensity.
ErrorStatus setLnxROIMode(ROIMode mode) const
Set the ROI mode.
ErrorStatus setScan3DAnalogGainFor8030(ImageAnalogGainFor8030 gainVal) const
Set the analog gain of LNX-8030.
ErrorStatus getDeviceInfo(api::MechEyeDeviceInfo &info) const
Get the basic information of the connected device.
ErrorStatus getLnxROIMode(ROIMode &mode) const
Get the current ROI mode.
ErrorStatus getLnxMedianFilterWindow(MedianFilterWindow &window) const
Get the current window size for median filtering.
ErrorStatus getLnxCaptureMode(CaptureMode &value) const
Get the current scan mode.
ErrorStatus getLnxHDRDualSlope(int &value) const
Get the current y-coordinate of the first HDR knee point.
ErrorStatus getScan3DDigitalGain(int &gainVal) const
Get the current digital gain.
ErrorStatus setLnxHDRDualSlope(int value) const
Set the y-coordinate of the first HDR knee point.
ErrorStatus getLnxDepthTriggerSource(TriggerSource &triggerSource) const
Get the current trigger source for the Depth scan mode.
ErrorStatus getLnxMaxStripeIntensity(int &value) const
Get the current maximum laser line intensity.
ErrorStatus captureLnx2DImage(ColorMap &colorMap) const
Perform scanning of one line and obtain the line scan image.
std::string MMIND_API_EXPORT getApiInformation()
Gets the API basic information including version and manufacturing company.
EncoderTriggerMode
This enumeration defines the encoder trigger mode.
Definition MechEyeDataType.h:236
ExposureMode
This enumeration defines the exposure mode.
Definition MechEyeDataType.h:182
ImageAnalogGain
This enumeration defines the image analog gain.
Definition MechEyeDataType.h:207
ProfileStrategy
This enumeration defines the profile extraction strategy.
Definition MechEyeDataType.h:292
FilterType
This enumeration defines the filter type.
Definition MechEyeDataType.h:258
EncoderMultiplier
This enumeration defines the encoder multiplier.
Definition MechEyeDataType.h:249
MedianFilterWindow
This enumeration defines the window size for median filtering.
Definition MechEyeDataType.h:281
CaptureMode
This enumeration defines the scan mode.
Definition MechEyeDataType.h:191
ImageAnalogGainFor8030
Definition MechEyeDataType.h:215
ROIMode
This enumeration defines the ROI along the Z direction.
Definition MechEyeDataType.h:225
TriggerSource
This enumeration defines the trigger source.
Definition MechEyeDataType.h:199
MeanFilterWindow
This enumeration defines the window size for mean filtering.
Definition MechEyeDataType.h:268
Definition Array2D.h:8
This enumeration defines the types of errors.
Definition MechEyeDataType.h:45
This struct defines device information.
Definition MechEyeDataType.h:87