FraunhoferIOSB / camera_aravis

A ROS1 driver for GenICam based GigE and USB3 cameras.
Other
22 stars 15 forks source link

Getting Imperx P67-C1911C running with the camera_aravis-noetic-devel #9

Closed bonjiman closed 2 years ago

bonjiman commented 2 years ago

Hi,

I am an engineering grad student working on getting these Imperx cameras set up in ROS. I tried to follow the instructions to the best of my ability, but I still cannot get the drivers to work.

I am using an Imperx P67-C1911C GenICam-compliant industrial camera. I have the camera connected to the same network as the computer running ROS, and I am able to locate the camera using ping in the console.

First, I run the camera aravis node using the following command: (camnode must be deprecated, because it is nowhere in the package) rosrun camera_aravis cam_aravis

The node/let starts as expected: [ INFO] [{TIMESTAMP}]: Initializing nodelet with 4 worker threads. [ INFO] [{TIMESTAMP}]: Attached cameras: [ INFO] [{TIMESTAMP}]: # Interfaces: 3 [ INFO] [{TIMESTAMP}]: # Devices: 1 [ INFO] [{TIMESTAMP}]: Device0: Imperx, Inc-P67-C1911C-RC0000000-00310392 [ INFO] [{TIMESTAMP}]: Opening: (any) [ INFO] [{TIMESTAMP}]: Opened: Imperx, Inc-00310392 [ INFO] [{TIMESTAMP}]: Feature Root is 1 [ INFO] [{TIMESTAMP}]: Feature SpecialFeatures is 1 [ INFO] [{TIMESTAMP}]: Feature AcquisitionFrameRateEnable_1 is 1 [ INFO] [{TIMESTAMP}]: Feature FixedFramePeriodEnableReg_1 is 1 [ INFO] [{TIMESTAMP}]: Feature Device is 1 [ INFO] [{TIMESTAMP}]: Feature TLParamsLocked is 1 [ INFO] [{TIMESTAMP}]: Feature ActionControl is 1 [ INFO] [{TIMESTAMP}]: Feature ActionGroupKey is 0

And then things totally go crazy. We see a torrent of messages that look like: (process:83488): Aravis-CRITICAL **: 15:31:52.120: arv_gc_feature_node_is_available: assertion 'error == NULL || *error == NULL' failed [ INFO] [{TIMESTAMP}]: Feature ActionGroupKeyReg is 0

This pattern repeats, except with different feature names, with each of the features set to 0.

At the bottom of this wave of errors, we get the following: [ INFO] [{TIMESTAMP}]: Number of supported stream channels 0. [ INFO] [{TIMESTAMP}]: Camera does not support ExposureTime. [ INFO] [{TIMESTAMP}]: Camera does not support AcquisitionFrameRate. [ INFO] [{TIMESTAMP}]: Camera does not support FocusPos. [ INFO] [{TIMESTAMP}]: Using Camera Configuration: [ INFO] [{TIMESTAMP}]: -------------------------------- [ INFO] [{TIMESTAMP}]: Vendor name = Imperx, Inc [ INFO] [{TIMESTAMP}]: Model name = P67-C1911C-RC0000000 [ INFO] [{TIMESTAMP}]: Device id = [ INFO] [{TIMESTAMP}]: Serial number = 00310392 [ INFO] [{TIMESTAMP}]: Type = GigEVision

After this gets printed, the node dies. I've also tried to get the nodelet running using the following command: roslaunch camera_aravis camera_aravis.launch

This produced the exact same behavior.

Any ideas? Why isn't the library working? Is it the camera? Are we using the library wrong? Does the library require setting up some files beforehand? Literally any help, even just for further reading, would be appreciated.

tonyromarock commented 2 years ago

Hi @bonjiman,

thank you for using the camera_aravis package. I'll give you some pointers on what you could try to get an image published from your Imperx P67-C1911C camera.

Create a .launch file similar to camera_aravis.launch and make sure to adjust the parameters to conform with the valid settings available for your camera.

This often means setting the serial_no to the device name used for the camera in aravis. You can find this by running arv-tool-0.8 in the terminal and copying the printed name (excluding the IP address in parentheses). If left empty, it uses the first available genicam camera available in the network.

You also want to select a valid pixel_format. Here you can also use the arv-tool-0.8 to download the genicam XML file stored on the camera. For this call arv-tool-0.8 --name=<device_name> genicam > <output_file>, where <device name> is the aravis name for the camera and <output_file> is the file, where you are going to write the genicam XML content to. In the file you can search for PixelFormat and find the available enum entries for your camera (probably something like Mono8 and BayerRG8). This same information is maybe also available in the user manual of your camera.

Also make sure that the width and height are set to a valid range for your camera.

These four arguments have to be set correctly for the camera_aravis driver to work correctly on its default settings.

P.S. As you noticed, the package produces still quite a lot of output on the screen. You can set output="log" in your custom .launch file if you don't need the printed information for debugging purposes.

kledom commented 2 years ago

@bonjiman Were you able to resolve your issue?

To add to @tonyromarock , I would like to note that the package in its current form only works with camera_aravis-0.6, which is included in the Ubuntu 20.04 Universe repository (sudo apt install aravis-tools).

bonjiman commented 2 years ago

Hi everyone,

Sorry for the very response, but our design team pivoted away from the aforementioned camera since our competition was nearing. We're on the other end of that now, though, and I'm back to trying to get these Imperx cameras working in ROS.

I followed @tonyromarock 's tips to get things started, and I can confirm that fixed most of the issues related to the stream of error messages on startup. However, I seem to be running up against a new, weird issue where the nodelet crashes after printing "Number of supported stream channels 0.". Basically, on lines 552 and 555 of camera_aravis_nodelet.cpp, the camera aravis nodelet tries to pull DeviceStreamChannelCount and GevStreamChannelCount from the camera. Following @tonyromarock 's instructions, I dumped the XML file to my computer and checked all the Genicam fields of this camera. There are NO VALUES matching these XXXStreamChannelCount variables. Does this mean I won't be able to use camera aravis with my camera? Or maybe the number of supported streams is always 1?

Further, at the top of the dumped XML file, I see a reference to the fact that this camera uses Genicam's GenAPI version 1.1 with SFNC version 2.3.0. I checked this version of GenAPI, and there appear to be several changes that have been made since version 1.1 came out. Out of curiosity, does anyone know which version of GenAPI this camera_aravis ROS package uses/assumes? The SFNC version 2.3.0 standards state that the DeviceStreamChannelCount and GevStreamChannelCount are "Optional" parameters that may not be located on the camera.

Please let me know if anyone has anything to add.

tonyromarock commented 2 years ago

Hi @bonjiman,

Sorry to hear about the last minute changes on your project.

camera_aravis makes use of many camera features that are available in SFNC version 2.6.0. We should therefore probably set the stream channel count to 1 if nothing else is given by DeviceStreamChannelCount or GevStreamChannelCount. All the cameras we've tested the ROS package had this camera feature implemented eventhough it is just optional.

To get the camera_aravis driver to work will unfortunately require you to make some changes directly in the code for any instances were different camera features are used in GenAPI 1.1 / SFNC 2.3

Are you able to upload the GenICam XML dump of your Imperx camera? This might help me in finding other parts of the code, where you might run into similar issues.

bonjiman commented 2 years ago

Thanks for the help, @tonyromarock.

I can upload the XML tomorrow morning (east coast USA time) when I have access to the camera.

I am not afraid to mess around with the existing code to get my specific application working, so if you are able to give me any more heads up after looking at the XML, then I think I'll be able to get it working.

I'm guessing the XXXStreamChannelCount variables are for devices that have multiple outputs? I'd imagine most cameras would have a value of 1 anyway

bonjiman commented 2 years ago

@tonyromarock Here is the XML file of the camera. I had to change the file extension to .TXT to make GitHub happy to host the file, but you should be able to change it back to an .xml.
genicam_params.txt

tonyromarock commented 2 years ago

@bonjiman Thank you for uploading the genicam XML file.

After looking at it, I think the only esssential change is where you mentioned around line 552, where you want num_streams_ to be 1 if the features DeviceStreamChannelCount and GevStreamChannelCount are not defined (which is the case for your camera).

All the other essential features are included in the XML file (DeviceSerialNumber,PixelFormat,...).

In case you wanted to use the ExtendedCameraInfo.msg, then you might have to change the name of some features. Your camera has a CurrentFrameTime feature, while we assume a ExposureTimeAbs or ExposureTime.

Check camera_aravis.launch on how to setup a launch file for your camera.

I hope this was helpful and let me know if you run into any issues!

tonyromarock commented 2 years ago

@bonjiman, were you able to get the driver working for your Imperx camera? Would consider creating a PR of your updated code?