Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 118

Running 2 different cameras using usb_cam

$
0
0
Hello, I'm using the usb_cam package and I'm trying to launch my 2 cameras at the same time. I'm using the following launch file:
&ltlaunch>&ltgroup ns="camera1">&ltnode name="usb_cam1" pkg="usb_cam" type="usb_cam_node" output="screen" >&ltparam name="video_device" value="/dev/video1" />&ltparam name="image_width" value="640" />&ltparam name="image_height" value="480" />&ltparam name="pixel_format" value="mjpeg" />&ltparam name="camera_frame_id" value="usb_cam" />&ltparam name="io_method" value="mmap"/>&lt/node>&ltnode name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen">&ltremap from="image" to="/usb_cam/image_raw"/>&ltparam name="autosize" value="true" />&lt/node>&lt/group>&ltgroup ns="camera2">&ltnode name="usb_cam2" pkg="usb_cam" type="usb_cam_node" output="screen" >&ltparam name="video_device" value="/dev/video2" />&ltparam name="image_width" value="640" />&ltparam name="image_height" value="480" />&ltparam name="pixel_format" value="mjpeg" />&ltparam name="camera_frame_id" value="usb_cam" />&ltparam name="io_method" value="mmap"/>&lt/node>&ltnode name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen">&ltremap from="image" to="/usb_cam/image_raw"/>&ltparam name="autosize" value="true" />&lt/node>&lt/group>&lt/launch>
I see that my two cameras launch (there is a light that turns on) but I don't get any images. My terminal gives me this msg:
$ roslaunch 2cams_test.launch 
... logging to /home/davicho/.ros/log/3a1f0a6e-6889-11e5-8461-0071cc3abcf5/roslaunch-davicho-3304.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://davicho:51904/

SUMMARY
========

PARAMETERS
 * /camera1/image_view/autosize: True
 * /camera1/usb_cam1/camera_frame_id: usb_cam
 * /camera1/usb_cam1/image_height: 480
 * /camera1/usb_cam1/image_width: 640
 * /camera1/usb_cam1/io_method: mmap
 * /camera1/usb_cam1/pixel_format: mjpeg
 * /camera1/usb_cam1/video_device: /dev/video1
 * /camera2/image_view/autosize: True
 * /camera2/usb_cam2/camera_frame_id: usb_cam
 * /camera2/usb_cam2/image_height: 480
 * /camera2/usb_cam2/image_width: 640
 * /camera2/usb_cam2/io_method: mmap
 * /camera2/usb_cam2/pixel_format: mjpeg
 * /camera2/usb_cam2/video_device: /dev/video2
 * /rosdistro: indigo
 * /rosversion: 1.11.13

NODES
  /camera2/
    image_view (image_view/image_view)
    usb_cam2 (usb_cam/usb_cam_node)
  /camera1/
    image_view (image_view/image_view)
    usb_cam1 (usb_cam/usb_cam_node)

auto-starting new master
process[master]: started with pid [3316]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 3a1f0a6e-6889-11e5-8461-0071cc3abcf5
process[rosout-1]: started with pid [3329]
started core service [/rosout]
process[camera1/usb_cam1-2]: started with pid [3346]
process[camera1/image_view-3]: started with pid [3356]
process[camera2/usb_cam2-4]: started with pid [3357]
process[camera2/image_view-5]: started with pid [3376]
[ INFO] [1443737430.656950901]: Using transport "raw"

(image_raw:3356): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",
[ INFO] [1443737430.778414332]: Using transport "raw"

(image_raw:3376): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",
[ INFO] [1443737431.047213737]: using default calibration URL
[ INFO] [1443737431.047358391]: camera calibration URL: file:///home/davicho/.ros/camera_info/head_camera.yaml
[ INFO] [1443737431.047471646]: Unable to open camera calibration file [/home/davicho/.ros/camera_info/head_camera.yaml]
[ WARN] [1443737431.047526261]: Camera calibration file /home/davicho/.ros/camera_info/head_camera.yaml not found.
[ INFO] [1443737431.047583711]: Starting 'head_camera' (/dev/video1) at 640x480 via mmap (mjpeg) at 30 FPS
[ WARN] [1443737431.075626997]: unknown control 'focus_auto'

[ERROR] [1443737431.076149773]: Webcam: expected picture but didn't get it...
[ INFO] [1443737431.082241865]: using default calibration URL
[ INFO] [1443737431.082405128]: camera calibration URL: file:///home/davicho/.ros/camera_info/head_camera.yaml
[ INFO] [1443737431.082533707]: Unable to open camera calibration file [/home/davicho/.ros/camera_info/head_camera.yaml]
[ WARN] [1443737431.082587458]: Camera calibration file /home/davicho/.ros/camera_info/head_camera.yaml not found.
[ INFO] [1443737431.082646527]: Starting 'head_camera' (/dev/video2) at 640x480 via mmap (mjpeg) at 30 FPS
[ WARN] [1443737431.111333288]: unknown control 'focus_auto'

[ERROR] [1443737431.111752759]: Webcam: expected picture but didn't get it...

Why is this happening? I've been reading about launch files, and I understood that by using two different nodes this would be able to launch multiple cameras, but I'm not succeeding. Thanks in advance.

Viewing all articles
Browse latest Browse all 118

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>