sample-apps-for-robotics-platforms icon indicating copy to clipboard operation
sample-apps-for-robotics-platforms copied to clipboard

VIDIOC_QUERYCAP error 25, Inappropriate ioctl for device

Open jxr041100 opened this issue 3 years ago • 1 comments

in the project ros_tensorflow, when I launch usb_cam, actually I did not have usb camera, and I am using the on-board camera. I encounter this error. "VIDIOC_QUERYCAP error 25, Inappropriate ioctl for device", I google and some people mention to change /dev/video*, because default the code may use 0, now it should be some other number. but I do not where I can make code change for video number.

oslaunch usb_cam usb_cam-test.launch
... logging to /root/.ros/log/fd6000e2-049f-11ec-b3e5-71a88c8a7148/roslaunch-qrb5165-rb5-2792.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://qrb5165-rb5:35665/

SUMMARY
========

PARAMETERS
 * /image_view/autosize: True
 * /rosdistro: melodic
 * /rosversion: 1.14.11
 * /usb_cam/camera_frame_id: usb_cam
 * /usb_cam/image_height: 480
 * /usb_cam/image_width: 640
 * /usb_cam/io_method: mmap
 * /usb_cam/pixel_format: yuyv
 * /usb_cam/video_device: /dev/video0

NODES
  /
    image_view (image_view/image_view)
    usb_cam (usb_cam/usb_cam_node)

ROS_MASTER_URI=http://localhost:11311

process[usb_cam-1]: started with pid [2807]
process[image_view-2]: started with pid [2808]
[ INFO] [1629784609.542736154]: Initializing nodelet with 8 worker threads.
[ INFO] [1629784609.892910738]: Using transport "raw"
Unable to init server: Could not connect: Connection refused

(image_raw:2808): Gtk-WARNING **: 05:56:49.942: cannot open display: 
[ INFO] [1629784609.972609904]: using default calibration URL
[ INFO] [1629784609.973836310]: camera calibration URL: file:///camera_info/head_camera.yaml
[ INFO] [1629784609.974010894]: Unable to open camera calibration file [/camera_info/head_camera.yaml]
[ WARN] [1629784609.974056779]: Camera calibration file /camera_info/head_camera.yaml not found.
[ INFO] [1629784609.974095321]: Starting 'head_camera' (/dev/video0) at 640x480 via mmap (yuyv) at 30 FPS
[ERROR] [1629784609.974304227]: VIDIOC_QUERYCAP error 25, Inappropriate ioctl for device
[usb_cam-1] process has died [pid 2807, exit code 1, cmd /opt/ros/melodic/lib/usb_cam/usb_cam_node __name:=usb_cam __log:=/root/.ros/log/fd6000e2-049f-11ec-b3e5-71a88c8a7148/usb_cam-1.log].
log file: /root/.ros/log/fd6000e2-049f-11ec-b3e5-71a88c8a7148/usb_cam-1*.log
[image_view-2] process has died [pid 2808, exit code 1, cmd /opt/ros/melodic/lib/image_view/image_view image:=/usb_cam/image_raw __name:=image_view __log:=/root/.ros/log/fd6000e2-049f-11ec-b3e5-71a88c8a7148/image_view-2.log].
log file: /root/.ros/log/fd6000e2-049f-11ec-b3e5-71a88c8a7148/image_view-2*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done

jxr041100 avatar Aug 24 '21 06:08 jxr041100

I think in my RB5 device, the usb camera is not /dev/video0, it was video2. you can find this usb camera,

$ v4l2-ctl --list-devices
<Some camera information> (<some usb infomation>):
	/dev/video0
	/dev/video1

then I need to go to usb_cam-test.launch to change the input camera. then I do not have the error.

however, I run the roslaunch usb_cam usb_cam-test.launch, i found another error like "error flushing display, broken pipe"

jxr041100 avatar Aug 28 '21 22:08 jxr041100