Ubuntu 20.04 LTS
Development environment for mobile robotics, simulation, computer vision and autonomous navigation.
1. Overview and objectives
The objective is to build a complete robotics development environment for designing, programming, simulating and testing autonomous mobile robots.
The installation includes the following components:
Component | Version / Package |
|---|---|
Operating System | Ubuntu 20.04 LTS |
Robotics Middleware | ROS Noetic |
3D Simulator | Gazebo 11 Classic |
Programming Language | C++ |
Build System | CMake |
Computer Vision | OpenCV 4 |
Linear Algebra | Eigen 3 |
Point Cloud Processing | PCL |
Visualization | RViz |
Navigation | ROS Navigation Stack |
2. Basic development environment
Open a terminal and update the operating system:
sudo apt update
sudo apt upgrade -yInstall the basic development tools:
sudo apt install -y \
build-essential \
cmake \
git \
curl \
wget \
unzip \
pkg-config \
python3 \
python3-pip \
python3-dev \
python3-numpyThese packages provide the essential tools for compiling C++ applications, managing repositories and installing software dependencies.
3. ROS Noetic installation
Add the official ROS repository:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'Add the repository signing key:
sudo apt install -y curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -Update the package lists:
sudo apt updateInstall ROS Noetic Desktop Full:
sudo apt install -y ros-noetic-desktop-fullConfigure ROS to start automatically in every terminal:
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrcVerify the installation:
rosversion -dExpected output:
noetic4. Install rosdep and Catkin tools
Install the tools required for dependency management and ROS workspace compilation:
sudo apt install -y \
python3-rosdep \
python3-rosinstall \
python3-rosinstall-generator \
python3-wstool \
python3-catkin-toolsInitialize rosdep:
sudo rosdep init
rosdep updateIf rosdep init reports that it has already been initialized, no further action is required.
5. Gazebo 11 installation
Check whether Gazebo is already installed:
gazebo --versionExpected version:
Gazebo multi-robot simulator, version 11.xIf Gazebo is not installed, execute:
sudo apt install -y gazebo11 libgazebo11-devGazebo 11 Classic provides a 3D simulation environment for testing robots, sensors, cameras, LiDAR systems and robotic control algorithms.
6. ROS and Gazebo integration
Install the ROS/Gazebo integration packages:
sudo apt install -y \
ros-noetic-gazebo-ros \
ros-noetic-gazebo-ros-pkgs \
ros-noetic-gazebo-pluginsThese packages enable communication between ROS and Gazebo.
Verify the installation:
rospack find gazebo_rosImportant plugins for a mobile robot include:
Plugin | Function |
|---|---|
| Differential drive control |
| Camera simulation |
| Laser scanner simulation |
7. RViz and robotics tools
Install the packages required to describe, visualize and control the robot:
sudo apt install -y \
ros-noetic-rviz \
ros-noetic-xacro \
ros-noetic-robot-state-publisher \
ros-noetic-joint-state-publisherInstall the autonomous navigation packages:
sudo apt install -y \
ros-noetic-amcl \
ros-noetic-map-server \
ros-noetic-move-base \
ros-noetic-navigationThese components provide the foundations for robot localization, mapping and autonomous navigation.
8. OpenCV installation
OpenCV is a computer vision library used for image processing, object detection and visual perception.
Install the C++ and Python packages:
sudo apt install -y \
libopencv-dev \
python3-opencvCheck the Python installation:
python3 -c "import cv2; print(cv2.__version__)"Check the C++ configuration:
pkg-config --modversion opencv49. Eigen installation
Eigen is a C++ template library for linear algebra, matrix operations, vector calculations and geometric transformations.
Install:
sudo apt install -y libeigen3-devVerify the installation:
dpkg -s libeigen3-dev | grep Version10. PCL installation
PCL (Point Cloud Library) is an essential library for processing 3D point clouds generated by LiDAR, RGB-D cameras and other depth sensors.
Install:
sudo apt install -y \
libpcl-dev \
pcl-toolsVerify the installation:
pkg-config --modversion pcl_common11. Create a Catkin workspace
Create the ROS workspace directory:
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin_makeConfigure the workspace:
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrcVerify the configuration:
echo $ROS_PACKAGE_PATH12. Final environment verification
Run the following commands to verify the main software components:
rosversion -d
gazebo --version
cmake --version
g++ --version
pkg-config --modversion opencv4
pkg-config --modversion pcl_common
rospack find gazebo_ros13. Initial system test
Open the first terminal and start the ROS master:
roscoreOpen a second terminal and launch RViz:
rosrun rviz rvizOpen a third terminal and launch Gazebo:
gazebo9If all applications start correctly, the basic robotics development environment is ready.
Terminal
roscore
Terminal II
cd ~/catkin_ws
source devel/setup.bash
export LIBGL_ALWAYS_SOFTWARE=1
roslaunch my_robot world.launch
Terminal 3
cd ~/catkin_ws
source devel/setup.bash
roslaunch my_robot amcl.launch