[Solved] Setting Ricoh Theta Z1 with CV_Camera

Hi!

I am using a Ricoh Theta Z1 camera with a Husarion Panther. (ROS Noetic, Ubuntu 20.04)
I am trying to get cv_camera running and in the future yolov3. I followed the tutorial available in your website for this: Setting up RICOH THETA Z1 | Husarion

I installed v4l2loopback, gstreamer1.0 packages and libuvc-theta + libuvc-theta-sample packages.

Although I can see the feed from the camera if I use gst_viewer without problems, i run into problems when I try to use cv_camera with it.

When I run ls /dev | grep video i get back video0.

After I installed cv_camera package I tried to set up the camera device do use and run the node:
rosparam set cv_camera/device_id 0
rosrun cv_camera cv_camera_node

I got this error instead
WARN:0] global …/modules/videoio/src/cap_gstreamer.cpp (1758) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
[ WARN:0] global …/modules/videoio/src/cap_gstreamer.cpp (888) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global …/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
[ WARN:0] global …/modules/videoio/src/cap_v4l.cpp (887) open VIDEOIO(V4L2:/dev/video0): can’t open camera by index
[ERROR] [1623689901.478565848]: cv camera open failed: device_id0 cannot be opened

The results of running ls -l /dev/video* are crw-rw----+ 1 root video 81, 0 Jun 14 17:19 /dev/video0

Can you give me a hand?

Best regards,

Mário

Hi mmor,

if gst_viewer works this means low level drivers should work correctly. It seems like the issue is related to v4l2loopback.
Could you send me configuration of your gst_viewer.c from lines 187 to 190?
Also is your camera connected to a computer with x86 architecture? It is crucial since our tutorial doesn’t cover other architectures.

Best regards,
Krzysztof Wojciechowski.

Hey Krzysztof.

The architecture of the computer is x86_64 (default NUC in Panther)

The gst_viewer.c configuration info you requested is the following:

if (strcmp(cmd_name, “gst_loopback”) == 0)
pipe_proc = "decodebin ! autovideoconvert ! "
“video/x-raw,format=I420 ! identity drop-allocation=true !”
“v4l2sink device=/dev/video0 quos=false sync=false”;

Best regards,

Mário

Hi,

so far configuration looks all right. At this point may I log to your robot and try to check configuration myself?
I’ve sent you a private message with more details.

If you are not willing to let me log into your robot we can try solving this issue in a different way.

Best regards,
Krzysztof Wojciechowski.

Hi!
I’ve answered your message. Thank you for your availability!
Best regards,
Mário

Problem is solved. It turned out the robot had connected a second camera which is Intel Realsense.
The Intel camera opened a few more video loopbacks that interfered with loopback for THETA. Due to this interference cv_camera was unable to open the video0 port.

Solution is to attach THETA to different loopbacks or change Realsense video loopbacks.

Best regards,
Krzysztof Wojciechowski.

1 Like