Mech-Eye API 2.4.0
API reference documentation for Mech-Eye 3D Laser Profiler
|
Operates the laser profiler. Use Profiler::connect to connect an available laser profiler, retrieve profile data, configure parameters and so on. More...
#include <Profiler.h>
Public Types | |
using | AcquisitionCallback = std::function<void(const ProfileBatch& batch, void* pUser)> |
The type of callback function. | |
Public Member Functions | |
Profiler () | |
Constructor. | |
~Profiler () | |
Destructor. | |
Profiler (const Profiler &other) noexcept | |
Copy constructor. | |
Profiler & | operator= (const Profiler &other) noexcept |
Copy assignment. | |
ErrorStatus | connect (const ProfilerInfo &info, unsigned int timeoutMs=5000) |
Connects to a laser profiler via ProfilerInfo. | |
ErrorStatus | saveVirtualDeviceFile (const ProfileBatch &data, const std::string &filePath) |
Saves the acquired ProfileBatch data collected, Parameter s, and ProfilerInfo in an MRAW format file that can be loaded as a VirtualProfiler. | |
ErrorStatus | connect (const std::string &ipAddress, unsigned int timeoutMs=5000) |
Connects to a laser profiler via IP address. | |
ErrorStatus | disconnect () |
Disconnects from the current laser profiler and releases the associated resources. | |
ErrorStatus | setHeartbeatInterval (unsigned int intervalMs) |
Sets the time interval at which the client sends periodic heartbeat messages to the profiler side. The default time interval is 10s. | |
ErrorStatus | getProfilerInfo (ProfilerInfo &info) const |
Gets the basic information of the laser profiler, such as model, serial number, firmware version, and IP setting, etc. | |
ErrorStatus | getProfilerStatus (ProfilerStatus &status) const |
Gets various statuses of the laser profiler. | |
UserSetManager & | userSetManager () |
Gets the UserSetManager of the laser profiler. UserSetManager provides various operations to manage all user set saved in the laser profiler, including adding and deleting the user set and selecting the user set currently in effect. It is also available to save all user set details to a json file and read a json file to load user set details. | |
UserSet & | currentUserSet () |
Gets the UserSet currently in effect of the laser profiler. UserSet can access all available parameters of the laser profiler related to profile data acquisition. UserSet can also directly set and get parameters instead of using Parameter interface. | |
ErrorStatus | retrieveBatchData (ProfileBatch &batch, int timeoutMs=4000) const |
Retrieves a batch of the profiles. There are two ways to retrieve profile data, by polling or callback. This method is only used with the polling method. The number of profiles contained in a batch varies depending on the scan rate and the rate at which this method is called. | |
ErrorStatus | triggerSoftware () |
Sends a software signal to trigger data acquisition. This method is used when no external signals are input to trigger data acquisition and must be called after startAcquisition. | |
ErrorStatus | registerAcquisitionCallback (const Profiler::AcquisitionCallback &func, void *pUser) |
Registers the callback function for data acquisition. There are two ways to retrieve profile data, by polling or callback. This method is only used with the callback method. This method must be called after connect and before startAcquisition. If the laser profiler is in acquisition ready status, stopAcquisition should be called before registering a different callback function. | |
ErrorStatus | startAcquisition () |
Enters the laser profiler into the acquisition ready status, where it can accept trigger signals for scanning. | |
ErrorStatus | stopAcquisition () |
Exits the laser profiler from the acquisition ready status to avoid accidental triggering of scanning. If a callback function is being executed when this method is called, this method is not executed until the execution of the callback function is finished. | |
ErrorStatus | setOutputForGPIO (OutputLineGPIO outputLine, OutputLevel value) |
Sets controller GPIO output value. | |
ErrorStatus | getAcquisitionStatus (AcquisitionStatus &status) |
Gets the acquisition status. | |
Static Public Member Functions | |
static std::vector< ProfilerInfo > | discoverProfilers () |
Discovers all available laser profilers, and returns the laser profiler information list. If a laser profiler is not successfully discovered, check the running status and network connection of the laser profiler. | |
Friends | |
class | ProfilerEvent |
class | InternalInterfaces |
Operates the laser profiler. Use Profiler::connect to connect an available laser profiler, retrieve profile data, configure parameters and so on.
Definition at line 67 of file Profiler.h.
using mmind::eye::Profiler::AcquisitionCallback = std::function<void(const ProfileBatch& batch, void* pUser)> |
The type of callback function.
[out] | batch | The retrieved data of multiple profiles. See ProfileBatch for details. |
[out] | pUser | The user data pointer. |
Definition at line 76 of file Profiler.h.
ErrorStatus mmind::eye::Profiler::connect | ( | const ProfilerInfo & | info, |
unsigned int | timeoutMs = 5000 ) |
Connects to a laser profiler via ProfilerInfo.
[in] | info | Laser profiler information. Use Profiler::discoverProfilers to find all available laser profilers. |
[in] | timeoutMs | The timeout for connecting a laser profiler(ms). If the execution time of the connecting process is greater than the timeout, the function will immediately return ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR. |
ErrorStatus mmind::eye::Profiler::connect | ( | const std::string & | ipAddress, |
unsigned int | timeoutMs = 5000 ) |
Connects to a laser profiler via IP address.
[in] | ipAddress | Valid IP address of the laser profiler, e.g. in "100.100.1.1" format. |
[in] | timeoutMs | The timeout for connecting a laser profiler (ms). If the execution time of the connecting process is greater than the timeout, the function will immediately return ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR. |
UserSet & mmind::eye::Profiler::currentUserSet | ( | ) |
ErrorStatus mmind::eye::Profiler::disconnect | ( | ) |
Disconnects from the current laser profiler and releases the associated resources.
|
static |
Discovers all available laser profilers, and returns the laser profiler information list. If a laser profiler is not successfully discovered, check the running status and network connection of the laser profiler.
ErrorStatus mmind::eye::Profiler::getAcquisitionStatus | ( | AcquisitionStatus & | status | ) |
Gets the acquisition status.
ErrorStatus mmind::eye::Profiler::getProfilerInfo | ( | ProfilerInfo & | info | ) | const |
Gets the basic information of the laser profiler, such as model, serial number, firmware version, and IP setting, etc.
[out] | See | ProfilerInfo for details. |
ErrorStatus mmind::eye::Profiler::getProfilerStatus | ( | ProfilerStatus & | status | ) | const |
Gets various statuses of the laser profiler.
[out] | See | ProfilerStatus for details. |
ErrorStatus mmind::eye::Profiler::registerAcquisitionCallback | ( | const Profiler::AcquisitionCallback & | func, |
void * | pUser ) |
Registers the callback function for data acquisition. There are two ways to retrieve profile data, by polling or callback. This method is only used with the callback method. This method must be called after connect and before startAcquisition. If the laser profiler is in acquisition ready status, stopAcquisition should be called before registering a different callback function.
[in] | func | The callback function to be registered. When the number of retrieved profiles equals to the set value of ScanLineCount, the callback function will be executed. See AcquisitionCallback for details. |
[out] | pUser | The user data pointer. |
ErrorStatus mmind::eye::Profiler::retrieveBatchData | ( | ProfileBatch & | batch, |
int | timeoutMs = 4000 ) const |
Retrieves a batch of the profiles. There are two ways to retrieve profile data, by polling or callback. This method is only used with the polling method. The number of profiles contained in a batch varies depending on the scan rate and the rate at which this method is called.
[out] | batch | The retrieving result, it contains information including profile index, encoder value intensity image, and depth data. See ProfileBatch for details. |
[in] | timeoutMs | The timeout for capturing in milliseconds. If the execution time of the capturing process is greater than the timeout, the function will immediately return ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR. |
ErrorStatus mmind::eye::Profiler::saveVirtualDeviceFile | ( | const ProfileBatch & | data, |
const std::string & | filePath ) |
Saves the acquired ProfileBatch data collected, Parameter s, and ProfilerInfo in an MRAW format file that can be loaded as a VirtualProfiler.
data | The acquired ProfileBatch data to be saved. |
filePath | The path where the MRAW file will be saved. |
ErrorStatus mmind::eye::Profiler::setHeartbeatInterval | ( | unsigned int | intervalMs | ) |
Sets the time interval at which the client sends periodic heartbeat messages to the profiler side. The default time interval is 10s.
[in] | timeIntervalMs | The time interval for periodic sending heartbeat messages in milliseconds. The valid setting range is from 1s to 3600s. |
ErrorStatus mmind::eye::Profiler::setOutputForGPIO | ( | OutputLineGPIO | outputLine, |
OutputLevel | value ) |
Sets controller GPIO output value.
ErrorStatus mmind::eye::Profiler::startAcquisition | ( | ) |
Enters the laser profiler into the acquisition ready status, where it can accept trigger signals for scanning.
ErrorStatus mmind::eye::Profiler::stopAcquisition | ( | ) |
Exits the laser profiler from the acquisition ready status to avoid accidental triggering of scanning. If a callback function is being executed when this method is called, this method is not executed until the execution of the callback function is finished.
ErrorStatus mmind::eye::Profiler::triggerSoftware | ( | ) |
Sends a software signal to trigger data acquisition. This method is used when no external signals are input to trigger data acquisition and must be called after startAcquisition.
UserSetManager & mmind::eye::Profiler::userSetManager | ( | ) |
Gets the UserSetManager of the laser profiler. UserSetManager provides various operations to manage all user set saved in the laser profiler, including adding and deleting the user set and selecting the user set currently in effect. It is also available to save all user set details to a json file and read a json file to load user set details.
|
friend |
Definition at line 330 of file Profiler.h.
|
friend |
Definition at line 329 of file Profiler.h.