Running 2 different cameras using usb_cam
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:
<launch>
<group ns="camera1">
<node name="usb_cam1" pkg="usb_cam" type="usb_cam_node" output="screen" >
<param name="video_device" value="/dev/video1" />
<param name="image_width" value="640" />
<param name="image_height" value="480" />
<param name="pixel_format" value="mjpeg" />
<param name="camera_frame_id" value="usb_cam" />
<param name="io_method" value="mmap"/>
</node>
<node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen">
<remap from="image" to="/usb_cam/image_raw"/>
<param name="autosize" value="true" />
</node>
</group>
<group ns="camera2">
<node name="usb_cam2" pkg="usb_cam" type="usb_cam_node" output="screen" >
<param name="video_device" value="/dev/video2" />
<param name="image_width" value="640" />
<param name="image_height" value="480" />
<param name="pixel_format" value="mjpeg" />
<param name="camera_frame_id" value="usb_cam" />
<param name="io_method" value="mmap"/>
</node>
<node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen">
<remap from="image" to="/usb_cam/image_raw"/>
<param name="autosize" value="true" />
</node>
</group>
</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] (image_raw:3356): Gtk-WARNING *: Unable to locate theme engine in module_path: "adwaita", (image_raw:3376): Gtk-WARNING *: Unable to locate theme engine in module_path: "adwaita",
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.
Hi Sir, I used you method for my dual usb cameras and it works very well. However, in the terminal it throws heaps of the following warnings. Any idea how to solve it? Thanks [swscaler @ 0x2be20a0] deprecated pixel format used, make sure you did set range correctly