Lab1 (4%)
Prelab (1%)
Before coming to the first lab, you are required to:
- Form your team of 5
- Install Ubuntu 18.04 on your computer
Readings
What You Will Need
- Your computer with ubuntu installed
Learning Outcomes
By the end of Lab 1, you will have learnt:
- Basic Linux bash commands
- Ubuntu’s package manager (apt)
- Understand system variables (.bashrc)
- Install ROS Melodic
- Familiarize with your limo
Installing ROS Melodic
- Setup sources.list
To install ROS, we will have to prepare your computer to accept software from packages.ros.org. To do that we have to add the ROS apt repository to our system’s apt repository source index.sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
Command breakdown:
- sudo - This command temporarily gives you administrator privileges to run certain commands.
- Setup apt key
To get any software from a apt server, we have to get the key to that apt server.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 -
Command breakdown:
- apt - apt is ubuntu’s package manager used to get/remove software from apt servers.
- Installing ros
sudo apt update sudo apt install ros-melodic-desktop-full
Command breakdown:
- apt update - This fetches any available updates from all apt servers. This does not install any updates, but rather just informs our system that a update is available.
- apt install - This attempts to install a specified package, this installs latest package version available (ROS melodic in this case).
- Environment setup
In order to use our newly installed ROS, we have to somehow inform our terminal where to find this new package. In linux, we use something called environment variables to do this.echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc source ~/.bashrc
Command breakdown:
- echo - This makes bash repeat whatever you tell it to (“source /opt/ros/melodic/setup.bash” in this case)
- >> - This tells bash to place the text into a file (~/.bashrc in this case).
- source - This essentially runs a file containing bash commands.
- ~/.bashrc - This is a special file presnet in the home directory that contains bash commands that is runned once every time you open a new terminal.
- ROS dependencies
There are certain dependencies packages that ROS needs, that we have to apt install. These packages are…- python-rosdep
- python-rosinstall
- python-rosinstall-generator
- python-wstool
- build-essential
Using the information from step 3, install these dependencies. After installing these pacakges, run
sudo rosdep init rosdep update
- Verify installation
Now we can proceed with verifying our new ROS installation, by runningroscore
If there are no errors, congratulations on installing ROS successfully.