ensenso / ros_driver

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

C-Series Capture Timeout #118

Closed belalhmedan90 closed 5 months ago

belalhmedan90 commented 7 months ago

Hi,

When I run: roslaunch ensenso_camera register_depth_image.launch I get an exception. Im using ROS1, ubuntu 20.04, Camera type: C75-8-M

process[DIP_Register-6]: started with pid [58579]
[ INFO] [2023-11-29 14:56:34]: waitForService: Service [/manager_/load_nodelet] has not been advertised, waiting...
[ INFO] [2023-11-29 14:56:34]: Loading nodelet /mono/Ensenso_ of type ensenso_camera/mono_camera_node to manager /manager_ with the following remappings:
[ INFO] [2023-11-29 14:56:34]: waitForService: Service [/manager_/load_nodelet] has not been advertised, waiting...
[ INFO] [2023-11-29 14:56:34]: Initializing nodelet with 12 worker threads.
[ INFO] [2023-11-29 14:56:34]: Loading nodelet /DIP_Register of type depth_image_proc/register to manager /manager_ with the following remappings:
[ INFO] [2023-11-29 14:56:34]: /depth/camera_info -> /stereo/depth/camera_info
[ INFO] [2023-11-29 14:56:34]: /depth/image_rect -> /stereo/depth/image
[ INFO] [2023-11-29 14:56:34]: /depth_registered/camera_info -> /mono/depth/camera_info
[ INFO] [2023-11-29 14:56:34]: /depth_registered/image_rect -> /mono/depth/image
[ INFO] [2023-11-29 14:56:34]: /rgb/camera_info -> /mono/rectified/camera_info
[ INFO] [2023-11-29 14:56:34]: waitForService: Service [/manager_/load_nodelet] is now available.
[ INFO] [2023-11-29 14:56:34]: waitForService: Service [/manager_/load_nodelet] is now available.
[ INFO] [2023-11-29 14:56:36]: Opened camera with serial number '232155'.
[ INFO] [2023-11-29 14:56:37]: Opened camera with serial number '232155-Color'.
[ERROR] [2023-11-29 14:56:38]: NxLibException 17 (ExecutionFailed) for item /Execute/232155-Color
[ERROR] [2023-11-29 14:56:38]: CaptureTimeout: Image capture timed out.

Can you please tell me how can I solve that please? thanks.

benthie commented 7 months ago

Unfortunately, we haven't had the time yet to test C-Series cameras with ROS.

The C-Series has a special trigger mode. Maybe using the internal trigger mode will solve your problem.

belalhmedan90 commented 7 months ago

@benthie my issue is related to unresolved issue #53, both are caused by images didn't arrive from the SDK (closed source SDK).

I wish that you reopen the original issue #53 until reaching a good solution to resolve the issue. thanks.

benthie commented 7 months ago

I think that the capture timeout is specific to the C-Series camera. Issue #53 was about uEye based cameras and the uEye driver, while the C-Series is GigE Vision based and does not require an additional driver.

benthie commented 7 months ago

Unfortunately, we haven't had the time yet to test C-Series cameras with ROS.

Now we had the time :tada:. There is a new release v2.1.1 and a new tutorial.

belalhmedan90 commented 7 months ago

@benthie Thanks for your kind feedback,

roslaunch ensenso_camera mono_stereo_nodelets.launch stereo_serial:="232155" mono_serial:="232155-Color" node_name_mono:="232155_Color" link_frame:="optical_frame_232155"

is running well now, except I don't receive any data images/pointclouds. nxView gives an error: CaptureTimeout: Waiting for images timed out.

Moreover I contacted the IDS support without getting any response, and I have only two weeks (still one) to test this new model and give a feedback. thanks for your understanding.

benthie commented 7 months ago

Hi @belalhmedan90,

I just contacted the IDS support. They will get in touch with you soon.

Until then you can:

I hope you soon find a solution for your problem.

belalhmedan90 commented 7 months ago

Hi again, I'm now able to see data using the SDK, thanks to the POE++ injector, however, I cant see any output using the past ros launch file (ROS1 Ubuntu 20.04), can you please tell me how can I request_data from the camera to see the output using the launch file

roslaunch ensenso_camera mono_stereo_nodelets.launch stereo_serial:="232155" mono_serial:="232155-Color" node_name_mono:="232155_Color" link_frame:="optical_frame_232155"

, thanks in advance.

benthie commented 7 months ago

Have you tried rosrun ensenso_camera request_data?

belalhmedan90 commented 7 months ago

Have you tried rosrun ensenso_camera request_data?

yes I did, it worked with the node, but not with the launch file!

img

as you can see it connects to the action server, but it didn't trigger the camera!

benthie commented 7 months ago
belalhmedan90 commented 7 months ago
  1. ROS topic list (topics are empty (no messages))

    $ rostopic list
    /diagnostics
    /manager_/bond
    /mono/access_tree/cancel
    /mono/access_tree/feedback
    /mono/access_tree/goal
    /mono/access_tree/result
    /mono/access_tree/status
    /mono/execute_command/cancel
    /mono/execute_command/feedback
    /mono/execute_command/goal
    /mono/execute_command/result
    /mono/execute_command/status
    /mono/get_parameter/cancel
    /mono/get_parameter/feedback
    /mono/get_parameter/goal
    /mono/get_parameter/result
    /mono/get_parameter/status
    /mono/locate_pattern/cancel
    /mono/locate_pattern/feedback
    /mono/locate_pattern/goal
    /mono/locate_pattern/result
    /mono/locate_pattern/status
    /mono/raw/camera_info
    /mono/raw/image
    /mono/raw/image/compressed
    /mono/raw/image/compressed/parameter_descriptions
    /mono/raw/image/compressed/parameter_updates
    /mono/raw/image/compressedDepth
    /mono/raw/image/compressedDepth/parameter_descriptions
    /mono/raw/image/compressedDepth/parameter_updates
    /mono/raw/image/theora
    /mono/raw/image/theora/parameter_descriptions
    /mono/raw/image/theora/parameter_updates
    /mono/rectified/camera_info
    /mono/rectified/image
    /mono/rectified/image/compressed
    /mono/rectified/image/compressed/parameter_descriptions
    /mono/rectified/image/compressed/parameter_updates
    /mono/rectified/image/compressedDepth
    /mono/rectified/image/compressedDepth/parameter_descriptions
    /mono/rectified/image/compressedDepth/parameter_updates
    /mono/rectified/image/theora
    /mono/rectified/image/theora/parameter_descriptions
    /mono/rectified/image/theora/parameter_updates
    /mono/request_data/cancel
    /mono/request_data/feedback
    /mono/request_data/goal
    /mono/request_data/result
    /mono/request_data/status
    /mono/set_parameter/cancel
    /mono/set_parameter/feedback
    /mono/set_parameter/goal
    /mono/set_parameter/result
    /mono/set_parameter/status
    /request_data/cancel
    /request_data/feedback
    /request_data/goal
    /request_data/result
    /request_data/status
    /rosout
    /rosout_agg
    /stereo/access_tree/cancel
    /stereo/access_tree/feedback
    /stereo/access_tree/goal
    /stereo/access_tree/result
    /stereo/access_tree/status
    /stereo/calibrate_hand_eye/cancel
    /stereo/calibrate_hand_eye/feedback
    /stereo/calibrate_hand_eye/goal
    /stereo/calibrate_hand_eye/result
    /stereo/calibrate_hand_eye/status
    /stereo/calibrate_workspace/cancel
    /stereo/calibrate_workspace/feedback
    /stereo/calibrate_workspace/goal
    /stereo/calibrate_workspace/result
    /stereo/calibrate_workspace/status
    /stereo/camera_info
    /stereo/depth/camera_info
    /stereo/depth/image
    /stereo/depth/image/compressed
    /stereo/depth/image/compressed/parameter_descriptions
    /stereo/depth/image/compressed/parameter_updates
    /stereo/depth/image/compressedDepth
    /stereo/depth/image/compressedDepth/parameter_descriptions
    /stereo/depth/image/compressedDepth/parameter_updates
    /stereo/depth/image/theora
    /stereo/depth/image/theora/parameter_descriptions
    /stereo/depth/image/theora/parameter_updates
    /stereo/depth/projected_depth_map
    /stereo/depth/projected_depth_map/compressed
    /stereo/depth/projected_depth_map/compressed/parameter_descriptions
    /stereo/depth/projected_depth_map/compressed/parameter_updates
    /stereo/depth/projected_depth_map/compressedDepth
    /stereo/depth/projected_depth_map/compressedDepth/parameter_descriptions
    /stereo/depth/projected_depth_map/compressedDepth/parameter_updates
    /stereo/depth/projected_depth_map/theora
    /stereo/depth/projected_depth_map/theora/parameter_descriptions
    /stereo/depth/projected_depth_map/theora/parameter_updates
    /stereo/disparity_map
    /stereo/disparity_map/compressed
    /stereo/disparity_map/compressed/parameter_descriptions
    /stereo/disparity_map/compressed/parameter_updates
    /stereo/disparity_map/compressedDepth
    /stereo/disparity_map/compressedDepth/parameter_descriptions
    /stereo/disparity_map/compressedDepth/parameter_updates
    /stereo/disparity_map/theora
    /stereo/disparity_map/theora/parameter_descriptions
    /stereo/disparity_map/theora/parameter_updates
    /stereo/execute_command/cancel
    /stereo/execute_command/feedback
    /stereo/execute_command/goal
    /stereo/execute_command/result
    /stereo/execute_command/status
    /stereo/fit_primitive/cancel
    /stereo/fit_primitive/feedback
    /stereo/fit_primitive/goal
    /stereo/fit_primitive/result
    /stereo/fit_primitive/status
    /stereo/get_parameter/cancel
    /stereo/get_parameter/feedback
    /stereo/get_parameter/goal
    /stereo/get_parameter/result
    /stereo/get_parameter/status
    /stereo/locate_pattern/cancel
    /stereo/locate_pattern/feedback
    /stereo/locate_pattern/goal
    /stereo/locate_pattern/result
    /stereo/locate_pattern/status
    /stereo/point_cloud
    /stereo/point_cloud_color
    /stereo/project_pattern/cancel
    /stereo/project_pattern/feedback
    /stereo/project_pattern/goal
    /stereo/project_pattern/result
    /stereo/project_pattern/status
    /stereo/project_telecentric/cancel
    /stereo/project_telecentric/feedback
    /stereo/project_telecentric/goal
    /stereo/project_telecentric/result
    /stereo/project_telecentric/status
    /stereo/projected_point_cloud
    /stereo/raw/left/camera_info
    /stereo/raw/left/image
    /stereo/raw/left/image/compressed
    /stereo/raw/left/image/compressed/parameter_descriptions
    /stereo/raw/left/image/compressed/parameter_updates
    /stereo/raw/left/image/compressedDepth
    /stereo/raw/left/image/compressedDepth/parameter_descriptions
    /stereo/raw/left/image/compressedDepth/parameter_updates
    /stereo/raw/left/image/theora
    /stereo/raw/left/image/theora/parameter_descriptions
    /stereo/raw/left/image/theora/parameter_updates
    /stereo/raw/right/camera_info
    /stereo/raw/right/image
    /stereo/raw/right/image/compressed
    /stereo/raw/right/image/compressed/parameter_descriptions
    /stereo/raw/right/image/compressed/parameter_updates
    /stereo/raw/right/image/compressedDepth
    /stereo/raw/right/image/compressedDepth/parameter_descriptions
    /stereo/raw/right/image/compressedDepth/parameter_updates
    /stereo/raw/right/image/theora
    /stereo/raw/right/image/theora/parameter_descriptions
    /stereo/raw/right/image/theora/parameter_updates
    /stereo/rectified/left/camera_info
    /stereo/rectified/left/image
    /stereo/rectified/left/image/compressed
    /stereo/rectified/left/image/compressed/parameter_descriptions
    /stereo/rectified/left/image/compressed/parameter_updates
    /stereo/rectified/left/image/compressedDepth
    /stereo/rectified/left/image/compressedDepth/parameter_descriptions
    /stereo/rectified/left/image/compressedDepth/parameter_updates
    /stereo/rectified/left/image/theora
    /stereo/rectified/left/image/theora/parameter_descriptions
    /stereo/rectified/left/image/theora/parameter_updates
    /stereo/rectified/right/camera_info
    /stereo/rectified/right/image
    /stereo/rectified/right/image/compressed
    /stereo/rectified/right/image/compressed/parameter_descriptions
    /stereo/rectified/right/image/compressed/parameter_updates
    /stereo/rectified/right/image/compressedDepth
    /stereo/rectified/right/image/compressedDepth/parameter_descriptions
    /stereo/rectified/right/image/compressedDepth/parameter_updates
    /stereo/rectified/right/image/theora
    /stereo/rectified/right/image/theora/parameter_descriptions
    /stereo/rectified/right/image/theora/parameter_updates
    /stereo/request_data/cancel
    /stereo/request_data/feedback
    /stereo/request_data/goal
    /stereo/request_data/result
    /stereo/request_data/status
    /stereo/set_parameter/cancel
    /stereo/set_parameter/feedback
    /stereo/set_parameter/goal
    /stereo/set_parameter/result
    /stereo/set_parameter/status
    /stereo/texture_point_cloud/cancel
    /stereo/texture_point_cloud/feedback
    /stereo/texture_point_cloud/goal
    /stereo/texture_point_cloud/result
    /stereo/texture_point_cloud/status
    /tf
    /tf_static
  2. venv has no effect if deactivated.

  3. I added a name to the stereo node name in params passed to launch , it didn't solve the problem.

benthie commented 7 months ago

Might it be related to the Python version as in this issue?

benthie commented 7 months ago

I am sorry, it has probably nothing to do with the Python version.

The launch file puts the two nodes into namespaces (mono and stereo). You have to provide the namespace to the request_data script. Have a look at the color_point_cloud script, there you can see the usage of the namespace parameter.

belalhmedan90 commented 7 months ago

Can you please tell me how can I run the request_data node in the correct namespace from the command-line? otherwise would you please provide a valid launch file to output a pointcloud from your camera to RVIZ? thanks.

benthie commented 7 months ago

If you want to receive a point cloud in RVIZ, can't you just follow the steps in this tutorial, which you referred to above? There the color_point_cloud script is used, which takes care of providing the default namespace parameters.

In RVIZ you then have to change the default frame from "map" to "optical_frame_232155" and should be able to see the data. At least for me this worked when I created the tutorial, both on ROS1 and ROS2.

belalhmedan90 commented 7 months ago

If you want to receive a point cloud in RVIZ, can't you just follow the steps in this tutorial, which you referred to above? There the color_point_cloud script is used, which takes care of providing the default namespace parameters.

In RVIZ you then have to change the default frame from "map" to "optical_frame_232155" and should be able to see the data. At least for me this worked when I created the tutorial, both on ROS1 and ROS2.

That tutorial didn't work in my case, as the node for triggering the camera is not included in that launch file! so if I launch that launch file I don't get any output, except empty topics!

benthie commented 7 months ago

Okay. Maybe I didn't explain that well enough in the tutorial. The node, that triggers the camera / captures images and then initiates the pipeline of commands that finally compute the desired point cloud, is indeed not included in the launch file. However, Step 2 in the tutorial says, that we have to run the color_point_cloud script, which:

So instead of running the request_data script in a parallel terminal you should receive a colored point cloud by running the color_point_cloud script.

Let me know if you still do not get any data from the camera.

belalhmedan90 commented 7 months ago

I'm getting this error while running the color_point_cloud (either as ros node, or as python script, in both cases):

$ rosrun ensenso_camera color_point_cloud
Traceback (most recent call last):
  File "/home/belalhmedan/ids_ws/devel/lib/ensenso_camera/color_point_cloud", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/home/belalhmedan/ids_ws/src/ros_driver/ensenso_camera/scripts/color_point_cloud", line 78, in <module>
    main()
  File "/home/belalhmedan/ids_ws/src/ros_driver/ensenso_camera/scripts/color_point_cloud", line 74, in main
    ros2py.wrap_main_function(_main, "color_point_cloud")
  File "/home/belalhmedan/ids_ws/src/ros_driver/ensenso_camera/src/ensenso_camera/ros2.py", line 304, in wrap_main_function
    main(node_name)
  File "/home/belalhmedan/ids_ws/src/ros_driver/ensenso_camera/scripts/color_point_cloud", line 15, in _main
    mono_serial = ros2py.get_param(node, "mono_serial")
  File "/home/belalhmedan/ids_ws/src/ros_driver/ensenso_camera/src/ensenso_camera/ros2.py", line 321, in get_param
    return rospy.get_param("~" + name, default)
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/client.py", line 467, in get_param
    return _param_server[param_name] #MasterProxy does all the magic for us
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/msproxy.py", line 123, in __getitem__
    raise KeyError(key)
KeyError: '~mono_serial'

moreover, some parameters in the tutorial have different names compared to the nodelet, namely serial_mono vs mono_serial, same goes for stereo!

benthie commented 7 months ago

Try rosrun ensenso_camera color_point_cloud _mono_serial:=232155-Color.

belalhmedan90 commented 7 months ago

rosrun ensenso_camera color_point_cloud _mono_serial:=232155-Color

It crashed: ids_ros_3

benthie commented 7 months ago

Did you make any specific settings in NxView that were necessary to get data? Or was the POE++-Injector the solution to your initial timeout problem? At any rate, could you export your settings from NxView via the settings dialog for both cameras and then use the saved .json files with ROS by passing them to the launch file?

roslaunch ensenso_camera \
    mono_stereo_nodelets.launch \
    stereo_serial:="232155" \
    mono_serial:="232155-Color" \
    node_name_mono:="232155_Color" \
    link_frame:="optical_frame_232155" \
    settings_stereo:=<path_to_stereo_settings> \
    settings_mono:=<path_to_mono_settings> 
belalhmedan90 commented 7 months ago

Did you make any specific settings in NxView that were necessary to get data? Or was the POE++-Injector the solution to your initial timeout problem? At any rate, could you export your settings from NxView via the settings dialog for both cameras and then use the saved .json files with ROS by passing them to the launch file?

roslaunch ensenso_camera \
    mono_stereo_nodelets.launch \
    stereo_serial:="232155" \
    mono_serial:="232155-Color" \
    node_name_mono:="232155_Color" \
    link_frame:="optical_frame_232155" \
    settings_stereo:=<path_to_stereo_settings> \
    settings_mono:=<path_to_mono_settings> 
benthie commented 7 months ago

I am sorry to hear that this also doesn't solve your problem.

In order to further investigate your problem, could you please record the following logs and provide them to us:

Let me know if you have trouble recording the logs. And thank you for your patience.

belalhmedan90 commented 7 months ago

Here is the link to the debug files

benthie commented 7 months ago

Could you please re-record the .nxlog file with an open TCP port on the ROS node (e.g. 25000) like this:

roslaunch ensenso_camera \
     mono_stereo_nodelets.launch \
     stereo_serial:="232155" \
     mono_serial:="232155-Color" \
     node_name_mono:="232155_Color" \
     link_frame:="optical_frame_232155" \
     settings_stereo:="../ensenso_stereo.json" \
     settings_mono:="../ensenso_mono.json" \
     tcp_port:=25000

Then open NxTreeEdit and connect to the corresponding instance with the above port number and repeat the recording.

benthie commented 7 months ago

I also noticed that your MaximumTransmissionUnit (MTU) is set to 1500. Could you increase it to 9000 as recommended above and see if that helps?

belalhmedan90 commented 7 months ago

roslaunch ensenso_camera \ mono_stereo_nodelets.launch \ stereo_serial:="232155" \ mono_serial:="232155-Color" \ node_name_mono:="232155_Color" \ link_frame:="optical_frame_232155" \ settings_stereo:="../ensenso_stereo.json" \ settings_mono:="../ensenso_mono.json" \ tcp_port:=25000

Please find the link to that file here with TCP port set to 25000

belalhmedan90 commented 7 months ago

I also noticed that your MaximumTransmissionUnit (MTU) is set to 1500. Could you increase it to 9000 as recommended above and see if that helps?

I increased it to 9000, but still the error persists.

benthie commented 7 months ago

Please find the link to that file here with TCP port set to 25000

Unfortunately, the log recorded an open NxView, not your ROS node.

To make things clear, let me explain a little bit. We provide the following software parts:

What the ROS camera node does is, it starts an NxLib instance and opens a camera. And in order to be able to record an .nxlog file of what is happening in that NxLib , we have to open a TCP port on it. Now we can connect with NxTreeEdit to that instance. If you, however, have NxView running in parallel, which by default opens port 24000, please make sure to connect to the instance contained within the ROS node (25000 from the example above).

belalhmedan90 commented 7 months ago

Please find the link to that file here with TCP port set to 25000

Unfortunately, the log recorded an open NxView, not your ROS node.

To make things clear, let me explain a little bit. We provide the following software parts:

* `NxLib`: Our library, which can open a TCP port so that one can connect to it

* `NxView`: Our GUI that contains an `NxLib` instance

* `NxTreeEdit`: Our GUI tool that can connect to an `NxLib` instance via TCP and read/write the internal tree/state

What the ROS camera node does is, it starts an NxLib instance and opens a camera. And in order to be able to record an .nxlog file of what is happening in that NxLib , we have to open a TCP port on it. Now we can connect with NxTreeEdit to that instance. If you, however, have NxView running in parallel, which by default opens port 24000, please make sure to connect to the instance contained within the ROS node (25000 from the example above).

sorry for misunderstanding, please find a correct log file here

benthie commented 7 months ago

Hi @belalhmedan90 ,

thank you for providing the logs. They helped us identify the problem. I pushed a patch with which you can set the mono camera capture timeout. Could you pull this version and build it and then try setting a capture timeout for the mono camera by adding the line

    <param name="capture_timeout" type="int" value="1000" />

after line 39 in the mono_stereo_nodelets.launch file. This sets the capture timeout for the mono camera to 1000ms. The problem is, that you have FlexView enabled and both stereo and color camera capture about the same point of time but the color image is only delivered after the set of stereo images and thus the mono camera's default (automatic) timeout is not sufficient.

When I tested the driver with a C-Series camera I forgot to also test it with FlexView enabled. You could try to disable FlexView for now to see whether the internal timeout is enough.

Please make sure to rerun catkin build after you modified the launch file and pulled the patch.

We will fix the problem as soon as possible. Again, thank you for your patience.

belalhmedan90 commented 7 months ago
benthie commented 7 months ago

We have a tutorial on how to read/write parameters from ROS. The quickest way for you right now, however, would be to open NxView, disable FlexView there in the Parameters-Dialog (open either via the Settings-Button or press F8). You might have to switch on the advanced mode. And then save the settings again as JSON and feed it to the ROS node.

I added another line that prints the currently set capture timeout. See this commit. Please build this version and verify that the output appears in the ROS log of the launch file. In the .nxlog file I could see that it takes about 630ms from capture to image arrival, so 1000ms should be fine. You can of course increase the value to 1500 or even 2000 to be safe.

belalhmedan90 commented 7 months ago

We have a tutorial on how to read/write parameters from ROS. The quickest way for you right now, however, would be to open NxView, disable FlexView there in the Parameters-Dialog (open either via the Settings-Button or press F8). You might have to switch on the advanced mode. And then save the settings again as JSON and feed it to the ROS node.

I added another line that prints the currently set capture timeout. See this commit. Please build this version and verify that the output appears in the ROS log of the launch file. In the .nxlog file I could see that it takes about 630ms from capture to image arrival, so 1000ms should be fine. You can of course increase the value to 1500 or even 2000 to be safe.

I increased that value to 2000, disabled FlexView, still I have the same error, the nodelet didn't print the message of Timeout in the patch, as it crashed before!

benthie commented 7 months ago

Hmm, if the nodelet did not print the message, the ensenso_camera package was not properly updated or built. How did you set up your catkin workspace? Did you use git clone to install the ensenso ros_driver?

You can verify that the package was updated correctly by checking that the file mono_camera.cppon your computer contains the added lines from the patch.

You can verify that the package builds properly by adding another debug output to e.g. the color_point_map script, rebuild your catkin workspace respectively the ensenso_camera package and check that added message is printed when you run the script. If not, something is still not properly configured.

belalhmedan90 commented 7 months ago

Hmm, if the nodelet did not print the message, the ensenso_camera package was not properly updated or built. How did you set up your catkin workspace? Did you use git clone to install the ensenso ros_driver?

You can verify that the package was updated correctly by checking that the file mono_camera.cppon your computer contains the added lines from the patch.

You can verify that the package builds properly by adding another debug output to e.g. the color_point_map script, rebuild your catkin workspace respectively the ensenso_camera package and check that added message is printed when you run the script. If not, something is still not properly configured.

Can you please add this parameter <param name="capture_timeout" type="int" value="1000" /> to the launch file in that branch, so I pull, and build without changing many things by hand? thanks

benthie commented 7 months ago

Can you please add this parameter <param name="capture_timeout" type="int" value="1000" /> to the launch file in that branch, so I pull, and build without changing many things by hand? thanks

Sure. See commit c353dd442f4423d7915cb51ace873c24b8e0d4a7.

belalhmedan90 commented 7 months ago

Can you please add this parameter <param name="capture_timeout" type="int" value="1000" /> to the launch file in that branch, so I pull, and build without changing many things by hand? thanks

Sure. See commit c353dd4.

Thanks, still crashing after few snapshots, and not printing that timeout message: ensenso_crash

# inside the workspace
catkin clean --all -y 
git clone https://github.com/ensenso/ros_driver.git src/
cd src/
git checkout mono-capture-timeout 
cd ..
catkin build
source. devel/setup.bash 
roslaunch ensenso_camera      mono_stereo_nodelets.launch      stereo_serial:="232155"      mono_serial:="232155-Color"      node_name_mono:="232155_Color"      link_frame:="optical_frame_232155"   tcp_port:=25000
benthie commented 7 months ago

Hmm, I am still missing the info message "Timeout set to 1000ms" that should be printed when providing a capture timeout for the mono camera.

Can you do the following inside your workspace:


cd src/
git rev-parse HEAD
# Make sure that it is c353dd442f4423d7915cb51ace873c24b8e0d4a7
# Otherwise do
git fetch
git checkout mono-capture-timeout
``
belalhmedan90 commented 7 months ago

git rev-parse HEAD

I checked the commit, it is the same c353dd442f4423d7915cb51ace873c24b8e0d4a7,

now, if you run the same nodelet on your machine with ubuntu 20.04, cuda acceleration activated (you already have my parameters to reproduce the same output), and C57 camera, does it print that message?

benthie commented 7 months ago

I will verify that tomorrow. Could you please set the ROS log level to DEBUG and provide the verbose logs?

belalhmedan90 commented 7 months ago

set the ROS log level to DEBUG

Please find the logs here

benthie commented 7 months ago

Please try commit 741de5526ce66623e1ec372e8d69c79ee6d6b88c. This one should now actually use the capture timeout on the mono camera.

belalhmedan90 commented 7 months ago

Indeed, it prints the timeout now, but still crashing after few snapshots: ros_error_ensenso_

benthie commented 7 months ago

Okay. There is actually a small bug in our Python compatibility layer, hence the AttributeError in the script. Fixed in e4b1cc42bf0854b3027757fe9deb37f649980952. But that does not fix the capture timeout.

I currently switched to Ubuntu 22.04 and have no working ROS setup yet. I can try to look into this today, but I do not want to promise that there will be enough time so close to the christmas holidays.

Have you tried reducing the number of images captured by the stereo camera? This can be achieved via the FlexView parameter. I just looked into the ensenso_stereo.json file that you provided yesterday. There it is set to 4. You can simply turn it off by setting it to false as described here.

Furthermore, please try increasing the capture timeout for the mono camera to 1500 or even 2000 ms until the node runs without capture timeouts.

belalhmedan90 commented 7 months ago

Okay. There is actually a small bug in our Python compatibility layer, hence the AttributeError in the script. Fixed in e4b1cc4. But that does not fix the capture timeout.

I currently switched to Ubuntu 22.04 and have no working ROS setup yet. I can try to look into this today, but I do not want to promise that there will be enough time so close to the christmas holidays.

Have you tried reducing the number of images captured by the stereo camera? This can be achieved via the FlexView parameter. I just looked into the ensenso_stereo.json file that you provided yesterday. There it is set to 4. You can simply turn it off by setting it to false as described here.

Furthermore, please try increasing the capture timeout for the mono camera to 1500 or even 2000 ms until the node runs without capture timeouts.

I tested with FlexView both enabled/disabled, it doesn't solve the problem, same goes for timeout up to 2000.

benthie commented 7 months ago

Okay, that sounds interesting. Could you please upload an .nxlog file with FlexView=false and timeout 2000?

belalhmedan90 commented 6 months ago

This problem is solved with SDK 3.6 and POE++ adapter to power the camera.

belalhmedan90 commented 5 months ago

Hi, this problem appeared with me again while testing the C57-6-S Serial number: "233076", I have disabled nxView, increased capture timeout to 2000, here is a full log:

started roslaunch server http://NEURA-713:35161/

SUMMARY
========

PARAMETERS
 * /DIP_Register/queue_size: 5
 * /Ensenso_request_data_linked/mono_ns: mono
 * /Ensenso_request_data_linked/stereo_ns: stereo
 * /mono/Ensenso_233076_Color/capture_timeout: 2000
 * /mono/Ensenso_233076_Color/link_frame: 
 * /mono/Ensenso_233076_Color/serial: 233076-Color
 * /mono/Ensenso_233076_Color/settings: 
 * /mono/Ensenso_233076_Color/wait_for_camera: False
 * /rosdistro: noetic
 * /rosversion: 1.16.0
 * /stereo/Ensenso_233076/camera_frame: 
 * /stereo/Ensenso_233076/link_frame: 
 * /stereo/Ensenso_233076/serial: 233076
 * /stereo/Ensenso_233076/settings: 
 * /stereo/Ensenso_233076/target_frame: 
 * /stereo/Ensenso_233076/tcp_port: -1
 * /stereo/Ensenso_233076/threads: -1
 * /stereo/Ensenso_233076/wait_for_camera: False

NODES
  /
    DIP_Register (nodelet/nodelet)
    Ensenso_request_data_linked (ensenso_camera/request_data_linked)
    manager_ (nodelet/nodelet)
  /mono/
    Ensenso_233076_Color (nodelet/nodelet)
  /stereo/
    Ensenso_233076 (nodelet/nodelet)

auto-starting new master
process[master]: started with pid [447366]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to abfb9dd6-c010-11ee-81c7-33c216a155c9
process[rosout-1]: started with pid [447387]
started core service [/rosout]
process[manager_-2]: started with pid [447394]
process[stereo/Ensenso_233076-3]: started with pid [447395]
process[mono/Ensenso_233076_Color-4]: started with pid [447396]
process[Ensenso_request_data_linked-5]: started with pid [447397]
process[DIP_Register-6]: started with pid [447398]
[ INFO] [2024-01-31 08:13:53]: Loading nodelet /stereo/Ensenso_233076 of type ensenso_camera/stereo_camera_node to manager /manager_ with the following remappings:
[ INFO] [2024-01-31 08:13:53]: waitForService: Service [/manager_/load_nodelet] has not been advertised, waiting...
[ INFO] [2024-01-31 08:13:53]: Loading nodelet /mono/Ensenso_233076_Color of type ensenso_camera/mono_camera_node to manager /manager_ with the following remappings:
[ INFO] [2024-01-31 08:13:53]: waitForService: Service [/manager_/load_nodelet] has not been advertised, waiting...
[ INFO] [2024-01-31 08:13:53]: Loading nodelet /DIP_Register of type depth_image_proc/register to manager /manager_ with the following remappings:
[ INFO] [2024-01-31 08:13:53]: /depth/camera_info -> /stereo/depth/camera_info
[ INFO] [2024-01-31 08:13:53]: /depth/image_rect -> /stereo/depth/image
[ INFO] [2024-01-31 08:13:53]: /depth_registered/camera_info -> /camera/aligned_depth_to_color/camera_info
[ INFO] [2024-01-31 08:13:53]: /mono/rectified/image -> /mono/depth/image
[ INFO] [2024-01-31 08:13:53]: /rgb/camera_info -> /mono/rectified/camera_info
[ INFO] [2024-01-31 08:13:53]: /stereo/depth/image -> /camera/aligned_depth_to_color/image_raw
[ INFO] [2024-01-31 08:13:53]: Initializing nodelet with 12 worker threads.
[ INFO] [2024-01-31 08:13:53]: waitForService: Service [/manager_/load_nodelet] has not been advertised, waiting...
[ INFO] [2024-01-31 08:13:53]: waitForService: Service [/manager_/load_nodelet] is now available.
[ INFO] [2024-01-31 08:13:53]: waitForService: Service [/manager_/load_nodelet] is now available.
[ INFO] [2024-01-31 08:13:53]: waitForService: Service [/manager_/load_nodelet] is now available.
[ INFO] [2024-01-31 08:13:55]: Opened camera with serial number '233076'.
[ INFO] [2024-01-31 08:13:58]: Opened camera with serial number '233076-Color'.
[ WARN] [2024-01-31 08:13:58]: Camera 233076-Color has an internal link (i.e. it is either extrinsically calibrated (workspace- or hand-eye) or has a link to another camera), but camera and target frame are equal, which means that neither a link nor a target frame has been provided. The images and 3d data retreived from the camera are transformed by the NxLib with the transform stored in the camera's link node, however, this transform is not known to tf. Please provide a link or target frame in order for the transform to be published.
[ERROR] [2024-01-31 08:14:13]: NxLibException 17 (ExecutionFailed) for item /Execute/233076
[ERROR] [2024-01-31 08:14:13]: CaptureTimeout: Waiting for images timed out.
[WARN] [2024-01-31 09:14:13]: Stereo action was not successful.
Traceback (most recent call last):
  File "/home/belalhmedan/ids_ws/devel/lib/ensenso_camera/request_data_linked", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/home/belalhmedan/ids_ws/src/ensenso_camera/scripts/request_data_linked", line 65, in <module>
    main()
  File "/home/belalhmedan/ids_ws/src/ensenso_camera/scripts/request_data_linked", line 61, in main
    ros2py.wrap_main_function(_main, "ensenso_camera_request_data_linked")
  File "/home/belalhmedan/ids_ws/src/ensenso_camera/src/ensenso_camera/ros2.py", line 304, in wrap_main_function
    main(node_name)
  File "/home/belalhmedan/ids_ws/src/ensenso_camera/scripts/request_data_linked", line 57, in _main
    ros2py.execute_at_rate(node, main_loop, loop_rate)
  File "/home/belalhmedan/ids_ws/src/ensenso_camera/src/ensenso_camera/ros2.py", line 406, in execute_at_rate
    func()
  File "/home/belalhmedan/ids_ws/src/ensenso_camera/scripts/request_data_linked", line 47, in main_loop
    node.get_logger().error(ros2py.format_error(stereo_result.error, "Error while acquiring stereo data!"))
AttributeError: module 'ensenso_camera.ros2' has no attribute 'format_error'
[Ensenso_request_data_linked-5] process has died [pid 447397, exit code 1, cmd /home/belalhmedan/ids_ws/devel/lib/ensenso_camera/request_data_linked __name:=Ensenso_request_data_linked __log:=/home/belalhmedan/.ros/log/abfb9dd6-c010-11ee-81c7-33c216a155c9/Ensenso_request_data_linked-5.log].
log file: /home/belalhmedan/.ros/log/abfb9dd6-c010-11ee-81c7-33c216a155c9/Ensenso_request_data_linked-5*.log
benthie commented 5 months ago

Are you still on branch mono-capture-timeout? Or at least have included commit 647eee0f8c7078864493112953000c04d79a379e in your current branch? I am asking because I am not seeing the capture timeout being printed by the node and I can still see the "AttributeError" bug, which has also been fixed on that branch.

We are soon releasing a bug fix for SDK 3.6 and are planning to release a new version of this driver which includes the mono capture timeout.