Passing proper serial numbers to mono_stereo_node.launch.py

,

General Information

  • Model: B57-4-Color
  • SN: 1010836
  • OS: Ubuntu 20.04
  • ROS2 Jazzy
  • Ensenso SDK: 4.1.1033
  • ros_driver branch: v2.1.3

Hi, I am unable to run mono_stereo_node.launch.py . The default values of the stereo serial numbers are stereo_cam and mono_cam. These default values prevent the nodelets from detecting my camera, which works fine with ensenso_camera_node.

What are the proper values for those parameters?

I get an argument typing error when I try to pass my serial number (see attached console output).
Thank you,
Charles

mono_stereo_with_serial.txt (2.4 KB)

Hi Charles,

ROS2 is more strict when it comes to the parameter types, whereas in ROS1 one could provide the serial parameter as either a string or an integer. The workaround here is to add an exclamation mark e.g. at the end of the integer serials so that ROS2 interprets the parameter as string. The Ensenso node internally removes the exclamation mark if present.

ros2 launch ensenso_camera mono_stereo_node.launch.py \
  stereo_serial:=256850! \
  mono_serial:=256850!

We definitely have to find a good spot to document this. I added it to this tutorial at the bottom, but that’s hard to find, especially if you are using anything but a C-Series.

Kind regards
Benny

I just saw that we had a similar problem with the mono_node.launch.py file. In that course we added exception handling for integer serials. Which does not seem to work with the mono_stereo_node.launch.py file, because there the nodes are wrapped in a container, which checks the type first before we get a chance in the C++ code.

Benny,
Thank you for your replies. I am using a B-Series camera.
I get a camera already in use error from the mono nodelet when I try the launch parameters you suggested above (see attached console).
The value 256850-Color, as show in the bottom of the tutorial does not work. Neither does 256850-Left.
Best regards,
Charles

mono_stereo_with_serial.txt (3.7 KB)

Hi Charles,

I was completely focused on the numeric serial problem and did not realize that stereo and mono serial were identical in the above code example.

The B-Series obtains the color information from the stereo sensor and does not have an additional color camera as the C-Series does. In NxView it will be listed as a single device, whereas the C-Series is listed as two (e.g. 123456 + 123456-Color). Hence, using mono_stereo_node.launch.py won’t work here, because there is no mono camera you could open. The error you are getting makes sense, because the launch file first opens the camera as stereo camera and then it wants to open it again as mono camera, which fails because the camera is already in use. Also, the two serials 256850-Color and 256850-Left do not exist.

May I ask what you are trying to achieve by running the mono_stereo_node.launch.py file? You said opening the camera with the ensenso_camera_node works fine? Are you getting color images?

Kind regards
Benny

Benny,
I would like to retrieve a color image (left) without projected pattern.
Best regards,
Charles

Hi Charles,

you can turn the projector off by setting the corresponding node. If you need additional lighting in your scene consider turning on the front light. There is also a ROS tutorial on setting parameters with a dedicated section (5.) on projector and front light.

Let me know if you have further questions.

Kind regards
Benny

Benny,
I was able to interleave depth and color imaging by setting-up two different parameter sets in the camera node, per your instructions.
After taking a depth image (projector on), I need to run the auto-exposure through several (3-5) color frames (projector off) before getting a decent color image. Is this necessary?
Best regards,
Charles

Hi Charles,

there was a bug in the ROS driver which prevented the auto-exposure values to be updated. It should be fixed with commit 8f928475e61e on master. Could you try and let me know if this fixes your issue?

In NxView you can use the Texture node do enable the capture of a dedicated texture image, but this functionality is not yet implemented in our ROS node. I will take care of it soon. For now I hope that the provided fix will do.

Kind regards
Benny

Benny,
Thank you, I am able to access the parameter values.
My node is producing the following warnings. I am not setting or getting GAIN_BOOST.
Best regards,
Charles

[ensenso_camera_node-11] [WARN] [1752625081.658015258] [b57.camera]: Writing the parameter GainBoost, but the camera does not support it! [ensenso_camera_node-11] [WARN] [1752625081.659589871] [b57.camera]: Reading the parameter GainBoost, but the camera does not support it!

Hi Charles,

the B-Series does not support GainBoost as some of our other cameras. However, the parameter is part of the Parameter message. When using a parameter set, the node tries to write all parameters contained by the message to the NxLib tree and issues a warning in case the target node does not exist in the tree.

We should probably change the warning’s occurrence level to once, so that this warning is not printed every time parameters are written or read.

Kind Regards
Benny