|Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.
Running a C-Series Camera with two NodeletsDescription: This tutorial shows how to run a C-Series camera with a stereo and a mono nodelet and how to generate a colored point cloud.
Tutorial Level: INTERMEDIATE
Next Tutorial: Registered Depth Image
This tutorial requires you to have a calibrated C-Series camera containing an additional color sensor. This separate color sensor is calibrated to the stereo camera. For more information on the specific operations of this camera series please refer to our manual.
The data of the two cameras can be combined to a colored point cloud similar as explained in the previous tutorial, but with a minor difference that you have to manually specify the mono camera node name as explained below.
- Open both stereo camera and color sensor via the dedicated launch file
Run the color_point_cloud script as described in the previous tutorial
If you are using ROS1, we also provide the dedicated color_point_cloud.launch file, which combines the two workflow steps.
The color sensor's serial number is the stereo serial with the suffix "-Color". The dash contained in that suffix is not allowed in nodelet names, hence we have to provide an alternative node name as shown in the following example. It uses the launch file presented in the previous tutorials. Fill in your camera serial in order to open both cameras:
roslaunch ensenso_camera mono_stereo_nodelets.launch \ serial_stereo:="123456" \ serial_mono:="123456-Color" \ # ROS1 does not allow dashes in node names so we provide an alternative. node_name_mono:="123456_Color" \ mono_link_frame:="optical_frame_123456"
In case your C-Series camera has e.g. a workspace calibration, not specifying a target frame would make the node warn you about it being missing. The following snippet shows how to prevent this warning:
roslaunch ensenso_camera mono_stereo_nodelets.launch \ serial_stereo:="123456" \ serial_mono:="123456-Color" \ # ROS1 does not allow dashes in node names so we provide an alternative. node_name_mono:="123456_Color" \ mono_link_frame:="optical_frame_123456" \ # If the stereo camera is calibrated to another target we can specify it here. target_frame:="Workspace"
Mono Camera Timeout With FlexView
When opening a C-Series camera with a color sensor in NxView, the software knows which two cameras are currently operated and uses this knowledge to configure the capture timeout for the mono camera so that the user does not have to care about it.
On ROS, the two cameras are opened in separate nodes and thus the timeout for the mono camera cannot be adapted to the stereo camera configuration. Especially when using FlexView with a large number of images it can happen that the mono camera runs into a capture timeout, because the color image might arrive after the sets of stereo images. The automatically computed timeout value by the NxLib for the mono camera might be exceeded.
In order to prevent any of our cameras from running into a capture timeout on ROS, the corresponding nodes can be passed a timeout value manually. The above described launch files have a parameter named mono_capture_timeout with a default value of 1000 ms. In case your mono camera runs into a capture timeout, please increase the value accordingly.
With ROS2 you do not have to specify the mono node name manually. However, there you have to put an exclamation mark in the stereo serial for it to be recognized as a string.
ros2 launch ensenso_camera mono_stereo_node.launch.py \ # Put in exclamation mark e.g. at the end to enforce type string. stereo_serial:=123456! \ mono_serial:=123456-Color \ mono_link_frame:=optical_frame_123456