====== Install Ubuntu and Xenomai ====== **Author:** Yu Hang He ** \\ Email:** \\ **Date:** Last modified on <07/25/18> \\ **Keywords:** Hubo 2, RTOS, Ubuntu, Xenomai \\ {{ :yuhang:hubo2:xenomai1.png?500 |}} \\ The photo above depicts Xenomai, a real-time development framework cooperating with the Linux kernel, to provide a pervasive, interface-agnostic, hard real-time support to user space applications, seamlessly integrated into the Linux environment. Real-time process are crucial for the operation of humanoid robots for processing sensor data and communicating instructions to various controllers and sensors. \\ ===== Motivation and Audience ===== The tutorial serves as an tutorial for installing Ubuntu and Xenomai. Readers of this tutorial assumes the reader has the following background and interests: * Know basic elements of programming process \\ * Interested in Ubuntu Operating System \\ * Interested in implementing RTOS process with Xenomai \\ \\ The rest of this tutorial is presented as follows: * [[install_ubuntu_xenomai#install_ubuntu|Install Ubuntu]] * [[install_ubuntu_xenomai#install_xenomai_3.0|Install Xenomai 3.0]] * [[install_ubuntu_xenomai#set_default_boot_to_xenomai|Set Default Boot to Xenomai]] * [[install_ubuntu_xenomai#final_words|Final Words]] ===== Install Ubuntu ===== *Download Ubuntu ISO from [[https://www.ubuntu.com/download/desktop? | Ubuntu's official website]]. *Write the ISO file to a bootable USB device. *For Windows user: download USB formatting tools such as [[http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/ | Universal USB Installer]] and follow the install process to format USB device with Ubuntu ISO. {{ :yuhang:hubo2:usb_installer.png?500 |}} *Plug the USB device into a USB port. *Power on the computer. *Press F2 to enter BIOS Setup and select the bootable USB device. *Follow the standard Ubuntu installation process. Detail can be found in [[https://tutorials.ubuntu.com/tutorial/tutorial-install-ubuntu-desktop#4 | Ubuntu's tutorial]]. ===== Install Xenomai 3.0 ===== *After ubuntu is installed, connect to the Internet, search for update in the search window, run the software updater, and perform all updates. *Open the terminal (Ctrl + Alt + T) and enter the following in order. * ''sudo apt-get install devscripts debhelper dh-kpatches findutils'' * ''sudo apt-get install kernel-package libncurses5-dev fakeroot zlib1g-dev''{{ :yuhang:hubo2:screenshot_from_2018-06-28_14-49-22.png?500 |}} *Search for Ubuntu Software in the search box and run it. *In Ubuntu Software, search and install synaptic package manager.{{ :yuhang:hubo2:screenshot_from_2018-06-28_14-47-21.png?500 |}} *In the synaptic package manager, search for the follow packages and check them for installation. Choose ''Name'' during search options. *''build-essential'' *''automake'' *''libtool'' *''libpopt-dev'' *''libglu1-mesa-dev'' *''libglade2-dev''{{ :yuhang:hubo2:screenshot_from_2018-06-28_14-45-50.png?500 |}} *Click Apply to install the packages. *Copy the RTOS folder downloaded from Github repository to the following directory *''/usr/local/src/''{{ :yuhang:hubo2:screenshot_from_2018-06-28_15-21-09.png?500 |}} *Open a new terminal, type ''sudo passwd root'', and set the password to 'rainbow'. Enter ''su'' and enter password to enter admin mode. *''sudo passwd root'' *''su'' *Enter the following command in terminal. *''cd /usr/local/src/RTOS/Linux'' *''dpkg -i *.*'' *''reboot'' *During the reboot, press ESC to access Advanced Ubuntu mode, then select the Xenomai menu at the top. Check the boot sequence number of Xenomai (usually 6). *Open a terminal and type uname -a to verify that xenomai has booted normally. *''uname -a''{{ :yuhang:hubo2:screenshot_from_2018-06-28_15-28-52.png?500 |}} *Activate ''su'' and enter: *''cd /usr/local/src/RTOS/Xenomai'' *''dpkg -i *.*'' *''exit'' *''sudo adduser [username] root'' *''sudo adduser [username] xenomai'' *''su'' *''cd /usr/lib/xenomai/testsuite'' *''./latency'' {{ :yuhang:hubo2:screenshot_from_2018-06-28_15-33-45.png?500 |}} ===== Set Default Boot to Xenomai ===== Set the default boot to Xenomai so the Ubuntu system will automatically boot with Xenomai environment. *Open a new terminal and run the command: *''sudo gedit /etc/default/grub'' *In the executed gedit file, change the non-zero value of GRUB_DEFAULT to "1> 6". Number 6 is the usual boot sequence number of Xenomai.{{ :yuhang:hubo2:screenshot_from_2018-06-28_15-39-48.png?500 |}} *Save and close the window and run: *''sudo update-grub'' *Reboot the computer again. Enter the following to terminal: *''uname -a'' The Ubuntu should have started in Xenomai environment. ===== Final Words ===== The purpose of this tutorial was to guide reader through the process of installing Ubuntu and set up Xenomai environment in preparation for working with Hubo 2. \\ \\ For questions and comments, email