ensenso / ros_driver

Official ROS driver for Ensenso stereo cameras.
http://wiki.ros.org/ensenso_driver
BSD 3-Clause "New" or "Revised" License
29 stars 25 forks source link

Fix getSerialOfFirstCamera() function when empty cameras #99

Closed erblinium closed 1 year ago

erblinium commented 1 year ago

Got NxLibException when having cameras with empty serial in camera list. Made the function so that it continues on to next camera instead of just returning empty serial and crashing.

benthie commented 1 year ago

Hi there and thank you very much for your PR. May I ask how you managed to get a camera with an empty serial into the camera list? Did you maybe open a file-camera and did not provide a serial?

erblinium commented 1 year ago

I am a bit unsure how I have "cameras" with empty serial. I have never used file-cameras. Currently I only have one virtual camera shown in nxView, however when i run the ensenso_camera_node it finds a total of 3 cameras where the 2 first ones are empty: image

benthie commented 1 year ago

Okay. That sounds a little bit awkward to me.

What you could try is the following:

erblinium commented 1 year ago

Okay. That sounds a little bit awkward to me.

* Which NxLib / Ensenso SDK version are you using?

Ubuntu 22.04 amd64 using nxLib version: 3.3.1417

  • Do you maybe have two NxLibs installed? How do I check that? Ran where nxview, got 2 locations:
    /usr/bin/nxView
    /bin/nxView

    However, I see that /bin/nxview is a script that actually uses executable located in /opt/ensenso/bin

What you could try is the following:

* go to your Ensenso installation folder (defaults to `/opt/ensenso` on Linux, `C:\ProgramFiles\Ensenso` on Windows)

* close all running instances of `NxLib` and `NxView`

* backup your settings folder

* remove all content in your settings folder

* open `NxView` and create a new virtual camera

* open the ROS node and check that it only lists the one camera

* if you again see cameras with an empty serial, please use `NxTreeEdit` to check the content of the `itmBySerialNo` node and post it here

The NxTreeEdit when running the ROS node is all empty. Its only populated when nxView is running. I attached an nxlog file of when I ran nxview and the ROS node.

tmp_NxTreeEdit.zip

benthie commented 1 year ago

Thank you very much.

The problem was actually somewhere else in the code and is linked to changes in the NxLib. I created a separate pull request., but your PR still helped us a lot in spotting a few minor problems with regard to serial number handling.

When the changes are merged I will also create a new release tag so that you can simply download the new version.