Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream stops working after a few seconds #75

Open
breqdev opened this issue Jan 24, 2025 · 0 comments
Open

Stream stops working after a few seconds #75

breqdev opened this issue Jan 24, 2025 · 0 comments

Comments

@breqdev
Copy link

breqdev commented Jan 24, 2025

Hi there!

I'm having an issue using rosimagesrc with the usb_cam package. Right now, my setup includes:

  • An Arducam B0292 camera
  • The usb_cam_node_exe node running, outputting /usb_cam/image_raw and /usb_cam/image_raw/compressed (among other topics)
  • A GStreamer pipeline using rosimagesrc to pull images from usb_cam_node_exe.
  • RMW_IMPLEMENTATION set to rmw_cyclonedds_cpp, and all nodes running on the same host

I'm able to run rqt_image_view and subscribe to /usb_cam/image_raw/compressed to view the camera stream continuously, and I'm also able to ros2 topic echo /usb_cam/image_raw to validate that image data is being published continuously on that topic. I get the expected framerate of around 30 fps.

However, when I try to run the example pipeline (or any pipeline with rosimagesrc) on this input, the pipeline works normally for a few seconds and then stalls:

Full command output
rover@base-station:~/rover/ros2_ws (main) $ gst-launch-1.0 --gst-plugin-path=/home/rover/rover/submodule_ws/install/gst_bridge/lib/gst_bridge -v rosimagesrc ros-topic="/usb_cam/image_
raw" ! gamma gamma=2.0 ! rosimagesink ros-topic="image_gamma_corrected"
Setting pipeline to PAUSED ...
[WARN] [1737742017.110227812] [rclcpp]: logging was initialized more than once
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
[INFO] [1737742017.113722520] [gst_image_src_node]: getcaps with filter 'NULL'
[INFO] [1737742017.113760172] [gst_image_src_node]: waiting for first message
[INFO] [1737742017.113740118] [gst_image_src_node]: stream_start at 1737742017113739577
New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:22.872195157
Setting pipeline to NULL ...
^C
rover@base-station:~/rover/ros2_ws (main) $ gst-launch-1.0 --gst-plugin-path=/home/rover/rover/submodule_ws/install/gst_bridge/lib/gst_bridge -v rosimagesrc ros-topic="/usb_cam/image_raw" ! gamma gamma=2.0 ! rosimagesink ros-topic="image_gamma_corrected"
Setting pipeline to PAUSED ...
[WARN] [1737742041.009261417] [rclcpp]: logging was initialized more than once
Pipeline is live and does not need PREROLL ...
[INFO] [1737742041.013471393] [gst_image_src_node]: getcaps with filter 'NULL'
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
[INFO] [1737742041.013504321] [gst_image_src_node]: waiting for first message
[INFO] [1737742041.013539688] [gst_image_src_node]: stream_start at 1737742041013538869
New clock: GstSystemClock
[INFO] [1737742041.022241014] [gst_image_src_node]: preparing video with caps 'video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1'
[INFO] [1737742041.022349229] [gst_image_sink_node]: preparing video with caps 'video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1'
[INFO] [1737742041.022364850] [gst_image_sink_node]: setcaps format string is RGB 
[INFO] [1737742041.022370069] [gst_image_sink_node]: setcaps n_components is 3
[INFO] [1737742041.022374342] [gst_image_sink_node]: setcaps bits is 8
[INFO] [1737742041.022378514] [gst_image_sink_node]: setcaps pixel_stride is 3
/GstPipeline:pipeline0/Rosimagesrc:rosimagesrc0.GstPad:src: caps = video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1
/GstPipeline:pipeline0/GstGamma:gamma0.GstPad:src: caps = video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1
/GstPipeline:pipeline0/Rosimagesink:rosimagesink0.GstPad:sink: caps = video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1
/GstPipeline:pipeline0/GstGamma:gamma0.GstPad:sink: caps = video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1
Redistribute latency...
WARNING: from element /GstPipeline:pipeline0/Rosimagesink:rosimagesink0: Pipeline construction is invalid, please add queues.
Additional debug info:
../libs/gst/base/gstbasesink.c(1249): gst_base_sink_query_latency (): /GstPipeline:pipeline0/Rosimagesink:rosimagesink0:
Not enough buffering available for  the processing deadline of 0:00:00.020000000, add enough queues to buffer  0:00:00.020000000 additional data. Shortening processing latency to 0:00:00.000000000.
WARNING: from element /GstPipeline:pipeline0/Rosimagesink:rosimagesink0: Pipeline construction is invalid, please add queues.
Additional debug info:
../libs/gst/base/gstbasesink.c(1249): gst_base_sink_query_latency (): /GstPipeline:pipeline0/Rosimagesink:rosimagesink0:
Not enough buffering available for  the processing deadline of 0:00:00.020000000, add enough queues to buffer  0:00:00.020000000 additional data. Shortening processing latency to 0:00:00.000000000.
[INFO] [1737742041.023934638] [gst_image_sink_node]: stream_start at 1737742041023931735
0:00:01.5 / 99:99:99.

Since a few of the error messages point to queue elements being needed, I tried adding those to the pipeline. This removed those errors but the pipeline still stopped working after a few seconds:

rover@base-station:~/rover/ros2_ws (main) $ gst-launch-1.0 --gst-plugin-path=/home/rover/rover/submodule_ws/install/gst_bridge/lib/gst_bridge -v rosimagesrc ros-topic="/usb_cam/image_raw" ! queue ! gamma gamma=2.0 ! queue ! rosimagesink ros-topic="image_gamma_corrected"
Setting pipeline to PAUSED ...
[WARN] [1737742649.164740571] [rclcpp]: logging was initialized more than once
Pipeline is live and does not need PREROLL ...
[INFO] [1737742649.168812727] [gst_image_src_node]: getcaps with filter 'NULL'
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
[INFO] [1737742649.168850048] [gst_image_src_node]: waiting for first message
[INFO] [1737742649.168911356] [gst_image_src_node]: stream_start at 1737742649168910494
New clock: GstSystemClock
[INFO] [1737742649.173977409] [gst_image_src_node]: preparing video with caps 'video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1'
/GstPipeline:pipeline0/Rosimagesrc:rosimagesrc0.GstPad:src: caps = video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1
/GstPipeline:pipeline0/GstGamma:gamma0.GstPad:src: caps = video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1
/GstPipeline:pipeline0/GstGamma:gamma0.GstPad:sink: caps = video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:src: caps = video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1
[INFO] [1737742649.174237272] [gst_image_sink_node]: preparing video with caps 'video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1'
[INFO] [1737742649.174275157] [gst_image_sink_node]: setcaps format string is RGB 
[INFO] [1737742649.174292274] [gst_image_sink_node]: setcaps n_components is 3
[INFO] [1737742649.174297083] [gst_image_sink_node]: setcaps bits is 8
[INFO] [1737742649.174301898] [gst_image_sink_node]: setcaps pixel_stride is 3
/GstPipeline:pipeline0/Rosimagesink:rosimagesink0.GstPad:sink: caps = video/x-raw, format=(string)RGB, height=(int)480, width=(int)640, framerate=(fraction)0/1
Redistribute latency...
[INFO] [1737742649.176075218] [gst_image_sink_node]: stream_start at 1737742649176073268
0:00:08.6 / 99:99:99.

After the pipeline stops, hitting Ctrl+C does not always stop GStreamer and I need to press Ctrl+\ twice in order to exit.

^\Caught SIGQUIT
Spinning.  Please run 'gdb gst-launch-1.0 81547' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.
^\Quit (core dumped)

I also tried running with FastDDS instead of CycloneDDS and saw a different failure mode, in which I receive an image only about every 10-20 seconds or so (much lower than the consistent ~30fps with rqt_image_view). I don't believe this is due to slow processing -- I'm streaming at only 480p on a 13th gen i9 laptop.

Any thoughts as to why this might be happening or how I could debug the issue further?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant