Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samples: update mecheye_halcon_samples to SDK 2.4.0 #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions area_scan_3d_camera/connect_to_camera_and_capture_images.hdev
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
<c>* Set the "grab_timeout" parameter.</c>
<c>* The "grab_timeout" parameter defines the maximum time in milliseconds that the frame grabber will wait for an image to be grabbed before timing out.</c>
<l>set_framegrabber_param (AcqHandle, 'grab_timeout', 8000)</l>
<c>* Set the "[Stream]GevStreamMaxBlockDuration" parameter to 70% of the "grab_timeout" parameter.</c>
<c>* The "[Stream]GevStreamMaxBlockDuration" parameter defines the maximum transmission time for a data block in microseconds.</c>
<l>get_framegrabber_param (AcqHandle, 'grab_timeout', grabTimeout)</l>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxBlockDuration', 0.7*(grabTimeout*1000))</l>
<c>* Set the maximum number of packet gaps allowed in the GigE Vision stream. </c>
<c>* A packet gap occurs when one or more packets are missing during the data transmission. </c>
<c>* Setting this parameter to 500 allows a maximum of 500 packet gaps in the stream.</c>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<c>* Set the "grab_timeout" parameter.</c>
<c>* The "grab_timeout" parameter defines the maximum time in milliseconds that the frame grabber will wait for an image to be grabbed before timing out.</c>
<l>set_framegrabber_param (AcqHandle, 'grab_timeout', 10000)</l>
<c>* Set the "[Stream]GevStreamMaxBlockDuration" parameter to 70% of the "grab_timeout" parameter.</c>
<c>* The "[Stream]GevStreamMaxBlockDuration" parameter defines the maximum transmission time for a data block in microseconds.</c>
<l>get_framegrabber_param (AcqHandle, 'grab_timeout', grabTimeout)</l>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxBlockDuration', 0.7*(grabTimeout*1000))</l>
<c>* Set the calibration board model.</c>
<c>* Replace "BDB-5" with the calibration board model in use. </c>
<c>* Possible values include BDB-5, BDB-6, BDB-7, OCB-005, OCB-010, OCB-015, OCB-020, CGB-020, CGB-035, and CGB-050.</c>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@
<c>* Obtain the firmware version of the camera.</c>
<l>get_framegrabber_param (AcqHandle, 'DeviceFirmwareVersion', FirmwareVersion)</l>
<c>* Stop execution if the firmware version is lower than 2.1.0.</c>
<l>if (FirmwareVersion &lt; '2.1.0')</l>
<l>if (FirmwareVersion &lt; '2.4.0')</l>
<l> stop()</l>
<l>endif</l>
<c></c>
<c>* Set the "grab_timeout" parameter.</c>
<c>* The "grab_timeout" parameter defines the maximum time in milliseconds that the frame grabber will wait for an image to be grabbed before timing out.</c>
<l>set_framegrabber_param (AcqHandle, 'grab_timeout', 10000)</l>
<c>* Set the "[Stream]GevStreamMaxBlockDuration" parameter to 70% of the "grab_timeout" parameter.</c>
<c>* The "[Stream]GevStreamMaxBlockDuration" parameter defines the maximum transmission time for a data block in microseconds.</c>
<l>get_framegrabber_param (AcqHandle, 'grab_timeout', grabTimeout)</l>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxBlockDuration', 0.7*(grabTimeout*1000))</l>
<c>* Set the "DeviceScanType" parameter to "Areascan" to obtain the 2D image.</c>
<l>set_framegrabber_param (AcqHandle, 'DeviceScanType', 'Areascan')</l>
<c>* Set the camera mounting mode.</c>
Expand Down Expand Up @@ -122,7 +126,7 @@
<l>timeout := 10</l>
<l>while (1)</l>
<l> wait_seconds(0.5)</l>
<l> set_framegrabber_param (AcqHandle, 'UserSetLoad', 0)</l>
<l> set_framegrabber_param (AcqHandle, 'UpdateCalibStatus', 0)</l>
<c> * Check whether the above processes have been completed.</c>
<l> get_framegrabber_param (AcqHandle, 'CollectStatus', CollectRet)</l>
<l> if (CollectRet == 'CollectDone' or CollectRet == 'COLLECT_DONE') </l>
Expand Down Expand Up @@ -165,7 +169,7 @@
<l>timeout := 100</l>
<l>while (1)</l>
<l> wait_seconds(0.5)</l>
<l> set_framegrabber_param (AcqHandle, 'UserSetLoad', 0)</l>
<l> set_framegrabber_param (AcqHandle, 'UpdateCalibStatus', 0)</l>
<c> * Check whether the calculation has been completed.</c>
<l> get_framegrabber_param (AcqHandle, 'CalibStatus', CalibRet) </l>
<l> if (CalibRet == 'CalibDone' or CalibRet == 'CALIB_DONE') </l>
Expand Down
6 changes: 6 additions & 0 deletions area_scan_3d_camera/obtain_depth_map.hdev
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
<l>if (FirmwareVersion &lt; '2.0.3')</l>
<l> stop()</l>
<l>endif</l>
<c></c>
<c>* Set the "[Stream]GevStreamMaxBlockDuration" parameter to 70% of the "grab_timeout" parameter.</c>
<c>* The "[Stream]GevStreamMaxBlockDuration" parameter defines the maximum transmission time for a data block in microseconds.</c>
<l>get_framegrabber_param (AcqHandle, 'grab_timeout', grabTimeout)</l>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxBlockDuration', 0.7*(grabTimeout*1000))</l>
<c></c>
<c>* Set the "DeviceScanType" parameter to "Areascan3D" to obtain the 3D data.</c>
<l>set_framegrabber_param (AcqHandle, 'DeviceScanType', 'Areascan3D')</l>
<c>* Obtain the available options of the "ComponentSelector" parameter.</c>
Expand Down
6 changes: 6 additions & 0 deletions area_scan_3d_camera/obtain_point_cloud_with_normals.hdev
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
<l>if (FirmwareVersion &lt; '2.2.0')</l>
<l> stop()</l>
<l>endif</l>
<c></c>
<c>* Set the "[Stream]GevStreamMaxBlockDuration" parameter to 70% of the "grab_timeout" parameter.</c>
<c>* The "[Stream]GevStreamMaxBlockDuration" parameter defines the maximum transmission time for a data block in microseconds.</c>
<l>get_framegrabber_param (AcqHandle, 'grab_timeout', grabTimeout)</l>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxBlockDuration', 0.7*(grabTimeout*1000))</l>
<c></c>
<c>* Set the "DeviceScanType" parameter to "Areascan3D" to obtain the 3D data.</c>
<l>set_framegrabber_param (AcqHandle, 'DeviceScanType', 'Areascan3D')</l>
<c>* Obtain the available options of the "ComponentSelector" parameter.</c>
Expand Down
6 changes: 6 additions & 0 deletions area_scan_3d_camera/obtain_textured_point_cloud.hdev
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
<l>if (FirmwareVersion &lt; '2.0.3')</l>
<l> stop()</l>
<l>endif</l>
<c></c>
<c>* Set the "[Stream]GevStreamMaxBlockDuration" parameter to 70% of the "grab_timeout" parameter.</c>
<c>* The "[Stream]GevStreamMaxBlockDuration" parameter defines the maximum transmission time for a data block in microseconds.</c>
<l>get_framegrabber_param (AcqHandle, 'grab_timeout', grabTimeout)</l>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxBlockDuration', 0.7*(grabTimeout*1000))</l>
<c></c>
<c>* Set the "DeviceScanType" parameter to "Areascan3D" to obtain the 3D data.</c>
<l>set_framegrabber_param (AcqHandle, 'DeviceScanType', 'Areascan3D')</l>
<c>* Obtain the available options of the "ComponentSelector" parameter.</c>
Expand Down
2 changes: 1 addition & 1 deletion profiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ This section describes the method for connecting to a specific laser profiler. T
* [trigger_with_software_and_fixed_rate_continuous](https://github.com/MechMindRobotics/mecheye_halcon_samples/tree/master/profiler/trigger_with_software_and_fixed_rate_continuous.hdev):
Trigger multiple rounds of data acquisition with the signals input from software, trigger line scans at a fixed rate, and then retrieve the acquired data.
* [trigger_with_external_device_and_fixed_rate_continuous](https://github.com/MechMindRobotics/mecheye_halcon_samples/tree/master/profiler/trigger_with_external_device_and_fixed_rate_continuous.hdev):
Trigger multiple rounds of data acquisition with signals input from the external device, trigger line scans at a fixed rate, and then retrieve the acquired data.
Trigger multiple rounds of data acquisition with signals input from the external device, trigger line scans at a fixed rate, and then retrieve the acquired data.
15 changes: 5 additions & 10 deletions profiler/trigger_with_external_device_and_encoder.hdev
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,18 @@
<c>* Set the "grab_timeout" parameter.</c>
<c>* The "grab_timeout" parameter defines the maximum time in milliseconds that the frame grabber will wait for an image to be grabbed before timing out.</c>
<l>set_framegrabber_param (AcqHandle, 'grab_timeout', 20000)</l>
<c>* Set the "[Stream]GevStreamMaxBlockDuration" parameter to 70% of the "grab_timeout" parameter.</c>
<c>* The "[Stream]GevStreamMaxBlockDuration" parameter defines the maximum transmission time for a data block in microseconds.</c>
<l>get_framegrabber_param (AcqHandle, 'grab_timeout', grabTimeout)</l>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxBlockDuration', 0.7*(grabTimeout*1000))</l>
<c>* Set the maximum number of packet gaps allowed in the GigE Vision stream. </c>
<c>* A packet gap occurs when one or more packets are missing during the data transmission. </c>
<c>* Setting this parameter to 500 allows a maximum of 500 packet gaps in the stream.</c>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxPacketGaps', 500)</l>
<c>* Set the "DeviceScanType" parameter to "Areascan" to obtain the raw image.</c>
<l>set_framegrabber_param (AcqHandle, 'DeviceScanType', 'Areascan')</l>
<c></c>
<c>* Set the "ExposureMode" parameter to "Timed" and the "ExposureTime" parameter to 80 μs.</c>
<l>set_framegrabber_param (AcqHandle, 'ExposureMode', 'Timed')</l>
<l>set_framegrabber_param (AcqHandle, 'ExposureTime', 80)</l>
<c>* Set the "ComponentSelector" parameter to "Intensity" and the "PixelFormat" parameter to "Mono8" to obtain the raw image. </c>
<l>set_framegrabber_param (AcqHandle, 'ComponentSelector', 'Intensity')</l>
<l>set_framegrabber_param (AcqHandle, 'PixelFormat', 'Mono8')</l>
<c></c>
<c>* Obtain the raw image from the laser profiler.</c>
<l>grab_image (RawImage, AcqHandle)</l>
<c>* Save the raw image to the "RawImage" BMP file.</c>
<l>write_image( RawImage , 'bmp' , 0 , 'RawImage' )</l>
<c></c>
<c>* Set the "DeviceScanType" parameter to "Linescan3D" to obtain the profile data.</c>
<c>* If the laser profiler has not fully completed the data acquisition, the "DeviceScanType" parameter may be locked.</c>
Expand Down
15 changes: 5 additions & 10 deletions profiler/trigger_with_external_device_and_fixed_rate.hdev
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,18 @@
<c>* Set the "grab_timeout" parameter.</c>
<c>* The "grab_timeout" parameter defines the maximum time in milliseconds that the frame grabber will wait for an image to be grabbed before timing out.</c>
<l>set_framegrabber_param (AcqHandle, 'grab_timeout', 20000)</l>
<c>* Set the "[Stream]GevStreamMaxBlockDuration" parameter to 70% of the "grab_timeout" parameter.</c>
<c>* The "[Stream]GevStreamMaxBlockDuration" parameter defines the maximum transmission time for a data block in microseconds.</c>
<l>get_framegrabber_param (AcqHandle, 'grab_timeout', grabTimeout)</l>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxBlockDuration', 0.7*(grabTimeout*1000))</l>
<c>* Set the maximum number of packet gaps allowed in the GigE Vision stream. </c>
<c>* A packet gap occurs when one or more packets are missing during the data transmission. </c>
<c>* Setting this parameter to 500 allows a maximum of 500 packet gaps in the stream.</c>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxPacketGaps', 500)</l>
<c>* Set the "DeviceScanType" parameter to "Areascan" to obtain the raw image.</c>
<l>set_framegrabber_param (AcqHandle, 'DeviceScanType', 'Areascan')</l>
<c></c>
<c>* Set the "ExposureMode" parameter to "Timed" and the "ExposureTime" parameter to 80 μs.</c>
<l>set_framegrabber_param (AcqHandle, 'ExposureMode', 'Timed')</l>
<l>set_framegrabber_param (AcqHandle, 'ExposureTime', 80)</l>
<c>* Set the "ComponentSelector" parameter to "Intensity" and the "PixelFormat" parameter to "Mono8" to obtain the raw image. </c>
<l>set_framegrabber_param (AcqHandle, 'ComponentSelector', 'Intensity')</l>
<l>set_framegrabber_param (AcqHandle, 'PixelFormat', 'Mono8')</l>
<c></c>
<c>* Obtain the raw image from the laser profiler.</c>
<l>grab_image (RawImage, AcqHandle)</l>
<c>* Save the raw image to the "RawImage" BMP file.</c>
<l>write_image( RawImage , 'bmp' , 0 , 'RawImage' )</l>
<c></c>
<c>* Set the "DeviceScanType" parameter to "Linescan3D" to obtain the profile data.</c>
<c>* If the laser profiler has not fully completed the data acquisition, the "DeviceScanType" parameter may be locked.</c>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,18 @@
<c>* Set the "grab_timeout" parameter.</c>
<c>* The "grab_timeout" parameter defines the maximum time in milliseconds that the frame grabber will wait for an image to be grabbed before timing out.</c>
<l>set_framegrabber_param (AcqHandle, 'grab_timeout', 60000)</l>
<c>* Set the "[Stream]GevStreamMaxBlockDuration" parameter to 70% of the "grab_timeout" parameter.</c>
<c>* The "[Stream]GevStreamMaxBlockDuration" parameter defines the maximum transmission time for a data block in microseconds.</c>
<l>get_framegrabber_param (AcqHandle, 'grab_timeout', grabTimeout)</l>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxBlockDuration', 0.7*(grabTimeout*1000))</l>
<c>* Set the maximum number of packet gaps allowed in the GigE Vision stream. </c>
<c>* A packet gap occurs when one or more packets are missing during the data transmission. </c>
<c>* Setting this parameter to 500 allows a maximum of 500 packet gaps in the stream.</c>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxPacketGaps', 500)</l>
<c>* Set the "DeviceScanType" parameter to "Areascan" to obtain the raw image.</c>
<l>set_framegrabber_param (AcqHandle, 'DeviceScanType', 'Areascan')</l>
<c></c>
<c>* Set the "ExposureMode" parameter to "Timed" and the "ExposureTime" parameter to 80 μs.</c>
<l>set_framegrabber_param (AcqHandle, 'ExposureMode', 'Timed')</l>
<l>set_framegrabber_param (AcqHandle, 'ExposureTime', 80)</l>
<c>* Set the "ComponentSelector" parameter to "Intensity" and the "PixelFormat" parameter to "Mono8" to obtain the raw image.</c>
<l>set_framegrabber_param (AcqHandle, 'ComponentSelector', 'Intensity')</l>
<l>set_framegrabber_param (AcqHandle, 'PixelFormat', 'Mono8')</l>
<c>* Obtain the raw image from the laser profiler.</c>
<l>grab_image (RawImage, AcqHandle)</l>
<c>* Save the raw image to the "RawImage" BMP file.</c>
<l>write_image( RawImage , 'bmp' , 0 , 'RawImage' )</l>
<c></c>
<c>* Set the "DeviceScanType" parameter to "Linescan3D" to obtain the profile data.</c>
<c>* If the laser profiler has not fully completed the data acquisition, the "DeviceScanType" parameter may be locked.</c>
Expand Down
17 changes: 7 additions & 10 deletions profiler/trigger_with_software_and_encoder.hdev
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,18 @@
<c>* Set the "grab_timeout" parameter.</c>
<c>* The "grab_timeout" parameter defines the maximum time in milliseconds that the frame grabber will wait for an image to be grabbed before timing out.</c>
<l>set_framegrabber_param (AcqHandle, 'grab_timeout', 20000)</l>
<c>* Set the "[Stream]GevStreamMaxBlockDuration" parameter to 70% of the "grab_timeout" parameter.</c>
<c>* The "[Stream]GevStreamMaxBlockDuration" parameter defines the maximum transmission time for a data block in microseconds.</c>
<l>get_framegrabber_param (AcqHandle, 'grab_timeout', grabTimeout)</l>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxBlockDuration', 0.7*(grabTimeout*1000))</l>
<c>* Set the maximum number of packet gaps allowed in the GigE Vision stream. </c>
<c>* A packet gap occurs when one or more packets are missing during the data transmission. </c>
<c>* Setting this parameter to 500 allows a maximum of 500 packet gaps in the stream.</c>
<l>set_framegrabber_param (AcqHandle, '[Stream]GevStreamMaxPacketGaps', 500)</l>
<c>* Set the "DeviceScanType" parameter to "Areascan" to obtain the raw image.</c>
<l>set_framegrabber_param (AcqHandle, 'DeviceScanType', 'Areascan')</l>
<c></c>
<c>* Set the "ExposureMode" parameter to "Timed" and the "ExposureTime" parameter to 80 μs.</c>
<l>set_framegrabber_param (AcqHandle, 'ExposureMode', 'Timed')</l>
<l>set_framegrabber_param (AcqHandle, 'ExposureTime', 80)</l>
<c>* Set the "ComponentSelector" parameter to "Intensity" and the "PixelFormat" parameter to "Mono8" to obtain the raw image. </c>
<l>set_framegrabber_param (AcqHandle, 'ComponentSelector', 'Intensity')</l>
<l>set_framegrabber_param (AcqHandle, 'PixelFormat', 'Mono8')</l>
<c></c>
<c>* Obtain the raw image from the laser profiler.</c>
<l>grab_image (RawImage, AcqHandle)</l>
<c>* Save the raw image to the "RawImage" BMP file.</c>
<l>write_image( RawImage , 'bmp' , 0 , 'RawImage' )</l>
<c></c>
<c>* Set the "DeviceScanType" parameter to "Linescan3D" to obtain the profile data.</c>
<c>* If the laser profiler has not fully completed the data acquisition, the "DeviceScanType" parameter may be locked.</c>
Expand All @@ -75,6 +70,8 @@
<c>* Set the "DataAcquisitionTriggerSource" parameter to "Software", so that data acquisition is triggered by the software.</c>
<c>* For Mech-Eye LNX-8080A: Comment out the following line.</c>
<l>set_framegrabber_param (AcqHandle, 'DataAcquisitionTriggerSource', 'Software')</l>
<c>* Set the "AcquisitionMode" to "SingleFrame", so that the laser profiler performs a single round of data acquisition.</c>
<l>set_framegrabber_param (AcqHandle, 'AcquisitionMode', 'SingleFrame')</l>
<c>* Set the "TriggerMode" parameter to "Off".</c>
<c>* The "TriggerMode" parameter controls if the selected trigger is active. </c>
<l>set_framegrabber_param (AcqHandle, 'TriggerMode', 'Off') </l>
Expand Down
Loading