Posts ROS install in Ubuntu
Post
Cancel

ROS install in Ubuntu

ROS install

1. Setup your sources.list

1
2
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

2. Set up your keys

1
2
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 -

3. Installation

1
sudo apt update
  • Desktop-Full Install: (Recommended) : ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators and 2D/3D perception
1
sudo apt install ros-melodic-desktop-full
  • ROS-Base: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.
1
sudo apt install ros-melodic-ros-base
  • Individual Package: You can also install a specific ROS package (replace underscores with dashes of the package name):
1
sudo apt install ros-melodic-PACKAGE

4. Environment setup

1
2
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc

or

1
2
3
4
5
6
7
8
9
10
vi ~/.bashrc

.
.
.

source /opt/ros/melodic/setup.bash


source ~/.bashrc
  • if you use zsh
1
2
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.zshrc

or

1
2
3
4
5
6
7
8
9
10
vi ~/.zshrc

.
.
.

source /opt/ros/melodic/setup.zsh


source ~/.zshrc

5. Dependencies for building packages

1
2
3
4
5
6
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential

sudo apt install python-rosdep

sudo rosdep init
rosdep update

6. CV_library install

1
2
3
4
sudo apt -y install ros-melodic-opencv*
sudo apt -y install ros-melodic-usb-cam
sudo apt -y install ros-melodic-cv-bridge
sudo apt -y install ros-melodic-cv-camera

7. ROS Installer.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'



sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

sudo apt update
sudo apt install ros-melodic-desktop-full -y


apt search ros-melodic

echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential -y


sudo apt install python-rosdep -y

sudo rosdep init
rosdep update

sudo apt -y install ros-melodic-opencv*
sudo apt -y install ros-melodic-usb-cam
sudo apt -y install ros-melodic-cv-bridge
sudo apt -y install ros-melodic-cv-camera
This post is licensed under CC BY 4.0 by the author.