This repository contains the ROS 1 interface for Mech-Eye Industrial 3D Camera.
- On Ubuntu 18.04: use with ROS Melodic
- On Ubuntu 20.04: use with ROS Noetic
| Package | Version |
|---|---|
| OpenCV | >= 3 |
| PCL | >= 1.8 |
| Eigen | 3.3.0 |
| VTK | 6.3.0 |
| Mech-Eye API | latest |
Download Mech-Eye API from Mech-Mind's website and install it with sudo apt.
Clone and compile the interface with the following commands:
mkdir -p ~/catkin_ws/src && cd ~/catkin_ws/src
git clone https://github.com/MechMindRobotics/mecheye_ros_interface
cd ~/catkin_ws
catkin_make-
Source the build workspace and launch the interface:
source ~/catkin_ws/devel/setup.bash roslaunch mecheye_ros_interface start_camera.launch
-
Enter the index number of the camera to which you want to connect, and press the Enter key.
-
Open a new terminal, source the workspace and invoke a service:
source ~/catkin_ws/devel/setup.bash rosservice call [/service] [arguments]
Note: For code examples of each service, check the "Services" section below.
-
Interface functions are described in the online documentation Mech-Eye API Reference.
-
Change the following configurations in
~/catkin_ws/src/mecheye_ros_interface/launch/start_camera.launchaccording to your needs:save_file: To enable file saving to the designated path, change the default value totrue.Note: You can change the paths for file saving in
/mecheye_ros_interface/src/MechMindCamera.cpp.camera_ip: Change the default value to the IP address of your camera.Note: To connect to a camera by its IP address, you also need to edit
MechMindCamera.cpp. Uncomment lines 79 to 90, and comment lines 74 to 75 and lines 92 to 94.
Note: Remember to run
catkin_makeagain after making changes tostart_camera.launchand*.cpp.
Camera calibration and metadata.
Color image encoded as "bgr8."
Depth image encoded as 32-bit float.
Point cloud data.
Textured point cloud data.
Invoke this service to add a parameter group. The newly added parameter group is automatically selected as the current parameter group.
This service has one parameter:
value(string): the name of the parameter group to be added.
Example: add a parameter group named "123"
rosservice call /add_user_set '!!str 123' # For parameter group names that consist of numbers only, add "!!str" before the name.Invoke this service to obtain a 2D image.
Example:
rosservice call /capture_color_mapInvoke this service to obtain a textured point cloud.
Example:
rosservice call /capture_color_point_cloudInvoke this service to obtain a depth map.
Example:
rosservice call /capture_depth_mapInvoke this service to obtain an untextured point cloud.
Example:
rosservice call /capture_point_cloudInvoke this service to delete the specified parameter group.
This service has one parameter:
value(string): the name of the parameter group to be deleted.
Example: delete the parameter group named "123"
rosservice call /delete_user_set '!!str 123' # For parameter group names that consist of numbers only, add "!!str" before the name.Invoke this service to print the following information of the currently connected camera:
- Model
- Serial number (ID)
- Hardware version
- Firmware version
- IP address
- Port
Example:
rosservice call /device_infoInvoke this service to obtain the current ExpectedGrayValue value.
Example:
rosservice call /get_2d_expected_gray_valueInvoke this service to obtain the current Scan2DExposureMode value.
Example:
rosservice call /get_2d_exposure_modeInvoke this service to obtain the current HDRExposureSequence value.
Example:
rosservice call /get_2d_exposure_sequenceInvoke this service to obtain the current 2D ExposureTime value.
Example:
rosservice call /get_2d_exposure_timeInvoke this service to obtain the current Scan2DROI values.
Example:
rosservice call /get_2d_roiInvoke this service to obtain the current SharpenFactor value.
Example:
rosservice call /get_2d_sharpen_factorInvoke this service to obtain the current ToneMappingEnable value.
Example:
rosservice call /get_2d_tone_mappingInvoke this service to get the current 3D ExposureSequence values.
Example:
rosservice call /get_3d_exposureInvoke this service to obtain the current Gain value.
Example:
rosservice call /get_3d_gainInvoke this service to obtain the current Scan3DROI values.
Example:
rosservice call /get_3d_roiInvoke this service to obtain the names of all available parameter groups.
Example:
rosservice call /get_all_user_setsInvoke this service to get the current CloudOutlierFilterMode value.
Example:
rosservice call /get_cloud_outlier_filter_modeInvoke this service to get the current CloudSmoothMode value.
Example:
rosservice call /get_cloud_smooth_modeInvoke this service to obtain the name of the currently selected parameter group.
Example:
rosservice call /get_current_user_setInvoke this service to obtain the current DepthRange value.
Example:
rosservice call /get_depth_rangeInvoke this service to obtain the current FringeContrastThreshold value.
Example:
rosservice call /get_fringe_contrast_thresholdInvoke this service to obtain the current FringeMinThreshold value.
Example:
rosservice call /get_fringe_min_thresholdInvoke this service to obtain the current laser camera settings.
Note: This service is only available for a laser camera.
Example:
rosservice call /get_laser_settingsInvoke this service to obtain the current AntiFlickerMode value.
Note: This service is only available for PRO (V4), PRO M (V4), NANO (V4), and Nano (V3).
Example:
rosservice call /get_projector_antiflickermodeInvoke this service to obtain the current FringeCodingMode value.
Note: This service is only available for PRO S (V4), PRO M (V4), Nano (V3), and Pro XS (V3).
Example:
rosservice call /get_projector_fringecodingmodeInvoke this service to obtain the current powerLevel value.
Note: This service is only available for DLP cameras, excluding Deep (V3) and Pro L Enhanced (V3).
Example:
rosservice call /get_projector_powerlevelInvoke this service to obtain the current UHP camera settings.
Note: This service is only available for the UHP series.
Example:
rosservice call /get_uhp_settingsInvoke this service to obtain the current UhpCaptureMode value.
Note: This service is only available for the UHP series.
Example:
rosservice call /get_uhp_capture_modeInvoke this service to obtain the current UhpFringeCodingMode value.
Note: This service is only available for the UHP series.
Example:
rosservice call /get_uhp_fringe_coding_modeInvoke this service to set the value of ExpectedGrayValue value.
Note:
ExpectedGrayValueonly takes effect whenScan2DExposureModeis set toAuto.
This service has one parameter:
value(int32): theExpectedGrayValuevalue to be set. The value range is 0–255.
Example: set the value of ExpectedGrayValue to 20
rosservice call /set_2d_expected_gray_value 20Invoke this service to set the value of Scan2DExposureMode.
This service has one parameter:
value(string): theScan2DExposureModevalue to be set. Values include "Timed", "Auto", "HDR", and "Flash".
Example: set the value of Scan2DExposureMode to "HDR"
rosservice call /set_2d_exposure_mode 'HDR'Invoke this service to set the value of HDRExposureSequence.
Note:
HDRExposureSequenceonly takes effect whenScan2DExposureModeis set toHDR.
This service has one parameter:
sequence(float64[]): theHDRExposureSequencevalues to be set.- Value range: 0.1–999.0
- Number of elements in the sequence: 1–5
Example: set the values of HDRExposureSequence to 30.0, 35.5, and 40.0
rosservice call /set_2d_exposure_sequence [30.0,35.5,40.0]# Do not put spaces between elements in the sequence. Otherwise the element after a space will be passed as a string.Invoke this service to set the value of 2D ExposureTime.
Note: 2D
ExposureTimeonly takes effect whenScan2DExposureModeis set toTimed.
This service has one parameter:
value(float64): the 2DExposureTimevalue to be set. The value range is 0.1–999.0.
Example: set the values of 2D ExposureTime to 35.5
rosservice call /set_2d_exposure_time 35.5Invoke this service to obtain the values of Scan2DROI.
Note:
Scan2DROIonly takes effect whenScan2DExposureModeis set toAuto.
This service has four parameters:
x(uint32): the x coordinate of the upper-left corner of the auto-exposure ROI.y(uint32): the y coordinate of the upper-left corner of the auto-exposure ROI.width(uint32): the width of the auto-exposure ROI.height(uint32): the height of the auto-exposure ROI.
Example: set the values of 2D Scan2DROI to 20, 20 , 600, and 800
rosservice call /set_2d_roi 20 20 600 800Invoke this service to set the value of SharpenFactor.
This service has one parameter:
value(float64): theSharpenFactorvalue to be set. The value range is 0.0–5.0.
Example: set the value of SharpenFactor to 0.5
rosservice call /set_2d_sharpen_factor 0.5Invoke this service to set the value of ToneMappingEnable.
This service has one parameter:
value(bool): theToneMappingEnablevalue to be set.
Example: set the value of ToneMappingEnable to True
rosservice call /set_2d_tone_mapping TrueInvoke this service to set the value of 3D ExposureSequence.
This service has one parameter:
sequence(float64[]): the 3DExposureSequencevalues to be set.- Value range: 0.1–99.0
- Number of elements in the sequence: 1–3
Example: set the values of 3D ExposureSequence to 30.0, 35.5, and 40.0
rosservice call /set_3d_exposure [30.0,35.5,40.0]# Do not put spaces between elements in the sequence. Otherwise the element after a space will be passed as a string.Invoke this service to set the value of Gain.
This service has one parameter:
value(float64): theGainvalue to be set. The value range is 0.0–16.0.
Example: set the value of Gain to 2.5
rosservice call /set_3d_gain 2.5Invoke this service to set the value of Scan3DROI.
This service has four parameters:
x(uint32): the x coordinate of the upper-left corner of the ROI.y(uint32): the y coordinate of the upper-left corner of the ROI.width(uint32): the width of the ROI.height(uint32): the height of the ROI.
Example: set the values of Scan3DROI to 20, 20, 600, and 800
rosservice call /set_3d_roi 20 20 600 800Invoke this service to set the value of CloudOutlierFilterMode.
This service has one parameter:
value(string): theCloudOutlierFilterModevalue to be set. Values include "Off", "Weak", and "Normal".
Example: set the value of CloudOutlierFilterMode to "Off"
rosservice call /set_cloud_outlier_filter_mode '!!str Off' # The value "Off" must be input as '!!str Off'.Invoke this service to set the value of CloudSmoothMode.
This service has one parameter:
value(string): theCloudSmoothModevalue to be set. Values include "Off", "Weak", "Normal" and "Strong".
Example: set the value of CloudSmoothMode to "Off "
rosservice call /set_cloud_smooth_mode '!!str Off' # The value "Off" must be input as '!!str Off'.Invoke this service to select the parameter group to use.
This service has one parameter:
value(string): the name of the parameter group to be selected. The "default" and "calib" parameter groups are built-in.
Example: select the "123" parameter group
rosservice call /set_current_user_set '!!str 123' # For parameter group names that consist of numbers only, add "!!str" before the name.Invoke this service to set the value of DepthRange.
This service has two parameters:
lower(int32): The lower limit of the depth range. The value range is 1–4000.upper(int32): The upper limit of the depth range. The value range is 2-5000 (must be greater than the value oflower).
Example: set the values of DepthRange to 300 and 1000
rosservice call /set_depth_range 300 1000Invoke this service to set the value of FringeContrastThreshold.
This service has one parameter:
value(int32): theFringeContrastThresholdvalue to be set. The value range is 1-100.
Example: set the values of FringeContrastThreshold to 3
rosservice call /set_fringe_contrast_threshold 3Invoke this service to set the value of FringeMinThreshold.
This service has one parameter:
value(int32): theFringeMinThresholdvalue to be set. The value range is 1-100.
Example: set the values of FringeMinThreshold to 3
rosservice call /set_fringe_min_threshold 3Invoke this service to set the laser camera settings.
Note: This service is only available for a laser camera.
This service has five parameters:
fringeCodingMode(string): theLaserFringeCodingModevalue to be set. Values include "Fast" and "Accurate".frameRangeStart(int32): theframeRangeStartvalue to be set. The value range is 0-100.frameRangeEnd(int32): theframeRangeEndvalue to be set. The value range is 0-100 (also must satisfy:frameRangeEnd-frameRangeStart>= 25).framePartitionCount(int32): theframePartitionCountvalue to be set. The value range is 1-4.powerLevel(int32): thepowerLevelvalue to be set. The value range is 20-100.
Example: set the values of the laser camera settings to "Fast", 20, 80, 2, and 60.
rosservice call /set_laser_settings 'Fast' 20 80 2 60Invoke this service to set the value of AntiFlickerMode.
Note: This service is only available for PRO (V4), PRO M (V4), NANO (V4), and Nano (V3).
This service has one parameter:
value(string): theAntiFlickerModevalue to be set. Values include "Off", "AC50Hz", and "AC60Hz".
Example: set the value of AntiFlickerMode to "Off"
rosservice call /set_projector_antiflickermode '!!str Off'# The value "Off" must be input as '!!str Off'.Invoke this service to set the value of FringeCodingMode.
Note: This service is only available for PRO S (V4), PRO M (V4), Nano (V3), and Pro XS (V3).
This service has one parameter:
value(string): theFringeCodingModevalue to be set. Values include "Fast" and "Accurate".
Example: set the value of FringeCodingMode to "Accurate"
rosservice call /set_projector_fringecodingmode 'Accurate'Invoke this service to obtain the current powerLevel value.
Note: This service is only available for DLP cameras, excluding Deep (V3) and Pro L Enhanced (V3).
This service has one parameter:
value(string): thepowerLevelvalue to be set. Values include "Low", "Normal", and "High".
Example: set the value of powerLevel to "High"
rosservice call /set_projector_powerlevel 'High'Invoke this service to set the UHP camera settings.
This service has two parameters:
capture_mode(string): theUhpCaptureModevalue to be set. Values include "Camera1", "Camera2", and "Merge".fringe_coding_mode(string): theUhpFringeCodingModevalue to be set. Values include "Fast" and "Accurate".
Example: set the UHP camera settings to "Merge" and "Accurage"
rosservice call /set_uhp_settings 'Merge' 'Accurate'Invoke this service to set the value of UhpCaptureMode.
This service has one parameter:
capture_mode(string): theUhpCaptureModevalue to be set. Values include "Camera1", "Camera2", and "Merge".
Example: set the value of UhpCaptureMode to "Merge"
rosservice call /set_uhp_capture_mode 'Merge'Invoke this service to set the value of UhpFringeCodingMode.
This service has one parameter:
fringe_coding_mode(string): theUhpFringeCodingModevalue to be set. Values include "Fast" and "Accurate".
Example: set the value of UhpFringeCodingMode to "Accurate"
rosservice call /set_uhp_fringe_coding_mode 'Accurate'