-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Apr 25, 2020
Downloading ROS is quite easy although some problems can arise during installation. There are several versions of ROS, most common ones are Kinetic and Melodic though I recommend using Melodic as it is more up-to-date and some packages had their issues with Kinetic version. I have installed it on Ubuntu (versions for Windows and Debian also exist but Ubuntu one is recommended). The step can be found here:
Installation Steps
There are main ROS workspace and user workspaces. ROS workspace may only change if you are using multiple instances of ROS on your computer. If you have followed steps on the link given above you probably have seen environment setup where you source main ROS workspace depending on ROS version. Each ROS setup (Kinetic, Melodic and etc..) have their own workspaces which have to be sourced else system will not recognize that ROS version.
Example of ROS workspace could be
/opt/ros/melodic
/opt/ros/kinetic
User workspaces are created by you and may contain your packages, launch files and etc.
To create user workspace,
create a folder with your workspace name (call it workspace_one and let’s create it within another folder called workspace ) then add src folder inside this folder Afterward, open a terminal inside the newly created workspace folder and execute catkin build. Each time you make a change to your package or stuff inside your workspace you have to update it using catkin build from the main directory for changes to take effect. I opted to use catkin build instead of catkin_make (which is used in official ROS tutorials) as it is easier to debug when you get an error (trust me that’s going to happen a lot) and of course much more pleasing to the eye. Another advantage of catkin build is that is can be called from anywhere be it package root or workspace root. One caveat though workspace created with catkin build cannot be updated using catkin_make To create another workspace, repeat the steps above with different workspace name.
ROS can only work with one user-created workspace at a time so if you have multiple of them it is a must to change your working ROS directory to it as follows:
Open terminal and enter:
gedit ~/.bashrc
Go to the bottom of the file and add the main directory of your workspace to with source keyword added in front of it s.a:
source /home/rufat/workspaces/workspace_one/devel/setup.bash
Voila
The advantage of having multiple workspaces is that you can work on multiple projects at the same time without them interfering with each other.
Here is the gif showing how it’s done: