====Installing Xenomai, PODO, and QT==== ===How to use this tutorial=== \\ This tutorial will take the reader step by step on how to install Xenomai, PODO3, and QT onto a computer. This tutorial assumes that the reader has experience with Ubuntu. I will be using Ubuntu 16.04 for this tutorial. Although it is possible to do it in 14.04 it is not recommended. The reader will also need to have an account to edit this page to get access to commented out information. I also I recommend that the reader go through the tutorial once before, or have this tutorial open as the reader goes through the process on a different computer. The reader should be able to finish this tutorial in about 1.5~2hr. Please note that if you are using a computer with a dedicated graphics card you may run into graphical problems and may need to do additional steps to complete this tutorial. If the reader doesn't know how to install Ubuntu please follow these links to learn how to: *[[http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows|Creating live USB-windows]] *[[http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx|Creating Live USB-OSX]] *[[http://www.ubuntu.com/download/desktop/install-ubuntu-desktop|Installing Ubuntu from USB]] \\ Note: (02/12/18) The podo code has been updated to work with Ubuntu 16.04 and is now recommended that you continue with 16.04 for the rest of this tutorial. All the instructions are the same regardless. \\ This tutorial will follow the following format: *[[Installing Xenomai3, PODO3, and QT#The Initial Settings (for NUC's only)|The Initial Settings (for NUC's only)]] *[[Installing Xenomai3, PODO3, and QT#Xenomai3 Instalation|Xenomai3 Instalation]] *[[Installing Xenomai3, PODO3, and QT#Setting the Default Boot to Xenomai|Setting the Default Boot to Xenomai]] *[[Installing Xenomai3, PODO3, and QT#PCan Driver Instalation|PCan Driver Instalation]] *[[Installing Xenomai3, PODO3, and QT#QT Instalation|QT Instalation]] *[[Installing Xenomai3, PODO3, and QT#Xenomai debug.h Modification|Xenomai debug.h Modification]] *[[Installing Xenomai3, PODO3, and QT#Installing PODO3|Installing PODO3]] ===The Initial Settings (for NUC's only)=== \\ 1. Download the BIOS update file to a usb flash drive from https://downloadcenter.intel.com/search?keyword=NUC5i7RYH. The latest version is (2016.7.13) RY0358. 2. Enter the BIOS setting (F2) to enter the check eliminating legacy Boot. Go to Advance --> power --> after power failure and change power on to restart after a power failure. 3. Press F7 to select the update file on the usb flash drive and update the BIOS. 4. Install ubuntu 16.04 (Recommended) \\ 14.04 has problems with software compatibility ===Xenomai3 Instalation=== \\ 1. Search your computer for the Software Updater and make sure that everything is up to date. \\ {{podo_inst:xenint1.png?400}} \\ 2. Open a new terminal and run the command: ---- sudo apt-get install devscripts debhelper dh-kpatches findutils ---- \\ {{podo_inst:xeninst2.png?400}} \\ 3.Then run the command: ---- sudo apt-get install kernel-package libncurses5-dev fakeroot zlib1g-dev ---- \\ {{podo_inst:hyunhee_hyunhee-desktop_002.png?400}} \\ Note: If you have ROS installed it is possible for you to get more (>400) files not upgraded. Don't worry, as long as there were no error messages with the installation all is well. \\ \\ 4. Then open the Ubuntu Software Center to install the Synaptic Package Manager. If you can't find it in the software center open a terminal and run ---- sudo apt-get install synaptic ---- Then run the Synaptic Package Manager to check off these packages for installation: *build-essential *automake *libtool *libpopt-dev *libglu1-mesa-dev *libglade2-dev \\ {{podo_inst:xenint2.png?400}} {{podo_inst:xenint3.png?400}} {{podo_inst:xenint4.png?400}} \\ 5. Click Apply to finish the installation. \\ {{podo_inst:xenint5.png?400}} \\ NOTE: You do not need to use the synaptic package manager to install the needed packages. You can do the same thing with: ---- sudo apt-get install build-essential automake libtool libpopt-dev libglu1-mesa-dev libglade2-dev ---- However, synaptic package manager is a good package manager to have anyways so I would recommend getting it regardless. \\ 6. If you were using the synaptic package manager close it, open a new terminal and run the command: ---- sudo nautilus ---- You will probably see an error message in the terminal but as long as a file manager opens up you can ignore it. \\ {{podo_inst:hyunhee_hyunhee-desktop_003.png?400}} \\ 7. Get the download file for Xenomai from the lab manager, or email me. When asking please tell them what version of ubuntu and how new your computer is. The version of xenomai needed will differ depending on these factors. Afterwards unzip it and put it inside usr/local/src. Use the File Manager window created by nautilus. \\ {{:tut101.png?400}} {{:tut102.png?400}} {{podo_inst:src_001.png?400}} \\ 8. Once done with nautilus close it and the terminal. Then in a new terminal run the command: ---- sudo passwd root ---- Then set the password to 'rainbow' if your using a lab NUC. Otherwise it's up to you. Then run the command: ---- su ---- to enter administrator mode. \\ {{podo_inst:root_hyunhee-desktop_-home-hyunhee_005.png?400}} \\ 9. The following command will differ based on which version of ubuntu you are installing. For ubuntu 14.04 and older use: ---- cd /usr/local/src/Xenomai/Kernel ---- For Ubuntu 16.04 and newer use: ---- cd /usr/local/src/RTOS/Linux ---- Then ---- dpkg -i *.* ---- If you get an error message about a "core-dump" the use this command instead: ---- dpkg -i linux-* ---- \\ {{podo_inst:root_hyunhee-desktop_-usr-local-src-xenomai-kernel_007.png?400}} \\ 10. Run the command: ---- reboot ---- to restart the computer. As it is starting up again press esc to enter grub. Select Advanced Ubuntu mode and once in, select the Xenomai version to boot up. It should be the 6th from the top starting at 0. This is the counting scheme for grub and will be used later on. \\ {{podo_inst:img_20160728_180853.jpg?400}} {{podo_inst:img_20160728_180135.jpg?400}} \\ 11. Open a new terminal and run the command: ---- uname -a ---- and confirm the message created by the command. It should now show that you are in Xenomai. If you aren't go back to grub and make sure that you boot using Xenomai. \\ {{podo_inst:hyunhee_hyunhee-desktop_011.png?400}} \\ 12. Run the command ---- su ---- The following command will differ based on which version of Ubuntu you installed. For Ubuntu 14.04 and older use: ---- cd /usr/local/src/Xenomai/Library ---- For Ubuntu 16.04 and newer use: ---- cd /usr/local/src/RTOS/Xenomai ---- finally use: ---- dpkg -i *.* ---- 13. run the command: ---- exit ---- 14. Run the command: ---- sudo adduser [username] root ---- 15. Run the command: ---- sudo adduser [username] xenomai ---- \\ {{podo_inst:hyunhee_hyunhee-desktop_009.png?400}} \\ 16. Run: ---- su ---- then: ---- cd /usr/lib/xenomai/testsuite ---- 17. Run: ---- ./latency ---- to determine if Xenomai is working properly. \\ {{podo_inst:root_hyunhee-desktop_-usr-lib-xenomai-testsuite_012.png?400}} \\ ===Setting the Default Boot to Xenomai=== Note: This step is not recommended if you are dual booting or need access to another version of Ubuntu on the same machine. It is possible to skip this step, as this is only a convenience for machines that work exclusively with PODO. \\ 1. Open a new terminal and run the command: ---- sudo gedit /etc/default/grub ---- 2. Change GRUB_DEFAULT = 0 to GRUB_DEFAULT = "1>[the number placement of xenomai in grub (default is usually 6)]" \\ Note: Don't forget the quotation marks around the grub default ex. "1>6" \\ {{podo_inst:grub_-etc-default_-_gedit_002.png?400}} \\ 3. Save and close the window and run: ---- sudo update-grub ---- ===PCan Driver Instalation=== 1. Go to this [[http://www.peak-system.com/fileadmin/media/linux/index.htm | link]] 2. Download the 7.15.2 version and extract \\ {{podo_inst:peak-system_linux_website_-_mozilla_firefox_013.png?400}} \\ 3. In a terminal 'cd' inside the extracted folder and run the commands: ---- make clean ---- and ---- make NET=NO_NETDEV_SUPPORT ---- 4. Run: ---- su -c "make install" ---- Note: If you are just copy and pasting all of the commands it can sometimes copy invisible characters into the command line. If you get any errors with the previous command just type it out manually. \\ 5. Run: ---- sudo /sbin/modprobe pcan ---- then run: ---- lsmod ---- to make sure that PCan was successfully installed. \\ {{podo_inst:keimura_keimura-inspiron-5547_020.png?400}} \\ ===QT Instalation=== 1. Download the .run file from this link (download.qt.io/archive/qt). Look for version 5.5.1. \\ {{podo_inst:index_of_-archive-qt_-_mozilla_firefox_015.png?400}} {{podo_inst:index_of_-archive-qt-5.5_-_mozilla_firefox_016.png?400}} {{podo_inst:index_of_-archive-qt-5.5-5.5.1_-_mozilla_firefox_018.png?400}} \\ Note: If you are using the newest xenomai 4 you can download qt 5.7.0 instead (https://download.qt.io/official_releases/qt/5.7/5.7.0/). Make sure you download the linux version not the android one. The rest of the commands are the same regardless of qt version. \\ 2. Find the directory holding the .run file and cd to it. Then run: ---- sudo chmod 777 [name of .run file] ---- to change it into an executable file. 3. Run: ---- sudo ./[name of .run file] ---- \\ {{podo_inst:hyunhee_hyunhee-desktop_-downloads_019.png?400}} \\ 4. Make sure that the files are installed into your /opt directory. \\ {{qt_save_loc.png?400}} \\ ===Xenomai debug.h Modification=== 1. Run: ---- sudo nautilus ---- 2. Go to the usr/include/xenomai/copperplate/ folder and open the debug.h file. \\ {{podo_inst:copperplate_021.png?400}} \\ 3. Comment out the two #define debug lines. \\ {{podo_inst:debug.h_-usr-include-xenomai-copperplate_-_gedit_022.png?400}} \\ 4. You can now close everything. \\ ===Installing PODO=== 1. First go to the lab manager or email me to get the link to download all of the necessary files. \\ 2. After extracting the file create a copy so that you will have an original copy to fall back on. Also rename it so you don't get them mixed up. \\ {{podo_inst:podoinst2.png?400}} \\ 3. Once you have your personal copy open qt. Once in qt go to File->Session Manager. Once inside Session Manager create a new session, name it what ever you want. Then double click it inside the Session Manager to edit the session. \\ {{podo_inst:podoinst3.png?400}} {{podo_inst:podoinst4.png?400}} {{podo_inst:podoinst5.png?400}} {{podo_inst:podoinst6.png?400}} {{podo_inst:podoinst7.png?400}} \\ 4. Now go to File->Open File or Project. Find your personal copy and go to [your personal copy]->podp_nrl->src->ALPrograms. Once in find the .pro file and open it. If a pop up comes up click yes and then configure project in the next screen. \\ {{podo_inst:podoinst8.png?400}} {{podo_inst:podoinst9.png?400}} {{podo_inst:podoinst10.png?400}} {{podo_inst:podoinst11.png?400}} \\ 5. Do this for Daemon, PODOGUI, and PODOLauncher as well. \\ {{podo_inst:podoinst12.png?400}} \\ 6. Once you have all of the projects open in your session go to the projects tab and change the build directory path. Click on the browse button in General and find your folder->podo_nrl->build. Then find the appropriate folder for the project (ex for ALPrograms go into ALBuild) and click open. \\ {{:podoinst101.png?400}} {{:podoinst102.png?400}} \\ Note: If you don't have the build folder in your file run the build.sh file inside your podo file from a terminal: ---- sudo chmod +x build.sh \\ ./build.sh ---- \\ {{podo_inst:buildsh.png?400}}{{podo_inst:buildshterm.png?400}} \\ 7. Make sure that both Release and Debug have the same path. Repeat this for all the other projects, making sure that both Release and Debug have the same build directory. As shown in the second picture you may see a warning, you can ignore it. \\ {{:podoinst103.png?400}} {{:podoinst104.png?400}} \\ 8. In the bottom left-hand corner of the QT window there is a computer icon, click it and make sure that all the projects are in release mode instead of Debug mode. \\ {{:podoinst105.png?400}} {{:podoinst106.png?400}} \\ 9. Once you have all of them in your session go to Build->Rebuild All. \\ {{podo_inst:podoinst13.png?400}} \\ Note: If you get an error about being unable to locate -lrbmodel just add the RBModel project and rebuild it byitself before rebuilding the others. This will create the rbmodel library the code is looking for. Don't forget to change the build location like the other projects for RBModel. \\ 10. Now right click PODOLauncher in qt and run it. \\ {{podo_inst:podoinst16.png?400}} \\ 11.You should see a pop up called Daemon Launcher. If you don't look at the top bar and click on the blue rocket then click restore. Click Change Daemon and make sure that is connected to the correct Daemon file. Then do the same thing with PODOLauncher. \\ {{podo_inst:podoinst17.png?400}} {{podo_inst:podoinst18.png?400}} \\ 12. Click Start Daemon and Start GUI to make sure that they are connected correctly. You should see these two windows pop up. \\ {{podo_inst:podoinst19.png?400}} {{podo_inst:podoinst20.png?400}} \\ 13. To exit PODO3 click the blue rocket icon at the top right of your screen then press 'stop Daemon' then 'stop GUI' and finally 'exit'. \\ {{podo_inst:podoinst21.png?400}} \\