Skip to content

Getting Started with ROS1

Jack Norris edited this page Aug 12, 2023 · 7 revisions

ROS1

There are two kinds of ROS: ROS1 and ROS2. In this wiki, we use ROS1. ROS1 and ROS2 do NOT have compatibility.

Distribution

You NEED to install the proper ROS distribution for your OS. (e.g. cannot install Noetic on 18.04) The following table shows the relationship between OS and ROS distribution.

Ubuntu \ Name OS Name ROS Name Tuturtle
20.04 Focal Fossa Noetic Ninjemys
18.04 Bionic Beaver Melodic Morenia

Install ROS1

Installation ROS

In short, simply follow the official tutorial. The following is codes from the official tutorial. There are two options to install ROS1: 1. use command line; 2. use one line install.

Option 1. Choose the ROS1 packages version

Option 1. Choose the ROS1 packages version

# Install  Melodic
export ROS_VERSION=melodic

# Install  Noetic
export ROS_VERSION=noetic
# Setup your sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

# Set up your 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 -

# Install (Desktop-Full). Install for other libraries see the official tutorial)
sudo apt update
sudo apt install ros-${ROS_VERSION}-desktop-full

# # Environment setup for Noetic
echo "source /opt/ros/${ROS_VERSION}/setup.bash" >> ~/.bashrc
source ~/.bashrc

For melodic, we need to use python2

# Dependencies for building packages
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential python-rosdep
sudo rosdep init
rosdep update

For noetic, we need to use python3

# Dependencies for building packages
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential python3-rosdep
sudo rosdep init
rosdep update
Option 2. One line install for Noetic

Option 2. One line install for Noetic (Copy from the official tutorial)

'''Single-line installation''' The following line of command will install the latest ROS Noetic Ninjemys on Ubuntu Focal 20.04. Copy & Paste this line of command into the Ubuntu terminal.

wget -c https://raw.githubusercontent.com/qboticslabs/ros_install_noetic/master/ros_install_noetic.sh && chmod +x ./ros_install_noetic.sh && ./ros_install_noetic.sh

The following line of command will uninstall ROS Noetic Ninjemys

wget -c https://raw.githubusercontent.com/qboticslabs/ros_install_noetic/master/ros_uninstall_noetic.sh && chmod +x ./ros_uninstall_noetic.sh && ./ros_uninstall_noetic.sh

Build ROS1 package

Instead of using catkin_make to build a ROS1 package, we can utilize catkin build. While catkin_make requires us to be in the root of the package to build it, catkin build grants more flexibility by allowing us to build a package even if we're not inside it. Furthermore, catkin build enables building multiple packages simultaneously.

We need to install catkin build first. You need to use python3 for noetic and python for melodic.

sudo apt-get install python3-catkin-tools # for noetic
sudo apt-get install python-catkin-tools # for melodic

Now, you can build a ROS1 package by using catkin build command.

Use Case

There are some use case. You can find the detail the following links.

[x]: Realsense T265

[x]: Azure Kinect