This omronsentech_camera package is provided by OMRON SENTECH, CO.,LTD. Any cameras supported by Linux-based SentechSDK are also supported by this package. This package provides generic access to the camera's GenICam GenApi nodes and functions through SentechSDK's transport layer module. Note that GenICam GenApi node is a different thing from the term node in ROS. Each GenICam GenApi node corresponds to the camera device's feature or register that can be accessed through a generic interface. The detail of the GenICam GenApi can be found in the GenICam GenApi documentation.
This package has been tested on ROS-Kinetic (Ubuntu 16.04 64bit) and ROS-Melodic (Ubuntu 18.04 64bit). Since this package basically wraps SentechSDK's transport layer module, SentechSDK must be installed prior to the installation of this package. The SentechSDK (USB3Vision and GigEVision) can be downloaded from the following URL: https://sentech.co.jp/products/USB/software.html.
Below are the list of ROS packages needed to build the package:
For installation, either clone the omronsentech_camera.git or copy the content of this repository to your catkin workspace. Before building the package as a common ROS package using catkin_make, please ensure that the SentechSDK environment variable has been exported:
$ echo $STAPI_ROOT_PATH
In case that the environment variables has not been exported, if the SentechSDK installation folder is in /opt/sentech, you can export the environment variables used by SentechSDK by executing:
$ source /opt/sentech/.stprofile
The structure of the directory inside the omronsentech_camera is as follows:
/ |-./README.md |-./README-ja.md |-./CMakeLists.txt |-./nodelet_plugins.xml |-./package.xml |-./rosdoc.yaml |-./doc/ | |-./html/ | |-./manifest.yaml | |-./examples/ | |-./cpp/grabber.cpp | |-./python/grabber.py | |-./include/ | |-./omronsentech_camera/*.h | |-./launch/ | |-./*.launch | |-./*.yaml | |-./msg/ | |-./*.msg | |-./src/ | |-./omronsentech_camera/*.cpp | |-./srv/ |-./*.srv
To generate the documentation in the doc folder, execute the following command in the folder omronsentech_camera:
$ rosdoc_lite -o doc
Please note that doxygen and rosdoc_lite package are required to build the documentation.
For easy usage, the stcamera_node provided in the package will automatically connect to either the first found camera, predefined camera, or any camera that it can find (depend on the camera_to_connect parameter) and continuously acquire images from the camera.
To run the stcamera_node, execute one of the following command:
$ rosrun omronsentech_camera stcamera_node
or
$ roslaunch omronsentech_camera stcamera_node.launch
If the node is run through stcamera_node.launch script, you can easily configure the parameters in stcamera_node.yaml to control which camera to connect. See the next section for the detail of parameter configuration.
Parameters value are case sensitive. There are only three parameters to configure, as follows:
camera_to_connect:[]
: Connect to first found camera.camera_to_connect:["all"]
: Connect to all camera. If the keyword 'all' presents, the nodes will attempt to connect to any found camera.camera_to_connect:["00:11:1c:f6:yy:xx","STC-MCS510U3V(00XXYY0)"]
: Connect only to GigEVision camera with MAC address 00:11:1c:f6:yy:xx and USB3Vision camera with model STC-MCS510U3V and serial number 00XXYY0.camera_to_connect:["14210003XXYY"]
: Connect only to USB3Vision camera with ID 14210003XXYY.Once stcamera_node is connected to a camera, it will advertise topics and services correspond to the camera. To differentiate between the connected camera, each camera has its own namespace *{dev_CAMERA-NS}*. The namespace *{dev_CAMERA-NS}* is automatically generated by stcamera_node with the following rules:
The namespace *{dev_CAMERA-NS}* can also be retrieved from the value of device_namespace field returned by service call get_device_list or message from device_connection topic.
The topics published by the stcamera_node are as follows:
No. | Topics | Description |
---|---|---|
1 | device_connection | Published when connection or disconnection happened. |
2 | *{dev_CAMERA-NS}*/**camera_info** | Based on the ROS image_transport. |
3 | *{dev_CAMERA-NS}*/**chunk** | Published when chunk data is acquired. |
4 | *{dev_CAMERA-NS}*/**event** | Published when camera event is registered and event data corresponds to the registered event is acquired. |
5 | *{dev_CAMERA-NS}*/**image_raw*** | Published when image data is acquired, based on the ROS image_transport. |
The services advertised by the stcamera_node are as follows:
*(Please be aware that the GenICam node mentioned below is a completely different thing from the ROS node)*:
Attention:
$ rosservice call /stcamera_node/dev_CAMERA-NS/enable_image_acquisition false
$ rosservice call /stcamera_node/dev_CAMERA-NS/get_genicam_node_info RemoteDevice Width
name: "Width" description: "Width of the image provided by the device (in pixels)." name_space: "Standard" interface_type: "IInteger" access_mode: "Read Only" is_cachable: "Yes" visibility: "Beginner" caching_mode: "Write to register, write to cache on read" is_streamable: True enum_value_str_list: [] enum_value_int_list: [] current_value: "2448" min_value: "64" max_value: "2448" increment: "16" unit: '' child_node_list: []
Codes | Description |
---|---|
< 0 | GenTL error codes. Please refer to GenICam GenTL documentation. |
0 | No error. |
30000 | GenICam GenericException occurred. |
30001 | Module name is invalid. |
30002 | (GenICam) Node is either invalid or inaccessible. |
30003 | Event already ON. |
30004 | Event already OFF. |
30005 | Image acquisition already ON. |
30006 | Image acquisition already OFF. |
30007 | Chunk is not supported. |
30008 | Chunk name is not valid. |
30009 | Trigger is not supported. |
30010 | Trigger name is not valid. |
30011 | Event is not supported. |
30012 | Event name is not valid. |
For a simple viewing and operation, you can refer to the following steps:
$ roslaunch omronsentech_camera stcamera_node.launch
$ rosservice call /stcamera_node/get_device_list
device_list:
Run the image_view:
$ rosrun image_view image_view image:=/stcamera_node/dev_14210XXYYYZZ/image_raw
where dev_14210XXYYYZZ is the namespace of the connected camera.
To change the gain of the camera (IFloat type) to 100.0, for example, use the GenICam write node service as follows:
$ rosservice call /stcamera_node/dev_14210XXYYYZZ/write_node_float RemoteDevice Gain 100.0
or
$ rosservice call /stcamera_node/dev_14210XXYYYZZ/write_node RemoteDevice Gain "'100.0'"
To read the current gain value, you can use the GenICam read node service as follows:
$ rosservice call /stcamera_node/dev_14210XXYYYZZ/read_node_float RemoteDevice
or
$ rosservice call /stcamera_node/dev_14210XXYYYZZ/read_node RemoteDevice Gain
To check the Gain node information by using get_genicam_node_info :
$ rosservice call /stcamera_node/dev_14210XXYYYZZ/get_genicam_node_info RemoteDevice Gain
Output:name: "Gain" description: "Controls the selected gain as an absolute physical value. This is an amplification\ \ factor applied to the video signal." name_space: "Standard" interface_type: "IFloat" access_mode: "Read and Write" is_cachable: "Yes" visibility: "Beginner" caching_mode: "Write to register, write to cache on read" is_streamable: True enum_value_str_list: [] enum_value_int_list: [] current_value: "100" min_value: "0.000000" max_value: "192.000000" increment: '' unit: '' child_node_list: []
4.2. Launch Script Examples and Termination
Examples of launch script and their parameters are included in the package. Please refer to the following procedure to use them:
<arg name="camera_namespace" default="dev_CAMERA-NS" />
camera_to_connect: ["CAMERA_ID or CAMERA_MODEL(SERIAL)"]
default_calibration_file: file:///home/mydata/calibration.xml
To terminate the stcamera_node, use the following ROS command:
$ rosnode kill /stcamera_node
4.3. Node Client Examples
In the examples folder, node "grabber" is provided as a straightforward node client of stcamera_node. The grabber (provided in C++ and Python) does the following:
- Display the SentechSDK and GenTL information by calling get_sdk_info.
- Search for a connected camera and get the camera namespace by calling get_device_list.
- Read and write the camera's Gain by calling get_genicam_node_info and write_node_float respectively.
- Subscribe to image_raw topic and grab up to 10 images. The image sizes and encoding information are printed on screen.
- Set trigger mode to ON (trigger selector is set to FrameStart and the source is set to Software) by calling enable_trigger), then grab up to 10 images with interval 1 seconds in between by sending software trigger through send_soft_trigger.
If you are using GigEVision camera, please ensure that the camera has a valid IP address. The IP address can be checked by calling either get_device_list or get_gige_ip. A static IP address can be assigned by using set_gige_ip service call. For example:
$ rosservice call /stcamera_node/get_gige_ip "00:11:1c:xx:xx:xx"
to display the current IP address of GigEVision camera with MAC 00:11:1c:xx:xx:xx, and
$ rosservice call /stcamera_node/set_gige_ip "00:11:1c:xx:xx:xx" 192.168.y.z 255.255.255.0 0.0.0.0
to assign a static IP address to GigEVision camera with MAC 00:11:1c:xx:xx:xx.
5. Customization
The stcamera_node provides generic functionality to control the OMRON SENTECH camera. If customization is needed to accommodate a specific camera, you can extend StCameraInterface class and either create a new ROS node or modify the existing stcamera_node (StCameraNode class) to support the specific camera. If you prefer the latter, you will need to modify the initialization process of the camera interface in StCameraNode class which can be found in function initializeCamera(). Please refer to the doxygen documentation for the structure of the StCameraInterface and the StCameraNode classes.
6. API Documentation
You can also find the code API and Msg/Srv API documentation at the following URL: https://wiki.ros.org/omronsentech_camera.
7. Questions/Feedbacks and Bug Reports
If you have any questions/feedbacks or found any bugs, please contact support-ros AT sentech.co DOT jp.