root@robot:~# rosdep install camera1394
ERROR: Rosdep cannot find all required resources to answer your query
Missing resource camera1394
ROS path [0]=/opt/ros/fuerte/share/ros
ROS path [1]=/opt/ros/fuerte/share
ROS path [2]=/opt/ros/fuerte/stacks
解决办法:可在ubuntu软件中心先安装
IEEE 1394 Digital Camera driver
注意所选择的驱动,别选择错误了
**********************************************************************************************
Bumblebee:
# rosrun camera1394 camera1394_node _guid:=00b09d0100c7b4ec _video_mode:=1024x768_rgb8 _iso_speed:=400 _frame_rate:=10 ********************************************************************$ rosrun camera1394 camera1394_node _guid:=08144361026320a0 _video_mode:=640x480_mono8 _iso_speed:=400 _frame_rate:=30 [ INFO] [1276368181.508444956]: Found camera with GUID 8144361026320a0 [ INFO] [1276368181.508796118]: camera model: Unibrain Fire-i BCL 1.2 [ INFO] [1276368181.512701922]: [08144361026320a0] opened: 640x480_mono8, 30 fps, 400 Mb/s [ WARN] [1276368181.737658512]: [08144361026320a0] calibration does not match video mode (publishing uncalibrated data)
********************************************************************************
root@robot:~# rosrun camera1394 camera1394_node _guid:=00b09d0100c7b4ec _video_mode:=1024x768_rgb8 _iso_speed:=400 _frame_rate:=10
[ INFO] [1376390707.204376474]: Found camera with GUID 00b09d0100c7b4ec
[ INFO] [1376390707.204527019]: camera model: Point Grey Research Bumblebee2 BB2-08S2C
[ INFO] [1376390707.209439281]: [00b09d0100c7b4ec] opened: 1024x768_rgb8, 7.5 fps, 400 Mb/s
[ INFO] [1376390707.810193818]: using default calibration URL
[ INFO] [1376390707.810299502]: camera calibration URL: file:///home/robot/.ros/camera_info/00b09d0100c7b4ec.yaml
[ERROR] [1376390707.810419221]: Unable to open camera calibration file [/home/robot/.ros/camera_info/00b09d0100c7b4ec.yaml]
[ WARN] [1376390707.810477806]: Camera calibration file /home/robot/.ros/camera_info/00b09d0100c7b4ec.yaml not found.
[ WARN] [1376390707.810517929]: [00b09d0100c7b4ec] calibration does not match video mode (publishing uncalibrated data)
出现这样的错误意思是:00b09d0100c7b4ec.yaml文件没有找到
Start camera1394 and cameracalibration with the following launch file:
<launch> <group ns="stereo"> <node pkg="camera1394" type="camera1394_node" name="camera_left"> <rosparam file="$(find stereo_calibration)/cameras/left_flea2.yaml"/> <remap from="camera" to="left"/> </node> </group> <node pkg="camera_calibration" type="cameracalibrator.py" name="mono_calibration" args="-size 9x6 -square 0.054 image:=/stereo/left/image_raw camera:=/stereo/left"> </node> </launch>
and the following yaml file:
# ID number of camera. Use Coriander to find it. guid: xxxxxxxxxxxxxxxx # Mode describes the size and number of channels for the images. video_mode: 1600x1200_mono8 # The frame_id MUST be part of your URDF to display stereo data correctly in Rviz. frame_id: left_camera # The location of the ROS calibration file. camera_info_url: package://stereo_calibration/cameras/xxxxxxxxxxxxxxxx_mono.yaml # Frames per second. frame_rate: 30 # Try to reset the camera when opening. reset_on_open: true # Change from default 400Mbps Firewire. iso_speed: 800
So far so good, as I get the utility to show up, all the bars go green, I can click 'Save' and 'Commit', and then exit out of the launch file.
There is a file created at /tmp/calibrationdata.tar.gz that I am able to open and see 74 images plus a file named ost.txt. Using the converter utility I am able to get a yaml file with the following contents:
image_width: 1600 image_height: 1200 camera_name: narrow_stereo/left camera_matrix: rows: 3 cols: 3 data: [2379.692159, 0, 810.664016, 0, 2364.724193, 565.047935, 0, 0, 1] distortion_model: plumb_bob distortion_coefficients: rows: 1 cols: 5 data: [-0.125793, 0.149249, -0.000565, -0.000972, 0] rectification_matrix: rows: 3 cols: 3 data: [1, 0, 0, 0, 1, 0, 0, 0, 1] projection_matrix: rows: 3 cols: 4 data: [2348.257291, 0, 809.568039, 0, 0, 2344.569053, 563.818346, 0, 0, 0, 1, 0]
I modified the camera_name
field to be stereo/left
but it made no difference in the errors described below.
bumblebee launch 文件 :
<!-- -*- mode: XML -*- -->
<launch>
<node pkg="bumblebee2" type="bumblebee2" name="bumblebee2"
output="screen" respawn="false">
<param name="video_mode" value="1024x768_stereo_mono" />
<param name="fps" value="15" />
<param name="gain" value="auto" />
<param name="brightness" value="auto" />
<param name="whitebalance" value="auto" />
<param name="shutter" value="auto" />
<param name="bayer_pattern" value="NONE" />
<param name="bayer_method" value="NONE" />
</node>
</launch>
*******************************************************************************************************************************************************
目录
Start by getting the dependencies and compiling the driver.
$ rosdep install camera1394 $ rosmake camera1394
This driver only supports cameras meeting the IIDC standard. Attach the camera to the IEEE 1394 interface using an appropriate cable. If you are not familiar with IEEE 1394 cables and connectors, see the Wikipedia entry,which explains the various standards and versions. Most cameras can receive power from the bus, but the 4-pin cable connectors found on many laptops do not provide power. In that case, provide power to the camera over whatever separate connector is provided by the manufacturer.
Usually, the best tool for checking connectivity to IIDC cameras iscoriander.
To install it on Ubuntu systems:
$ sudo apt-get install coriander
Other Linux distributions provide some similar command.
Run the coriander program:
$ coriander
This should bring up a graphical interface. The Camera Select pull-down shows all IIDC cameras attached to the computer.
Coriander may fail with a permission error on many Linux distributions. If so,change the permissions for/dev/raw1394 to allow access for your user ID.
Select the desired camera. Note the sixteen hexadecimal digits of its GUID, in this example, 08144361026320a0.
Now click on the Services tab. The Format pull-down lists the video formats provided by that device.
Select the desired mode, the ISO Control speed, and frames per second (fps) rate. Then, verify that the camera works by pressing the Display button.
Now, start the camera1394 driver using the parameters discovered bycoriander.
$ rosrun camera1394 camera1394_node _guid:=08144361026320a0 _video_mode:=640x480_mono8 _iso_speed:=400 _frame_rate:=30 [ INFO] [1276368181.508444956]: Found camera with GUID 8144361026320a0 [ INFO] [1276368181.508796118]: camera model: Unibrain Fire-i BCL 1.2 [ INFO] [1276368181.512701922]: [08144361026320a0] opened: 640x480_mono8, 30 fps, 400 Mb/s [ WARN] [1276368181.737658512]: [08144361026320a0] calibration does not match video mode (publishing uncalibrated data)
Ignore the warning message for now. Later, we'll cover camera calibration.
This shows the topics being published:
$ rostopic list
The list should include (at least):
/camera/camera_info /camera/image_raw /camera1394_node/parameter_descriptions /camera1394_node/parameter_updates
First, build image_view. In a new window, run:
$ rosmake image_view
Then, run image_view to see the images being published:
$ rosrun image_view image_view image:=camera/image_raw
We started the camera with all of its default settings. For some cameras that generates a good image automatically. Others may require parameter adjustments. Later tutorials explain how to set them.
If you have a color camera, the image may be black and white with a strange texture. Many IIDC color cameras publish images using aBayer pattern. If the camera does use Bayer filtering, you'll want to read theSetting Bayer Parameters tutorial. If the camera does not use Bayer encoding, you can skip that one.
First, build image_proc. In a new window, run:
$ rosmake image_proc
Then, run image_proc in the camera namespace to process the images being published:
$ ROS_NAMESPACE=camera rosrun image_proc image_proc
This should not output any messages if it's working correctly. But, it should publish a whole list of new topics. To verify that, in another window, run:
$ rostopic list
The list of topics should now include these (and perhaps some others):
/camera/image_color /camera/image_mono /camera/image_rect /camera/image_rect_color
To view the image_proc output, in another terminal run:
$ rosrun image_view image_view image:=camera/image_mono
The image_color topic requires us toconfigure the camera to produce color images. The image_rect andimage_rect_color topics require us tocalibrate the camera. Those tasks are explained in later tutorials.