Roslaunch usb_cam node error


#1

Hi,when roslaunch usb_cam usb_cam-test.launch ,occur some error.How can i to do?

flytos@flytos:~$ roslaunch usb_cam usb_cam-test.launch
… logging to /home/flytos/.ros/log/c52b5c5a-1df1-11e8-ac3d-001e0630fbe4/roslaunch-flytos-13528.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://flytos:47125/

SUMMARY

PARAMETERS

  • /image_view/autosize: True
  • /rosdistro: kinetic
  • /rosversion: 1.12.6
  • /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

core service [/rosout] found
process[usb_cam-1]: started with pid [13554]
ERROR: cannot launch node of type [image_view/image_view]: image_view
ROS path [0]=/opt/ros/kinetic/share/ros
ROS path [1]=/flyt/flytos/flytcore/share
ROS path [2]=/opt/ros/kinetic/share
[ INFO] [1519980241.317581156]: using default calibration URL
[ INFO] [1519980241.318283730]: camera calibration URL: file:///home/flytos/.ros/camera_info/head_camera.yaml
[ERROR] [1519980241.320089579]: Exception parsing YAML camera calibration:
yaml-cpp: error at line 0, column 0: bad conversion
[ERROR] [1519980241.320590780]: Failed to parse camera calibration from file [/home/flytos/.ros/camera_info/head_camera.yaml]
[ WARN] [1519980241.321032066]: Camera calibration file /home/flytos/.ros/camera_info/head_camera.yaml not found.
[ INFO] [1519980241.321617516]: Starting ‘head_camera’ (/dev/video0) at 640x480 via mmap (yuyv) at 30 FPS
[ WARN] [1519980241.528490628]: unknown control ‘focus_auto’


#2

Can you please check if this file exists?
Run this command in terminal:

ls /home/flytos/.ros/camera_info/head_camera.yaml

If the file exists, I would request you to remove it:

rm /home/flytos/.ros/camera_info/head_camera.yaml


#3

First, thanks for your help! I deleted this file, but the result is still the same. What is wrong?


#4

Hi @Bryan,

Can you please explain what are you exactly trying to achieve?
Moreover, have you gone through this doc.
I would request you to use the launch file mentioned in the above-shared doc.


#5

My goal is to achieve visual SLAM on drones.
I have gone through above doc, and run these commands in terminal :
$ export ROS_NAMESPACE=flytos
$ roslaunch vision_apps cam_api_test.launch
the result is still the same.


#6

flytos@flytos:~$ export ROS_NAMESPACE=flytos
flytos@flytos:~$ roslaunch vision_apps cam_api.launch
… logging to /home/flytos/.ros/log/7c0ca350-210f-11e8-8f18-001e0630fbe4/roslaunch-flytos-29161.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://flytos:51329/

SUMMARY

PARAMETERS

  • /flytos/flytcam/brightness: 20
  • /flytos/flytcam/camera_info_url: file:///flyt/flyt…
  • /flytos/flytcam/framerate: 30
  • /flytos/flytcam/image_height: 480
  • /flytos/flytcam/image_width: 640
  • /flytos/flytcam/pixel_format: yuyv
  • /flytos/flytcam/video_device: /dev/video0
  • /rosdistro: kinetic
  • /rosversion: 1.12.6

NODES
/flytos/
flytcam (usb_cam/usb_cam_node)
image_capture (vision_apps/image_capture)
web_video_server (web_video_server/web_video_server)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[flytos/flytcam-1]: started with pid [29183]
process[flytos/image_capture-2]: started with pid [29184]
process[flytos/web_video_server-3]: started with pid [29185]
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injectorboost::system::system_error >'
what(): bind: Address already in use
[flytos/web_video_server-3] process has died [pid 29185, exit code -6, cmd /flyt/flytos/flytcore/lib/web_video_server/web_video_server __name:=web_video_server __log:=/home/flytos/.ros/log/7c0ca350-210f-11e8-8f18-001e0630fbe4/flytos-web_video_server-3.log].
log file: /home/flytos/.ros/log/7c0ca350-210f-11e8-8f18-001e0630fbe4/flytos-web_video_server-3*.log
[ INFO] [1520323580.956717469]: camera calibration URL: file:///flyt/flytos/flytcore/share/vision_apps/calibration/calibration.yaml
[ WARN] [1520323580.965491165]: [head_camera] does not match name narrow_stereo in file /flyt/flytos/flytcore/share/vision_apps/calibration/calibration.yaml
[ INFO] [1520323580.967524486]: Starting ‘head_camera’ (/dev/video0) at 640x480 via mmap (yuyv) at 30 FPS
[ WARN] [1520323581.225229472]: unknown control ‘focus_auto’

[ERROR] [1520324312.181643991]: VIDIOC_DQBUF error 19, No such device
[flytos/flytcam-1] process has died [pid 29183, exit code 1, cmd /flyt/flytos/flytcore/lib/usb_cam/usb_cam_node __name:=flytcam __log:=/home/flytos/.ros/log/7c0ca350-210f-11e8-8f18-001e0630fbe4/flytos-flytcam-1.log].
log file: /home/flytos/.ros/log/7c0ca350-210f-11e8-8f18-001e0630fbe4/flytos-flytcam-1*.log


#7

The result is definitely NOT same.

Your earlier error was:

Now it is:

Which suggests that you have not plugged any video device in the first place.
Please make sure /dev/video0 is indeed available when you plug your camera.
Moreover, FlytOS when boots up, detects if the camera is connected and available on /dev/video0 and latches on to it. Hence, other processes won’t get access to it.

I would suggest to simply subscribe to camera topics that FlytOS publishes. One of such standard topic is

/<namespace>/flytcam/image_capture