Skip to content

1. ROS Install

Raf edited this page Dec 12, 2018 · 2 revisions

Installing ROS Melodic

1. 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'
2. Set up your keys
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
3. Installation
sudo apt-get update
4. Desktop-Full Install

Install the full desktop version of ROS Melodic, this will install all the tools you need.

sudo apt-get install ros-melodic-desktop-full

Installing Sphinx (Cartographer)

Add the repo so you can install sphinx.

sudo add-apt-repository ppa:builds/sphinxsearch-stable
sudo apt-get update

Install Sphinx

sudo apt-get install sphinxsearch
//You can also use pip install if apt-get fails to load it correctly.

Creating a ROS workspace

Building

Once you have finished the install, you should then create a catkin work space.

1. Install Catkin Tools

Add the repo.

$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
$ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -

Install Catkin Tools

$ sudo apt-get update
$ sudo apt-get install python-catkin-tools
2. Install Catkin Tools w/ Pip
$ sudo pip install -U catkin_tools
3. Create the work space directory.

In this case you can either create your own directory to start or pull the Trekbot work space.

$ git pull https://github.com/Rafcin/TrekBot.git
$ cd /TrekBot2_WS/
$ catkin build

or if you want to create your own work space folder...

$ source /opt/ros/melodic/setup.bash
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/
$ catkin build

When you look for packages to later install, note that the ROS wiki is the best place to look, almost all packages have documentation and they all come with github links you can clone.

For more informatin look here to see how ROS works and how you can use it. http://wiki.ros.org/ROS/Tutorials

If you want to see the set paths you have exported for ROS run:

env | grep ROS

Errors and Bugs

If you run into problems such as certain modules missing, you may either have to sudo ap-get install {pkg name} each one or if that fails to work, use pip install {pkg name}. Pip comes from Python, you should have Python 3.6 and 2.7 installed, 3.6 is the one we will be using so keep that in mind. Also do note running pip will run it under 3.6 while running pip2 will run it under 2.7. An example of using pip to install something is sphinx, if sphinx wont run after being installed with apt, install it with pip.