ROS Installation
The robot setup is supposed to run on Ubuntu Mate 20.04 Focal Fossa. ROS Noetic is intended to run with this Ubuntu version. To install ROS follow the installation instructions.
Info
In the 1.4 Installation step you have to choose
how much of ROS you want to install. For the development pc you can go with the sudo apt install ros-noetic-desktop-full
command. For the robot install the ros-noetic-robot Ubuntu package. Other system dependencies will be installed
with the rosdep command, explained in the following section.
Another program that is required to run ROS nodes written with the rospy client library is python-is-python3. Install it with:
1 | |
Dependencies
After having git cloned one or more ROS packages, such as diffbot,
it is necessary to install system dependencies of the packages in the catkin workspace.
For this, ROS provides the rosdep tool.
To install all system dependencies of the packages in your catkin workspace make use of the
following command (source):
1 | |
This will go through each package's package.xml file and install the listed dependencies that are currently
not installed on your system.
Build Tool: catkin_tools
To work with ROS we will use catkin_tools
instead of catkin_make. catkin_tools provide commands such as catkin build which we will use instead of catkin_make because the catkin_tools are more actively developed than catkin_make
ref.
Note
It is recommended to use catkin_tools instead of the default catkin when building ROS workspaces.
catkin_tools provides a number of benefits over regular catkin_make and will be used in the documentation.
All packages can be built using catkin_make however: use catkin_make in place of catkin build where appropriate.
Bug
The current way to install catkin-tools in the documentation
from the Ubuntu package repository doesn't work. Follow the steps below instead for now.
Success
As of now the correct way to install catkin-tools is to use the following command:
1 | |
After sucessfully installing catkin_tools we can create and initialize a workspace (called ros for this project) with the commands listed in the build_tools documentation:
Note
Note that we already sourced the setup.bash while following the ROS installation instructions.
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 28 29 30 | |
Command Overview of catkin_tools
To create packages, which will be covered in the next posts in more depth, we will use catkin create pkg PKG_NAME.
Building the workspace is done with catkin build.
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 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
Environment Setup
Finally the newly built packages have to be loaded in the environment using source.
1 | |
Tip
To avoid tediously typing the above source command, it is convenient to create an alias in your ~/.bashrc or ~/.zshrc similar to the following:
1 | |
1 | |
bash, zsh, etc.).
In case you are unsure, you can check with the echo $SHELL command which will most likely output /bin/bash.
Info
Instead of source it is possible to use the . command instead. Don't confuse it though with the current directory, which is also represented as ..
Resources
Although the catkin tutorial uses catkin_make it provides a helpful guide to create a workspace