Mech-Eye API 2.2.1
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 | 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. | |
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 in scan mode. There are two ways to retrieve profile data, by polling or callback. This function is only used for polling. The profile count in batch is not fixed, it is related to the scan rate and the rate of this function 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. The function only needs to be called when profile data needs to be retrieved through callback. This function must be called after connect but not after startAcquisition. If the laser profiler is in data acquisition status, stopAcquisition should be called before registering a different callback function. | |
ErrorStatus | startAcquisition () |
Enters the laser profiler into the data acquisition status, where it can accept trigger signals. This method must be called before triggerSoftware. | |
ErrorStatus | stopAcquisition () |
Exits the laser profiler from the data acquisition status, and then it can not accept trigger signals. If callback function is being executed when this function is called, this function will block until 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 |
Operates the laser profiler. Use Profiler::connect to connect an available laser profiler, retrieve profile data, configure parameters and so on.
Definition at line 50 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 retrieving result that contains information such as profile index, encoder value intensity image, and depth data. See ProfileBatch for details. |
[out] | pUser | The user data pointer. |
Definition at line 59 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::registerAcquisitionCallback | ( | const Profiler::AcquisitionCallback & | func, |
void * | pUser | ||
) |
Registers the callback function for data acquisition. The function only needs to be called when profile data needs to be retrieved through callback. This function must be called after connect but not after startAcquisition. If the laser profiler is in data acquisition status, stopAcquisition should be called before registering a different callback function.
[in] | func | The function to be registered. When the count of the profile data that has been retrieved is equal to the scan line count set, the func 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 in scan mode. There are two ways to retrieve profile data, by polling or callback. This function is only used for polling. The profile count in batch is not fixed, it is related to the scan rate and the rate of this function 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::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 data acquisition status, where it can accept trigger signals. This method must be called before triggerSoftware.
ErrorStatus mmind::eye::Profiler::stopAcquisition | ( | ) |
Exits the laser profiler from the data acquisition status, and then it can not accept trigger signals. If callback function is being executed when this function is called, this function will block until 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 284 of file Profiler.h.