Skip to content

MechMindRobotics/mecheye_ros_interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mech-Eye ROS Interface

This repository contains the official ROS interface for Mech-Eye camera.

Installation

Dependencies

Package Version
OpenCV >= 3
PCL >= 1.8
Eigen 3.3.0
VTK 6.3.0
Mech-Eye SDK 1.6.0

ROS

This API supports Ubuntu 18.04 with ROS Melodic, and Ubuntu 20.04 with ROS Noetic.

Install Mech-Eye SDK

Download and install MechEyeApi_1.6.0 compatible with Ubuntu from this link.

Install the Interace

  • Download this ROS interface

    mkdir -p ~/catkin_ws/src && cd ~/catkin_ws/src
    git clone https://github.com/MechMindRobotics/mecheye_ros_interface
    cd ~/catkin_ws
    catkin_make

Brief intro to the interface

  • Interface functions can be found in the documentation inside Mech-Eye SDK.

  • Change config in ~/catkin_ws/src/mecheye_ros_interface/launch/start_camera.launch

    • save_file: true to enable save file to '/tmp/xxx', otherwise keep it as false
    • camera_ip: change to your camera ip address here (also remember to comment and uncomment the lines in MechMindCamera.cpp to connect to a specific camera)
    • tf related arguments: using quaternion for rotation parameters, to be changed to your calibrated parameters.
    • at the moment, image save path can only be changed in source code /mecheye_ros_interface/src/MechMindCamera.cpp.
    • remember to catkin_make again after changing *.cpp.
  • Source the build workspace and use roslaunch

    source ~/catkin_ws/devel/setup.bash
    roslaunch mecheye_ros_interface start_camera.launch 

    Select a camera in LAN. Then, the camera will start working.

  • Open a new terminal, source the workspace and call services

    source ~/catkin_ws/devel/setup.bash
    rosservice call [/service] [arguments]
    # Example
    rosservice call /set_cloud_outlier_filter_mode '!!str Off'   # for 'Off', it is necessary to input '!!str' before it.
    rosservice call /set_laser_settings 'Fast' 0 50 1 20
    rosservice call /set_3d_exposure [3.2,4.0]   # Do not input ' ' before the second arg, or it will be passed by string.
    rosservice call /add_user_set '!!str 123'
    rosservice call /delete_user_set 'test'

Topics

/mechmind/camera_info

Camera calibration and metadata.

/mechmind/color_image

Color image encoded as "bgr8".

/mechmind/depth_image

Depth image encoded as 32-bit float.

/mechmind/point_cloud

Point cloud data.

/mechmind/color_point_cloud

Color point cloud data.

Services

Invoke this service to add a user set.

This service has one parameter:

value (string): User set name to add.

Invoke this service to capture color map once.

Invoke this service to capture color point cloud once.

Invoke this service to capture color depth map once.

Invoke this service to capture point cloud once.

Invoke this service to delete a specified user set.

This service has one parameter:

value (string): User set name to delete.

Invoke this service to get the current connected device information.

Invoke this service to get the expected image gray value.
Only take effect when 2D exposure mode is Auto.
A smaller value can decrease the brightness of the image, while a larger value can generate a brighter image.

Invoke this service to get current 2D exposure mode.

Invoke this service to get current 2D HDR exposure sequence.
Only take effect when 2D exposure mode is HDR.

Invoke this service to get current 2D exposure time.
Only take effect when 2D exposure mode is Timed.

Invoke this service to get current ROI when scanning 2D images.
Only take effect when 2D exposure mode is Auto or HDR.

Invoke this service to get current image sharpen factor.

Invoke this service to get whether or not is tone mapping enabled.
Tone mapping uses gray level transformation algorithm to make the image look more natural.

Invoke this service to get current 3D exposure sequence.

Invoke this service to get current camera's gain value during scanning 3D images.
Gain is an electronic amplification of the image signal. Large gain value is needed only when scanning extremely dark objects.

Invoke this service to get current depth map's ROI.

Invoke this service to get all available user sets.

Invoke this service to get current cloud outler filter mode.

Invoke this service to get current cloud smooth filter mode.

Invoke this service to get the current user set name.

Invoke this service to get the current depth image's valid range along Z-axis in the camera coordinate system.

Invoke this service to get the current signal contrast threshold for effective pixels. Pixels with contrast less than this threshold will be ignored.

Invoke this service to get the current signal minimum threshold for effective pixels. Pixels with intensity less than this threshold will be ignored.

Invoke this service to get the current laser settings.

Invoke this service to get the current uhp settings.

Invoke this service to get the current uhp capture mode.

Invoke this service to get the current uhp fringe coding mode.

Invoke this service to set the expected image gray value.
Only take effect when 2D exposure mode is Auto.
A smaller value can decrease the brightness of the image, while a larger value can generate a brighter image.

This service has one parameter:

value (int32): Expected image gray value to set. Min:0, Max: 255.

Invoke this service to set current 2D exposure mode.

This service has one parameter:

value (string): 2D exposure mode to set. Options include 'Timed', 'Auto', 'HDR', and 'Flash'.

Invoke this service to set current 2D HDR exposure sequence.
Only take effect when 2D exposure mode is HDR.

This service has one parameter:

sequence (float64[]): 2D exposure sequence to set. Min: 0.1, Max: 999. Min Size: 1, Max Size: 5.

Invoke this service to set current 2D exposure time.
Only take effect when 2D exposure mode is Timed.

This service has one parameter:

value (float64): 2D exposure time to set. Min: 0.1, Max: 999.

Invoke this service to set current ROI when scanning 2D images.
Only take effect when 2D exposure mode is Auto or HDR.

This service has four parameters:

x (uint32): The column coordinates of the upper left point of the region of interest.
y (uint32): The row coordinates of the upper left point of the region of interest.
width (uint32): The width of the region of interest.
height (uint32): The height of the region of interest.

Invoke this service to set current image sharpen factor.

This service has one parameter:

value (float64): The sharpen factor to set. Min: 0, Max: 5.

Invoke this service to set whether or not is tone mapping enabled.
Tone mapping uses gray level transformation algorithm to make the image look more natural.

This service has one parameter:

value (bool): Whether or not to enable tone mapping.

Invoke this service to set current 3D exposure sequence.

This service has one parameter:

sequence (float64[]): Exposure sequence to set. Min: 0.1, Max: 99. Min Size: 1, Max Size: 3.

Invoke this service to set current camera's gain value during scanning 3D images.
Gain is an electronic amplification of the image signal. Large gain value is needed only when scanning extremely dark objects.

This service has one parameter:

value (float64): Gain value to set. Min: 0, Max: 16.

Invoke this service to set current depth map's ROI.

This service has four parameters:

x (uint32): The column coordinates of the upper left point of the region of interest.
y (uint32): The row coordinates of the upper left point of the region of interest.
width (uint32): The width of the region of interest.
height (uint32): The height of the region of interest.

Invoke this service to set current cloud outler filter mode.

This service has one parameter:

value (string): Cloud outlier filter mode to set. Options include '!!str Off', 'Normal', and 'Weak'.

Invoke this service to set current cloud smooth filter mode.

This service has one parameter:

value (string): Cloud smooth mode to set. Options include '!!str Off', 'Normal', 'Weak', and 'Strong'.

Invoke this service to set the current user set name.

This service has one parameter:

value (string): User set name to set.

Invoke this service to set the current depth image's valid range along Z-axis in the camera coordinate system.

This service has two parameters:

lower (int32): The lower limit of the roi on the z value of the depth map in the camera coordinate system.
upper (int32): The upper limit of the roi on the z value of the depth map in the camera coordinate system.

Invoke this service to set the current signal contrast threshold for effective pixels. Pixels with contrast less than this threshold will be ignored.

This service has one parameter:

value (int32): Signal contrast threshold to set. Min: 1, Max: 100.

Invoke this service to set the current signal minimum threshold for effective pixels. Pixels with intensity less than this threshold will be ignored.

This service has one parameter:

value (int32): Signal minimum threshold to set. Min: 1, Max: 100.

Invoke this service to set the current laser settings.

This service has five parameters:

fringeCodingMode (string): Laser fringe coding mode to set. Options include 'Fast', and 'Accurate'.
frameRangeStart (int32): The laser scan field of view start position to set. Min: 0, Max: 100.
frameRangeEnd - frameRangeStart >= 25
frameRangeEnd (int32): The laser scan field of view end position to set. Min: 0, Max: 100.
frameRangeEnd - frameRangeStart >= 25
framePartitionCount (int32): Laser's scan partition number to set. Min: 1, Max: 4.
powerLevel (int32): Laser's power level to set. Min: 20, Max: 100.

Invoke this service to set the current uhp settings.

This service has two parameters:

capture_mode (string): Uhp capture mode to set. Options include 'Camera1', 'Camera2' and 'Merge'.
fringe_coding_mode (string): Uhp fringe coding mode to set. Options include 'Fast', and 'Accurate'.

Invoke this service to set the current uhp capture mode.

This service has one parameter:

capture_mode (string): Uhp capture mode to set. Options include 'Camera1', 'Camera2' and 'Merge'.

Invoke this service to set the current uhp fringe coding mode.

This service has one parameter:

fringe_coding_mode (string): Uhp fringe coding mode to set. Options include 'Fast', and 'Accurate'.