53 std::cout <<
"........................................." << std::endl;
54 std::cout <<
"Model: " << profilerInfo.
model << std::endl;
56 const auto consoleCP = GetConsoleOutputCP();
57 SetConsoleOutputCP(CP_UTF8);
59 std::cout <<
"Device name: " << profilerInfo.
deviceName << std::endl;
61 SetConsoleOutputCP(consoleCP);
63 std::cout <<
"Controller serial number: " << profilerInfo.
controllerSN << std::endl;
64 std::cout <<
"Sensor head serial number: " << profilerInfo.
sensorSN << std::endl;
65 std::cout <<
"IP address: " << profilerInfo.
ipAddress << std::endl;
66 std::cout <<
"Subnet mask: " << profilerInfo.
subnetMask << std::endl;
67 std::cout <<
"IP address assignment method: "
70 std::cout <<
"Hardware version: "
72 std::cout <<
"Firmware version: "
74 std::cout <<
"........................................." << std::endl;
75 std::cout << std::endl;
80 std::cout <<
".....Profiler temperatures....." << std::endl;
81 std::cout <<
"Controller CPU: " << std::setprecision(4)
83 std::cout <<
"Sensor CPU: " << std::setprecision(4)
85 std::cout <<
"..............................." << std::endl;
86 std::cout << std::endl;
95 std::cout <<
"Looking for available profilers..." << std::endl;
96 std::vector<mmind::eye::ProfilerInfo> profilerInfoList =
99 if (profilerInfoList.empty()) {
100 std::cout <<
"No profilers are available." << std::endl;
104 for (
int i = 0; i < profilerInfoList.size(); i++) {
105 std::cout <<
"Mech-Eye device index: " << i << std::endl;
109 std::cout <<
"Enter the index of the device to which you want to connect: ";
110 unsigned inputIndex = 0;
115 if (std::regex_match(str.begin(), str.end(), std::regex{
"[0-9]+"}) &&
116 atoi(str.c_str()) < profilerInfoList.size()) {
117 inputIndex = atoi(str.c_str());
120 std::cout <<
"The entered index is invalid. Please enter the device index again: ";
124 status = profiler.
connect(profilerInfoList[inputIndex]);
126 if (!status.
isOK()) {
131 std::cout <<
"Successfully connected to the profiler." << std::endl;
137 std::cout <<
"Looking for available profilers..." << std::endl;
138 std::vector<mmind::eye::ProfilerInfo> profilerInfoList =
141 if (profilerInfoList.empty()) {
142 std::cout <<
"No profilers are available." << std::endl;
146 for (
int i = 0; i < profilerInfoList.size(); i++) {
147 std::cout <<
"Mech-Eye device index: " << i << std::endl;
152 std::set<unsigned> indices;
155 std::cout <<
"Enter the indices of the devices to which you want to connect: " << std::endl;
156 std::cout <<
"Enter the character \"c\" at the end of all the indices" << std::endl;
161 if (std::regex_match(str.begin(), str.end(), std::regex{
"[0-9]+"}) &&
162 atoi(str.c_str()) < profilerInfoList.size())
163 indices.insert(atoi(str.c_str()));
165 std::cout <<
"The entered indices are invalid. Please enter the device indices again: ";
168 std::vector<mmind::eye::Profiler> profilerList{};
170 auto iter = indices.cbegin();
171 for (
int i = 0; i < indices.size(); ++i, ++iter) {
173 auto status = profiler.
connect(profilerInfoList[*iter]);
175 profilerList.push_back(profiler);
186 <<
"Do you want the profiler to capture image? Enter \"y\" to confirm or \"n\" to cancel: "
189 std::string confirmStr;
190 std::cin >> confirmStr;
191 if (confirmStr ==
"y") {
193 }
else if (confirmStr ==
"n") {
194 std::cout <<
"The capture command was canceled." << std::endl;
197 std::cout <<
"The entered character was invalid. Please enter \"y\" ot confirm or "
206 bool saveCSV =
true,
bool isOrganized =
false)
212 double xResolution{};
215 if (!status.isOK()) {
221 double yResolution{};
224 if (!status.isOK()) {
246 int lineScanTriggerSource{};
248 lineScanTriggerSource);
249 if (!status.isOK()) {
254 bool useEncoderValues =
255 lineScanTriggerSource ==
258 int triggerInterval{};
261 if (!status.isOK()) {
266 std::cout <<
"Save the point cloud." << std::endl;
269 xResolution, yResolution, useEncoderValues, triggerInterval,
274 xResolution, yResolution, useEncoderValues, triggerInterval,
void savePLY(const mmind::api::PointXYZMap &pointXYZMap, const std::string &path)
Definition PclUtil.h:121
void showError(const mmind::api::ErrorStatus &status)
Definition SampleUtil.h:40
bool findAndConnect(mmind::eye::Profiler &profiler)
Discovers all available laser profilers and allows the user to connect to a laser profiler by inputti...
Definition api_util.h:93
std::vector< mmind::eye::Profiler > findAndConnectMultiProfiler()
Definition api_util.h:135
bool confirmCapture()
Definition api_util.h:183
void printProfilerStatus(const mmind::eye::ProfilerStatus &profilerStatus)
Definition api_util.h:78
void printProfilerInfo(const mmind::eye::ProfilerInfo &profilerInfo)
Prints the data in the ProfilerInfo object.
Definition api_util.h:51
void savePointCloud(const mmind::eye::ProfileBatch &batch, const mmind::eye::UserSet &userSet, bool savePLY=true, bool saveCSV=true, bool isOrganized=false)
Definition api_util.h:204
Represents a batch of profiles, which can be obtained by calling Profiler::retrieveBatchData()....
Definition ProfileData.h:74
ErrorStatus saveUntexturedPointCloud(double xResolution, double yResolution, bool useEncoderValues, int triggerInterval, FileFormat fileFormat, const std::string &fileName, CoordinateUnit coordinateUnit=CoordinateUnit::Millimeter, bool isOrganized=false) const
Saves the untextured point cloud data in the batch. Each point in UntexturedPointCloud contains the X...
bool isEmpty() const
Checks if the ProfileBatch object has no elements.
Operates the laser profiler. Use Profiler::connect to connect an available laser profiler,...
Definition Profiler.h:100
static std::vector< ProfilerInfo > discoverProfilers(unsigned int timeoutMs=5000)
Discovers all available laser profilers and returns the list of information of all available laser pr...
ErrorStatus connect(const ProfilerInfo &info, unsigned int timeoutMs=5000)
Connects to a laser profiler via ProfilerInfo.
ErrorStatus getIntValue(const std::string ¶meterName, int &value) const
Gets the current value of an _Int-type device parameter. See Parameter for details.
ErrorStatus getEnumValue(const std::string ¶meterName, int &value) const
Gets the current value of an _Enum-type device parameter in the form of the integer value....
ErrorStatus getFloatValue(const std::string ¶meterName, double &value) const
Gets the current value of a _Float-type device parameter. See Parameter for details.
std::string toString() const
Converts a Version object to a string.
Definition Version.h:71
static constexpr const char * name
Definition ScanParameters.h:291
static constexpr const char * name
Definition ScanParameters.h:305
static constexpr const char * name
Definition ScanParameters.h:194
static constexpr const char * name
Definition ScanParameters.h:82
Describes the types of errors.
Definition ErrorStatus.h:12
bool isOK() const
Returns true if the operation succeeded.
Definition ErrorStatus.h:85
Describes the laser profiler information.
Definition ProfilerInfo.h:44
IpAssignmentMethod ipAssignmentMethod
The IP address assignment method of the laser profiler.
Definition ProfilerInfo.h:54
std::string controllerSN
The controller serial number.
Definition ProfilerInfo.h:47
std::string sensorSN
The sensor serial number.
Definition ProfilerInfo.h:48
std::string model
The laser profiler model.
Definition ProfilerInfo.h:45
Version firmwareVersion
The version of the firmware. The firmware can be upgraded.
Definition ProfilerInfo.h:50
std::string subnetMask
The IP subnet mask of the laser profiler.
Definition ProfilerInfo.h:52
Version hardwareVersion
The version of the hardware. The hardware cannot be upgraded.
Definition ProfilerInfo.h:49
std::string deviceName
The device name (UTF-8 encoded).
Definition ProfilerInfo.h:46
std::string ipAddress
The IP address of the laser profiler.
Definition ProfilerInfo.h:51
Describes the laser profiler's statuses.
Definition Profiler.h:90
ProfilerTemperature temperature
Definition Profiler.h:91
float controllerCpuTemperature
The temperature (in °C) of the controller CPU.
Definition Profiler.h:82
float sensorCpuTemperature
The temperature (in °C) of the FPGA.
Definition Profiler.h:83