image_view for ubuntu server 20.04
hello i am new to ROS , i am trying to view camera output which is publish by a topic and can be view using following command
rosrun image_view image_view image:=/camera
however i am getting error as following
Unable to init server: Could not connect: Connection refused
(camera:5432): Gtk-WARNING **: 11:53:30.098: cannot open display:
Segmentation fault (core dumped)
i am using rapsberry pi 3 b+ with picamera , ros version: noetic installed on ubuntu server 20.04. i am not sure whether image_view command pop up a new window to show the camera output bec i am not using desktop version .do i need to intstall ubuntu desktop version to view the output?
Asked by kartiki on 2021-07-27 01:39:18 UTC
Answers
Hello,
Did you check using your normal computer vision code, your camera is working? I think that this is a problem with your OS.
For troubleshooting, try this:
Can you confirm that you are able to see a video of your camera using this code?
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
if (cap.isOpened()== False):
print("Error opening video stream or file")
while(cap.isOpened()):
ret, frame = cap.read()
if ret == True:
cv2.imshow('Frame',frame)
if cv2.waitKey(25) & 0xFF == ord('q'):
break
else:
break
cap.release()
cv2.destroyAllWindows()
If no, then you should raise your question to https://raspberrypi.stackexchange.com/. It's an OS issue.
Asked by Ranjit Kathiriya on 2021-07-28 03:17:36 UTC
Comments
image_view
opens a window, so yes, you'd need a desktop environment. Or at least something which supports opening X windows (or perhaps wayland).If you have another machine, you could start
image_view
there.Alternatively: install a VNC server.
Or, as you already mention: install a DE on the machine you're trying to start
image_view
on.Asked by gvdhoorn on 2021-07-29 03:35:04 UTC