cmvr-es/dependency/arm/third_party/Mech-Eye/v2.5.1/samples/cpp/profiler
2026-01-14 14:04:07 +08:00
..
BlindSpotFiltering Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
ManageUserSets Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
MultipleProfilersCalibration Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
NoiseRemoval Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
PrintProfilerStatus Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
ProfileAlignment Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
RegisterProfilerEvent Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
RenderDepthMap Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
TransformPointCloud Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
TriggerMultipleProfilersSimultaneously Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
TriggerNonStopAcquisition Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
TriggerWithExternalDeviceAndEncoder Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
TriggerWithExternalDeviceAndFixedRate Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
TriggerWithSoftwareAndEncoder Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
TriggerWithSoftwareAndFixedRate Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
UseVirtualDevice Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
CMakeLists.txt Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00
README.md Catalog structure and dependent libraries. 2026-01-14 14:04:07 +08:00

C++ Samples for Mech-Eye 3D Laser Profiler

This documentation provides descriptions of Mech-Eye API C++ samples for Mech-Eye 3D Laser Profiler and instructions for building all the samples at once.

If you have any questions or have anything to share, feel free to post on the Mech-Mind Online Community. The community also contains a specific category for development with Mech-Eye SDK.

Sample List

Currently, the following samples are provided.

The samples marked with (OpenCV) require OpenCV to be installed.

  • TriggerWithSoftwareAndFixedRate (OpenCV)
    Trigger data acquisition with signals input from software, trigger line scans at a fixed rate, and then retrieve and save the acquired data.
  • TriggerWithExternalDeviceAndFixedRate (OpenCV)
    Trigger data acquisition with signals input from the external device, trigger line scans at a fixed rate, and then retrieve and save the acquired data.
  • TriggerWithSoftwareAndEncoder (OpenCV)
    Trigger data acquisition with signals input from software, trigger line scans with signals input from the encoder, and then retrieve and save the acquired data.
  • TriggerWithExternalDeviceAndEncoder (OpenCV)
    Trigger data acquisition with signals input from the external device, trigger line scans with signals input from the encoder, and then retrieve and save the acquired data.
  • TriggerMultipleProfilersSimultaneously (OpenCV)
    Trigger multiple laser profilers to acquire data asynchronously and retrieve the acquired data.
  • TriggerNonStopAcquisition (OpenCV)
    Trigger non-stop acquisition, and then retrieve and save the acquired data.
  • BlindSpotFiltering (OpenCV)
    Detect and remove the false data caused by blind spots and obtain the filtered profile data.
  • NoiseRemoval (OpenCV)
    Remove the noise in the depth data and obtain the filtered profile data.
  • ProfileAlignment (OpenCV)
    Correct the X-axis and Z-axis vibrations in the profiles (aligning the profiles) and obtain the corrected profile data.
  • RenderDepthMap (OpenCV)
    Obtain and save the depth map rendered with the jet color scheme.
  • TransformPointCloud
    Obtain and save the point clouds in the custom reference frame.
  • ManageUserSets
    Manage parameter groups, such as obtaining the names of all parameter groups, adding a parameter group, switching the parameter group, and saving parameter settings to the parameter group.
  • PrintProfilerStatus
    Obtain and print the laser profiler's information, such as model, serial number, firmware version, and temperatures.
  • RegisterProfilerEvent
    Define and register the callback function for monitoring laser profiler events.
  • UseVirtualDevice (OpenCV)
    Acquire the profile data stored in a virtual device, generate the intensity image and depth map, and save the images.

Build the Samples

The instructions provided here allow you to build all the samples at once.

Windows

Prerequisites

Please download and install the required software listed below.

Optional software: If you need to build the samples dependent on third-party software (refer to the Sample List above), please install the corresponding software.

Instructions

  1. Make sure that the samples are stored in a location with read and write permissions.

  2. If OpenCV is installed, add the following directories to the Path environment variable:

    • xxx/opencv/build/x64/vc14/bin
    • xxx/opencv/build/x64/vc14/lib
  3. (Optional) Disable unneeded samples: if OpenCV is installed, this step must be performed.

    Open the CMakeLists file in xxx/profiler, and change ON to OFF in the line that starts with option(USE_OPENCV.

  4. Run Cmake and set the source and build paths:

    Field Path
    Where is the source code xxx/profiler
    Where to build the binaries xxx/profiler/build
  5. Click the Configure button. In the pop-up window, set the generator and platform according to the actual situation, and then click the Finish button.

  6. When the log displays Configuring done, click the Generate button. When the log displays Generating done, click the Open Project button.

  7. In Visual Studio toolbar, change the solution configuration from Debug to Release.

  8. In the menu bar, select Build > Build Solution. An EXE format executable file is generated for each sample. The executable files are saved to the Release folder, located in the Where to build the binaries directory.

  9. In the Solution Explorer panel, right-click a sample, and select Set as Startup Project.

  10. Click the Local Windows Debugger button in the toolbar to run the sample.

  11. Enter the index of the laser profiler to which you want to connect, and press the Enter key. The obtained files are saved to the Release folder.

Ubuntu

Ubuntu 18 or above is required.

Prerequisites

  • Update the software source list.

    sudo apt-get update
    
  • Install required tools.

    sudo apt-get install -y build-essential pkg-config cmake
    
  • Install Mech-Eye SDK (latest version).

    Note: If you have installed Mech-Eye SDK before, please uninstall it first with the following command:

    sudo dpkg -P MechEyeApi
    
    • If the system architecture is AMD64, execute the following command:

      sudo dpkg -i 'Mech-Eye_API_x.x.x_amd64.deb'
      
    • If the system architecture is ARM64, execute the following command:

      sudo dpkg -i 'Mech-Eye_API_x.x.x_arm64.deb'
      
  • Install optional third-party libraries: If you need to build the samples dependent on third-party software (refer to the Sample List above), please install the corresponding software.

    • Install OpenCV (latest version):

      sudo apt update && sudo apt install -y unzip
      wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip
      unzip opencv.zip
      mkdir build && cd build
      cmake ../opencv-4.x
      cmake --build .
      sudo make install
      

Instructions

  1. Navigate to the directory of the sample.

    cd xxx/profiler/
    
  2. (Optional) Disable unneeded samples: if any of the optional software is not installed, this step must be performed.

    Open the CMakeLists file in xxx/profiler/, and change ON to OFF in the options of the unneeded samples.

  3. Configure and build the samples.

    sudo mkdir build && cd build
    sudo cmake ..
    sudo make
    
  4. Run a sample. Replace SampleName with the name of the sample that you want to run.

    sudo ./SampleName
    
  5. Enter the index of the laser profiler to which you want to connect, and press the Enter key. The obtained files are saved to xxx/profiler/build.

License

Mech-Eye Samples are distributed under the BSD license.