Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

2012/3/7 NTUST Kevin Lin()

GETTING STARTED WITH XTION AND BEAGLE BOARD

Kevin Lin() B9702111@mail.ntust.edu.tw 2012/3/7

2012/3/7 NTUST Kevin Lin()

Outline 1. Porting Ubuntu on your board. 2. Install OpenNI for Xtion/Kinect. 3. Install OpenCV for your board.

Embedded Object tracking system based on xtion and panda board.

2012/3/7 NTUST Kevin Lin()

Porting Ubuntu on your board


1. Prepare

Start Ubuntu in VMware, and insert the SD card into your PC. 2. Download a Complete Pre-Configured Image wget http://rcn-ee.net/deb/rootfs/oneiric/ubuntu-11.10-r6-minimal-armel.tar.xz 3. Unpack the image apt-get install xz-utils tar -vxf ubuntu-11.10-r6-minimal-armel.tar.xz 4. Check your SD card location: sudo ./setup_sdcard.sh --probe-mmc

/dev/sda is the x86 Root file system /dev/sdb is the MMC/SD card 5. Install the image sudo ./setup_sdcard.sh --mmc /dev/sdX --uboot board Check your SD card: /dev/sdX Choose the correct board option:

2012/3/7 NTUST Kevin Lin()

If you want to port on beagleboard-xm, change board to beagle_xm For example: sudo ./setup_sdcard.sh --mmc /dev/sdb --uboot beagle_xm board Options: BeagleBoard Ax/Bx - beagle_bx BeagleBoard Cx - beagle_cx BeagleBoard xMA/B/C - beagle_xm BeagleBone Ax - bone PandaBoard Ax - panda PandaBoard ES - panda_es You should now be able to unmount the SD card from your PC, insert into your board, reboot and have OS loaded as the following figure.

Login: ubuntu

Passwd: temppwd

(Default user)

6. Network Setting sudo vi /etc/network/interfaces Edit as the following sample: 1 auto lo 2 iface lo inet loopback 3 auto eth0 4 iface eth0 inet static 5 address 140.118.20.xxx #depends on your IP address 6 netmask 255.255.255.0 7 gateway 140.118.20.xxx

2012/3/7 NTUST Kevin Lin()

sudo vi /etc/resolv.conf Edit as the following sample: 1 nameserver 140.118.xxx.xxx Restart the network sudo /etc/init.d/networking restart

7. Install GUI on your board (make sure network is setup) sudo apt-get update sudo apt-get install gdm xubuntu-desktop sudo apt-get install xfce4 xubuntu-artwork xserver-xorg-video-omap3 network-manager sudo apt-get install git-core cmake freeglut3-dev pkg-config gcc g++ build-essential libxmu-dev libxi-dev libusb-1.0-0-dev doxygen graphviz git

Now, the desktop is already installed on your beagle/panda board! Please connect your board and screen with the HDMI cable. Notice: Never connect and disconnect HDMI cables and equipment while your devices are powered on (hot plugging ). HDMI cable might be broken

2012/3/7 NTUST Kevin Lin()

For some BeagleBoard-xm touch panel users: We need to adjust the screen resolution. Insert SD card into your PC, and type the following command: sudo vi /media/boot/uEnv.txt Edit as the following sample: 1 bootfile=uImage 2 bootinitrd=uInitrd 3 address_uimage=0x80300000 4 address_uinitrd=0x81600000 5 6 vram=12MB 7 8 console=ttyO2,115200n8 9 10 defaultdisplay=dvi 11 dvimode=800x480MR-16@60 12 13 mmcroot=/dev/mmcblk0p2 ro 14 mmcrootfstype=ext4 rootwait fixrtc 15 optargs=console=tty0 16 17 mmc_load_uimage=fatload mmc 0:1 ${address_uimage} ${bootfile} 18 mmc_load_uinitrd=fatload mmc 0:1 ${address_uinitrd} ${bootinitrd} 19 20 mmcargs=setenv bootargs console=${console} ${optargs} mpurate=${mpurate} buddy=${buddy} buddy2=${buddy2} camera=${camera} vram=${vram} omapfb.mode=${defaultdisplay}:${dvimode} omapdss.def_disp=${defaultdisplay} root=${mmcroot} rootfstype=${mmcrootfstype} 21 22 loaduimage=run mmc_load_uimage; run mmc_load_uinitrd; echo Booting from mmc ...; run mmcargs; bootm ${address_uimage} ${address_uinitrd}

2012/3/7 NTUST Kevin Lin()

Install OpenNI for Xtion/Kinect


1. Download OpenNI( Natural Interaction) module from http://75.98.78.94/Downloads/OpenNIModules.aspx 1. OpenNI BinariesUnstableOpenNI Unstable Build for ARM v1.52.23 2. OpenNI Compliant Hardware BinariesUnstablePrimeSensor Mudule Unstable Build for ARM v5.1.0.41 2. Download NITE Arm Version (for Skeleton Function) https://docs.google.com/file/d/0B84NiCHwiRIMWXByR1lHV2dTaU9NSTU2SzAyaV9V QQ/edit?pli=1 3. Decompress the packages. tar -xvf openni-bin-dev-linux-arm-v1.5.2.23.tar.bz2 tar -xvf sensor-bin-linux-arm-v5.1.0.41.tar.bz2 mkdir nite-arm cd nite-arm tar -xvf ../nite-bin-linux-arm-v1.5.0.1.tar.bz2 4. Install OpenNI Binaries cd Openni-Bin-Dev-Linux-Arm-v1.5.2.23 sudo ./install.sh 5. Install PrimeSense Driver cd Sensor-Bin-Linux-Arm-v5.1.0.41 sudo ./install.sh 6. Install NITE cd nite-arm sudo ./install.sh 7. Run the Sample files To make sure the installation is complete, please plug the xtion to your board and run the pre-compiled OpenNI sample file as following: cd Openni-Bin-Dev-Linux-Arm-v1.5.2.23/ Samples/Bin/Arm-Release sudo ./Sample-NiSimpleRead

2012/3/7 NTUST Kevin Lin()

Sample-NiSimpleRead captures the RGB images from the webcam on the Xtion.

Just enjoy your Xtion/Kinect application.

2012/3/7 NTUST Kevin Lin()

Install OpenCV for your board


1. Remove any installed versions of ffmpeg and x264: sudo apt-get remove ffmpeg x264 libx264-dev 2. Get all the dependencies for x264 and ffmpeg:

sudo apt-get update sudo apt-get install build-essential checkinstall git cmake libfaac-dev libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libva-dev libvdpau-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev texi2html yasm zlib1g-dev 3. Install gstreamer:

sudo apt-get install libgstreamer0.10-0 libgstreamer0.10-dev gstreamer0.10-tools gstreamer0.10-plugins-base libgstreamer-plugins-base0.10-dev gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad gstreamer0.10-ffmpeg 4. Install x264:

git clone git://git.videolan.org/x264 cd x264 ./configure --enable-static --enable-shared make sudo make install 5. Install ffmpeg: Download ffmpeg version 0.8.x from http://ffmpeg.org/download.html. Note: Versions of OpenCV prior to 2.3.1 require ffmpeg 0.7.x. wget http://ffmpeg.org/releases/ffmpeg-0.8.10.tar.bz2 tar xvf ffmpeg-0.8.10.tar.bz2 Configure and build ffmpeg: cd ffmpeg-0.8.10 ./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-shared make

2012/3/7 NTUST Kevin Lin()

sudo make install 6. Install gtk:

sudo apt-get install libgtk2.0-0 libgtk2.0-dev 7. Install libjpeg:

sudo apt-get install libjpeg62 libjpeg62-dev 8. Install v4l (video for linux).

wget http://www.linuxtv.org/downloads/v4l-utils/v4l-utils-0.8.5.tar.bz2 tar xvf v4l-utils-0.8.5.tar.bz2 Build v4l by entering the following commands: make sudo make install 9. Install OpenCV version 2.3.1

wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.3.1/OpenCV-2.3.1 a.tar.bz2 Decompress the source files tar xvf OpenCV-2.3.1a.tar.bz2 cd OpenCV-2.3.1/ mkdir build cd build cmake .. Check that the output of cmake includes the following text: found gstreamer-base-0.10 GTK+ 2.x: YES FFMPEG: YES GStreamer: YES V4L/V4L2: Using libv4l Note: In versions of OpenCV prior to 2.3.1, the binary digit 1 was used instead of the word YES, like this: FFMPEG: 1. make

2012/3/7 NTUST Kevin Lin()

sudo make install 10. Configure Linux. Tell linux where the shared libraries for OpenCV are located by entering the following shell command: export LD_LIBRARY_PATH=/usr/local/lib 11. Add the command to your .bashrc file so that you dont need to enter every time. Alternatively, you can configure the system wide library search path. Using your favorite editor, add a single line containing the text /usr/local/lib to the end of a file named /etc/ld.so.conf.d/opencv.conf. Using vi, for example, enter the following commands: sudo vi /etc/ld.so.conf.d/opencv.conf G o /usr/local/lib <Esc> :wq! 12. Using your favorite editor, add the following two lines to the end of /etc/bash.bashrc: PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig export PKG_CONFIG_PATH export LD_LIBRARY_PATH=/usr/local/lib 13. Reboot.

You might also like