I had a hard time trying to get the stereo vision camera – Bumblebee2 and monocular camera – FireFlyMV from Point Grey, working with Ubuntu 11.10 and ROS Electric. Finally ironed out all the bugs, and wrote this tutorial which takes you step by step to getting it running on my laptop.
I have tested it with the following environment setup:
- Origin PC Eon 15s with Firewire 1394b port
- Point Grey’s Bumblebee2 BB2-03S2C (640×480 at 48 fps and Raw16 pixel format)
- Point Grey’s FireflyMV FMVU-13S2C (1328×1048 at 23FPS, 640×480 at 60 FPS)
- Ubuntu 11.10 (Oneiric)
- ROS Electric
- If you already have a Firewire 1394a/b port in your laptop, then you can ignore this step and move on. If you are using an express card, then you might have to go through the installation and check if firewire functionality works. Make sure that the kernel of the Ubuntu 11.10 OS recognises the express card. I tested this part on a Toshiba Tecra R700 laptop with Bytec Express card BT-ECU2FW which has 2 Firewire and 1 USB port. The express card and firewire functionality did not work out of the box. I followed the instructions from : https://help.ubuntu.com/community/ExpressCard to install my card.
Setup the kernel option for PCI Express Hotplug driver, by opening a Terminal window and typing:
$ sudo modprobe pciehp pciehp_force=1
Then, load the ACPI PCI hotplug driver:
$ sudo modprobe acpiphp
Finally, setup the drivers to be loaded automatically on startup:
$ gksudo gedit /etc/modules
This will open up a file. Add the following line to the end of it:
acpiphp
Save and exit.
Restart the computer.
Once in the OS, remove the express card and plug it back in again. Open a terminal window, and type:$ dmesg
You should see something similar to the following, as reported by “firwire_ohci” and “firewire_core”:
firewire_ohci 0000:03:00.0: enabling device (0000 -> 0003) firewire_ohci 0000:03:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18 firewire_ohci 0000:03:00.0: setting latency timer to 64 firewire_ohci: Added fw-ohci device 0000:03:00.0, OHCI v1.10, 4 IR + 8 IT contexts, quirks 0x11 firewire_core: created device fw0: GUID 001106660000015c, S400
If the firewire_core reports that a device was created, then everything is good to go. Else, your express card was not recognized, and so you may need to troubleshoot this by searching the forums online.
- Check for 32/64-bit processor: Next, you need to figure out whether your computer supports 32-bit or 64-bit applications. This is needed for the next step where we will download a specific archive file depending on the type of support. To find out what your system capability is, in a terminal window type the following command:
$ grep --color=always -iw lm /proc/cpuinfo
If you see lm highlighted in red, then your processor is capable of 64-bit computing.
- Download and install Libdc1394 library:
Install all the packages that will be needed for the following step:sudo apt-get install libraw1394-11 libgtk2.0-0 libgtkmm-2.4-dev libglademm-2.4-dev libgtkglextmm-x11-1.2-dev libusb-1.0-0 libusb-dev libusb-1.0-0-dev libraw1394-dev git autoconf libtool pkg-config libsdl1.2-dev
Now we will grab the source code from the online repository:
cd
git clone git://libdc1394.git.sourceforge.net/gitroot/libdc1394/libdc1394/
cd ~/libdc1394/libdc1394
autoreconf -i -s
./configure
You should see the following output at the end:
Configuration (libdc1394): Linux support: Enabled Legacy drivers (libraw1394): Enabled Mac OS X support: Disabled (Mac OS not detected) Windows support: Disabled (Windows not detected) IIDC-over-USB support: Enabled Build examples: Yes Build SDL/OpenGL examples: Yes Build XV examples: No Build V4L examples: NoIf you do not see the IIDC-over-USB support as enabled, then you would have to re-install libusb packages. FireflyMV cameras implement IIDC 1394-based Digital Camera Specification, so they would not appear in the guvcview utility. However, if the libdc1394 is properly set up with IIDC over USB enabled, they would show up in a program called coriander. We will install coriander later.
sudo make
sudo make install
If for some odd reason the above does not work for you, then you might have to try the harder and NOT PREFERRED way as outlined below. For most users, you can skip the following instructions and move on to the next step. YOu can grab the libdc1394v2 package from online which is needed for working with the sensor. In a new terminal window, type the following in your home directory:
$ svn co http://cornell-ros-pkg.googlecode.com/svn/trunk/bumblebee2/camera_drivers_experimental/libdc1394v2/
Once the download finishes, type the following:
$ cd libdc1394v2/
$ make
You will get the following error, and compilation will terminate:
dc1394_vloopback.c:49:28: fatal error: linux/videodev.h: No such file or directory
To solve this problem, we will open up the file dc1394_vloopback.c and change the naming of the include file. Type the following in the terminal:
$ gedit ~/libdc1394v2/build/libdc1394v2-svn/examples/dc1394_vloopback.c
Go to line number 49, and replace
linux/videodev.h
with
libv4l1-videodev.h
Save and exit.
$ cd ~/libdc1394v2/build/libdc1394v2-svn
$ ./configure
$ sudo make
Everything should compile just fine now.
$ sudo make install
- Installing Coriander to check camera output:
cd
git clone git://coriander.git.sourceforge.net/gitroot/coriander/coriander/
sudo apt-get install ftplib3 ftplib-dev libxv-dev x11proto-video-dev libgnomeui-dev
./configure
sudo make
sudo make install
sudo coriander
This will popup the coriander program, and if you have Bumblebee2 and/or FireflyMV connected then you can view the output. You should see the following window:

Select the Services Tab from above, and make sure Format is Format 7, Mode_3 for Bumblebee2. Under Options, within the same tab, select Nearest as the coding scheme, BGGR Bayer pattern is selected by default, set the stereo coding scheme to St. Interlaced as shown below:

Click on the Display button and you should see another window pop up with the stereo images, one on top of another - Installation of FlyCapture program from PointGrey: Create your own user account at PointGrey’s website, login, and from this link: http://ptgrey.com/support/downloads/download.asp, grab the appropriate 64 bit FlyCapture2 v2.3 Beta 8, archive file from their website, found under the heading of Software and Drivers for Imaging Products (Linux operating systems).
Extract the tar file into the folder where you downloaded it.
Open a terminal and change directory to the extracted archive folder from within the terminal:$ cd ~/Downloads/flycapture2-2.3.1.8-amd64/
Then, type the following to install the program:
$ sudo sh install_flycapture.sh
The installation should finish successfully. Restart the computer.
After reboot, you should now see a menu item for Point Grey Research’s FlyCap 2 program.
Power up your BUmblebee2 sensor and connect the firewire cable.
Launch the Flycap2 application, and you should now see the following Camera Selection window:

Click on the Configure Selected button, and you should now see the following window appear:

From the left hand menu, select Custom Video Modes and on the right hand pane, make sure Mode: 3 is selected. Then click on Apply on the bottom left. You can now close this window. - Install the Bumblebee2 ROS Package: Now we will download the Bumblebee2 ROS package into the home folder, in order to work with the sensor and publish the left and right images as topics. In a new terminal window, type:
$ svn co http://cornell-ros-pkg.googlecode.com/svn/trunk/bumblebee2/
Once the download has finished, type the following in the terminal:
$ rm -rvf ~/bumblebee2/camera_drivers_experimental/libdc1394v2/
We are basically removing the libdc1394v2 folder as we do not need it in that folder anymore (we have already compiled and installed it separately before). Now, we will remove the sr4k folder, which is also not required:
$ rm -rvf ~/bumblebee2/camera_drivers_experimental/sr4k/
Now we will add the locations of libdc1394v2 and bumblebee2 to the ROS_PACKAGE_PATH, so that ROS can find them for the next step of compilation:
$ cd
$ sudo gedit .bashrc
Enter your password when prompted, and add the following two lines to the end of the file:
export ROS_PACKAGE_PATH=~/libdc1394v2:$ROS_PACKAGE_PATH export ROS_PACKAGE_PATH=~/bumblebee2:$ROS_PACKAGE_PATH
Save and exit.
In a new terminal window, type:$ cd ~/bumblebee2/camera_drivers_experimental/
$ rosmake --rosdep-install
The build will succeed, however when you try to launch the stereo camera you will get the following error:
libdc1394 error: Format_7 Error_flag_1 is set: in dc1394_format7_set_roi (format7.c, line 864): Handshaking failed after setting size and position [ WARN] [1334707170.281146370]: Failed to set format7_3 parameters for Bumblebee2 [FATAL] [1334707170.288842875]: [camera] exception opening device: [Camera1394::open]: Failed to open device! Segmentation fault, stopping camera driver.
To solve it, do the following:
$ gedit ~/bumblebee2/camera_drivers_experimental/camera1394/src/dev_camera1394.cpp
Do a search for DC1394_USE_MAX_AVAIL, 0, 0, and following that, replace 1024 with 640, and 768 with 480. Now, search for unsigned int cols = 1024 and replace 1024 with 640, and in the same line 768 with 480. Save and exit.
Type the following in the terminal window:$ cd ~/bumblebee2/camera_drivers_experimental/
$ rosmake --rosdep-install
The build will succeed again.
Next we will edit the calibration files.$ gedit ~/bumblebee2/camera_calibration/bumblebee_left.yaml
Edit the image_width: to be 640 and image_height to be 480. Save and exit.
$ gedit ~/bumblebee2/camera_calibration/bumblebee_right.yaml
Edit the image_width: to be 640 and image_height to be 480. Save and exit.
$ gedit ~/bumblebee2/camera_drivers_experimental/camera1394/launch/bumblebee2.yaml
Edit fps to be 48, bayer_pattern to be BGGR, and ensure bayer_method is Nearest. Next you will have to set the calibration file locations. This will be something like:
settings_url: file:///home/your_user_name/bumblebee2/camera_calibration/bumblebee_right.yaml settings_url2: file:///home/your_user_name/bumblebee2/camera_calibration/bumblebee_left.yaml
Make sure to fill in your user name in the 2 places above. Save and exit.
Next, we will edit the launch file:$ gedit ~/bumblebee2/camera_drivers_experimental/camera1394/launch/startcamera.launch
Find and replace all test_camera with bumblebee2.
Let us launch the stereo camera package now:$ roslaunch camera1394 startcamera.launch
If everything goes well, you will not see any errors. In a new terminal window, you can view the published topics:
$ rostopic list
You should see the following:
/bumblebee2/left/camera_info /bumblebee2/left/image_raw /bumblebee2/left/image_raw/compressed /bumblebee2/left/image_raw/compressed/parameter_descriptions /bumblebee2/left/image_raw/compressed/parameter_updates /bumblebee2/left/image_raw/theora /bumblebee2/left/image_raw/theora/parameter_descriptions /bumblebee2/left/image_raw/theora/parameter_updates /bumblebee2/parameter_descriptions /bumblebee2/parameter_updates /bumblebee2/right/camera_info /bumblebee2/right/image_raw /bumblebee2/right/image_raw/compressed /bumblebee2/right/image_raw/compressed/parameter_descriptions /bumblebee2/right/image_raw/compressed/parameter_updates /bumblebee2/right/image_raw/theora /bumblebee2/right/image_raw/theora/parameter_descriptions /bumblebee2/right/image_raw/theora/parameter_updates /rosout /rosout_agg
In order to view the images, type the following:
$ rosrun image_view image_view image:=/bumblebee2/left/image_raw
In a new terminal window, type the following to view the right camera image:
$ rosrun image_view image_view image:=/bumblebee2/right/image_raw
You should now be able to see both the images.















































