--- title: ROS installation on Ubuntu 18.04 tags: ROS description: View the slide with "Slide Mode". --- # ROS installation on Ubuntu 18.04 <!-- Put the link to this slide here so people can follow --> <!-- slide: https://hackmd.io/@BennyHito/ros-on-ubuntu1804#/ --> <!-- --- --> *Use virtual machine to install Ubuntu 18.04 on Windows 10 Then, install ROS melodic on Ubuntu 18.04* --- ## Find and install your preferred virtual machine - Vmware player :heart: https://www.vmware.com/tw/products/workstation-player.html - VirtualBox https://www.virtualbox.org/ - Hyper-V https://docs.microsoft.com/zh-tw/virtualization/hyper-v-on-windows/about/ --- ## Download ISO file of Ubuntu 18.04 https://releases.ubuntu.com/18.04/ --- ## Guide for Ubuntu installation using Vmware player https://reurl.cc/d2bL46 --- ## ROS distributions http://wiki.ros.org/Distributions ##### :bulb: There are matched distros for ros and ubuntu:  --- ## Install ROS melodic on Ubuntu 18.04 ---- - Part 1 ```shell # Update the package lists sudo apt update -y # Install build environment, the chrony, ntpdate and set the ntpdate sudo apt install -y chrony ntpdate curl build-essential net-tools nmap sudo ntpdate ntp.ubuntu.com # Add the ROS repository if [ ! -e /etc/apt/sources.list.d/ros-latest.list ]; then sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main\" > /etc/apt/sources.list.d/ros-latest.list" fi ``` ---- - Part 2 ```shell # Download the ROS keys sudo apt install curl # if you haven't already installed curl curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - # Update the package lists once more sudo apt update -y # Install ros-desktop-full version of Melodic sudo apt install -y ros-melodic-desktop-full # Install RQT & Gazebo sudo apt install -y ros-melodic-rqt-* ros-melodic-gazebo-* ``` ---- - Part 3 ```shell # Environment setup and getting rosinstall source /opt/ros/melodic/setup.sh sudo apt install -y python3-rosinstall python3-rosinstall-generator python3-wstool build-essential git # Install rosdep and Update sudo apt install python3-rosdep # Initialize rosdep and Update sudo sh -c "rosdep init" rosdep update ``` ---- - Part 4 ```shell # Make the catkin workspace mkdir -p ~/Desktop/catkin_ws/src cd ~/Desktop/catkin_ws/src # Download sample codes and test catkin_make git clone https://github.com/ROBOTIS-GIT/turtlebot3.git git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git cd ~/Desktop/catkin_ws catkin_make ``` ---- - Part 5 ```shell # Set the ROS evironment echo "alias nb='nano ~/.bashrc'" >> ~/.bashrc echo "alias sb='source ~/.bashrc'" >> ~/.bashrc echo "alias gs='git status'" >> ~/.bashrc echo "alias gp='git pull'" >> ~/.bashrc echo "alias cw='cd ~/Desktop/catkin_make'" >> ~/.bashrc echo "alias cs='cd ~/Desktop/catkin_make/src'" >> ~/.bashrc echo "alias cm='cd ~/Desktop/catkin_make && catkin_make'" >> ~/.bashrc echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc echo "source ~/Desktop/catkin_ws/devel/setup.bash" >> ~/.bashrc echo "export MASTER_IP=localhost" >> ~/.bashrc echo "export ROS_MASTER_URI=http://localhost:11311" >> ~/.bashrc echo "export ROS_HOSTNAME=localhost" >> ~/.bashrc echo "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc ``` ---- - Part 6 ```shell # Install Dependent ROS Packages sudo apt-get install -y ros-melodic-joy ros-melodic-teleop-twist-joy \ ros-melodic-teleop-twist-keyboard ros-melodic-laser-proc \ ros-melodic-rgbd-launch ros-melodic-rosserial-arduino \ ros-melodic-rosserial-python ros-melodic-rosserial-client \ ros-melodic-rosserial-msgs ros-melodic-amcl ros-melodic-map-server \ ros-melodic-move-base ros-melodic-urdf ros-melodic-xacro \ ros-melodic-compressed-image-transport ros-melodic-rqt* ros-melodic-rviz \ ros-melodic-gmapping ros-melodic-navigation ros-melodic-interactive-markers ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up