Openni Software Installation Application Notes for the Pandaboard ES Camden Smith ECE 480 Design Team 2 11/16/12
Total Page:16
File Type:pdf, Size:1020Kb
OpenNI Software Installation Application Notes for the Pandaboard ES Camden Smith ECE 480 Design Team 2 11/16/12 OpenNI Stands for Open Natural Interaction, it is not only software but an organization focused on creating and improving the software for human (or “natural”) user interfaces used for natural interaction devices. Natural Interaction Devices (NID) is a fairly new technology that can detect human or natural movement (such as the Microsoft Xbox Kinect or the ASUS Xtion), there are only a few different NID's that exist today but this tutorial will be explaining the software used to program one of these devices (specifically the ASUS Xtion). The hardware and software packages that will be used will be very specific to this tutorial but I will provide the links to the packages when necessary. However, in this tutorial I will only cover the steps to install the software for OpenNI. To overview what will be covered in the tutorial I've created steps Step 1 – Project Requirements The hardware and software used to test and write this tutorial is as follows, if I don't specify a version or specific hardware it shouldn't matter: -Computer with a Dual Core Processor (I'll cover OS requirements/details below) -Pandaboard ES -ASUS Xtion -Necessary power cords to power the devices respectively -OpenNI, Sensor and NITE Software -The Pandaboard program our group created for this project Step 2 – Software and Operating System, and Tips before OpenNI Installation: Part 1 - Software and Operating System: No matter what operating system you are running (Mac OSx, Linux, or Windows) the necessary files for OpenNI, the Sensor software, and NITE can be found at the following open source location. For our project we used Ubuntu 12.04 on our Pandaboard, but if you are using something else download the correct files here (keep in mind that the Pandaboard will only support certain OS's and software packages due to the ARM processor). Download the files and copy them to your Pandaboard: http://www.openni.org/Downloads/OpenNIModules.aspx Part 2 -Tips before installation: Before you start the installation make sure your Pandaboard has been installed with the correct version of Linux that has been specified in the files you downloaded (most likely Ubuntu 12.04). After the Pandaboard was installed with Ubuntu we made sure the system was up to date, the OS was configured and working properly. We then installed eclipse and any necessary libraries for C++ debugging and programming. Eclipse was a very important program to get our group’s software working with the OpenNI software so we want to be sure it is configured properly. But since we have not installed the OpenNI software yet, our program will not be able to compile in Eclipse. I will come back to this after I have covered the OpenNI installation. After we did finished our full installation and setup of Ubuntu on our Pandaboard, we created an image of the install just in case we needed to do a quick reload to start over (unfortunately we had to do this a couple of times). Also, you may want to install Eclipse before creating an image of the install or you will have to do it again. Now you’re ready to begin your OpenNI installation and you have a backup copy just in case something goes wrong! Step 3 - OpenNI/NITE/Sensor Software Setup and Installation Part 1 – Software and Packages Setup: In the directory you copied the files to extract the files here, open a terminal and navigate to this directory. In Ubuntu you will need the following packages before installing the software: mono- complete, libusb-1.0-0-dev, and freeglut3-dev. So run the following command to install the packages. $ sudo apt-get install freeglut3-dev mono-complete libusb-1.0-0-dev freeglut3-dev Part 2 – Installing OpenNI/NITE/Sensor Next, in your terminal navigate to the OpenNI folder you extracted in Step 2 and type: $ sudo ./install.sh Do the same thing for both Sensor and NITE. If everything has gone smoothly and you haven’t received any errors during the install, then you've now successfully installed the OpenNI, Sensor and NITE software! We now need to configure the software sources needed by the OpenNI software. Step 4 – Installing the software sources Create a directory in your home folder and call it “Xtion”. Navigate to this directory in your terminal window and run the following command: $ git clone https://github.com/OpenNI/OpenNI.git This will download the OpenNI repository into your directory. After this has completed navigate to this directory “~/Xtion/OpenNI/Platform/Linux/Build” and run the following command: $ make && sudo make install This will install the necessary sources needed by the OpenNI software. Next we need to input the license key for the primesense software which was provided via Primesense for open development. Step 5 – Primsense License Setup Open the following file “Xtion/OpenNI/Data/SamplesConfig.xml”, the third line (or node of the XML file) is commented out and should be in all blue text. It should be between these two line , first with the code <Licenses> and then </Licenses>. Replaced the code that is commented out with the following line: <License vendor="PrimeSense" key="0KOIk2JeIBYClPWVnMoRKn5cdY4"/> This should look like this: <OpenNI> <Licenses> <License vendor="PrimeSense" key="0KOIk2JeIBYClPWVnMoRKn5cdY4"/> </Licenses> After you save the file, you've successfully installed your Pandaboard with the software necessary to begin your human tracking using the ASUS Xtion! Step 6 – Eclipse Installation and Initial Setup: Part 1 – Installation: Eclipse is an open source programming management interface and debugger. You can download it in the software manager in Ubuntu or from the official Eclipse website to recieve the latest version. After the installation of Eclipse is complete, go ahead and open Eclipse. Depending on the method you installed eclipse you may have to launch it a different way. If you cannot find eclipse in your applications, open a terminal and type the following command: $ eclipse & Part 3 - Using our software with Open NI: Go ahead and open Eclipse, it will prompt you to choose a workspace. Navigate to the folder containing our group project (doesn’t matter if you’ve extracted the zip file yet) and select this folder as your workspace. After Eclipse has opened, go to “File->Import…”, then expand general and select “Import existing project into workspace”. If you have not extracted the project yet there is a selection in which you can choose to import the archive, otherwise go ahead and select the project folder and hit finish. The project should then appear in the left project navigator panel. Selected the project and go to “Project->Build All”, this should build your program. If you have received any errors during the project build, please refer to my “Common Bugs” documentation at the end of this tutorial. If you did not receive any errors, go to “Run->Run without Debugging”, and this will compile your program. If this completed successfully you should receive the following before connecting to your host. If this did complete successfully, please refer to further documentation on connecting to the Pandaboard using Network Protocols. [SYS] Application initialized. [NET] Starting TCP Server... [NET] TCP Server started on port 9999 [NET] Waiting for clients to connect... Examples and Testing I will provide a few ways to run a few of the programs that have been installed but unfortunately I will only provide minimal debugging for running these programs. For running the tracking software: Open a terminal, find the OpenNI folder you extracted in Step 2 and navigate to the following location “OpenNI/Samples/Bin”. To run one of the sample programs type the following command: $ ./Sample-NiUserTracker This will begin the user tracking software if everything is configured and hooked up correctly. To start the model software that plots the tracking software run the following command: $ ./NiViewer Figure 1 - http://luka.tnode.com/media/cache/ gallery/kinect2_display_image.jpg Figure 1 shows an example of what this software should look like. If there is a problem with your connections or the system receives some kind of invalid information that causes it to segmentation fault, you may receive the following followed by an empty re-prompt: “One or more of the following nodes could not be enumerated:” It should specify what is not being detected properly or what it is not able resolved, but further documentation for this and other methods of running the sample software can be found online. Common Bugs There was a few bugs we ran into during the installation, we were able to run the OpenNI software and the software we created on a previous version of Ubuntu (such as 11.10). But during one installation we were required to full update and upgrade the Ubuntu system to 12.04 before the project was able to compile in Eclipse. So I recommend not attempting to do this and just upgrade your system to 12.04 (or whatever the OpenNI packages you download specify) before you begin the installation. There are countless bugs in Eclipse and one of these bugs may cause some of the header files, in the eclipse project we created, to not detect the headers. Something that might fix this is checking the include destinations in your project settings. There are numerous tutorials on the bugs that are caused in eclipse online, if you are receiving a lot of errors or bugs caused by eclipse you may want to document some of these tutorials. Sources and further reading For initial set up, documentation notes, and common problems/bugs click the following link.