" MicromOne: Robotics Development Environment – Ubuntu 20.04 LTS

Pagine

Robotics Development Environment – Ubuntu 20.04 LTS

Ubuntu 20.04 LTS

ROS Noetic
Gazebo 11

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 -y

Install the basic development tools:

sudo apt install -y \
build-essential \
cmake \
git \
curl \
wget \
unzip \
pkg-config \
python3 \
python3-pip \
python3-dev \
python3-numpy

These 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 update

Install ROS Noetic Desktop Full:

sudo apt install -y ros-noetic-desktop-full

Configure ROS to start automatically in every terminal:

echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc

source ~/.bashrc

Verify the installation:

rosversion -d

Expected output:

noetic

4. 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-tools

Initialize rosdep:

sudo rosdep init
rosdep update

If 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 --version

Expected version:

Gazebo multi-robot simulator, version 11.x

If Gazebo is not installed, execute:

sudo apt install -y gazebo11 libgazebo11-dev

Gazebo 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-plugins

These packages enable communication between ROS and Gazebo.

Verify the installation:

rospack find gazebo_ros

Important plugins for a mobile robot include:

Plugin

Function

libgazebo_ros_diff_drive.so

Differential drive control

libgazebo_ros_camera.so

Camera simulation

libgazebo_ros_laser.so

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-publisher

Install the autonomous navigation packages:

sudo apt install -y \
ros-noetic-amcl \
ros-noetic-map-server \
ros-noetic-move-base \
ros-noetic-navigation

These 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-opencv

Check the Python installation:

python3 -c "import cv2; print(cv2.__version__)"

Check the C++ configuration:

pkg-config --modversion opencv4

9. Eigen installation

Eigen is a C++ template library for linear algebra, matrix operations, vector calculations and geometric transformations.

Install:

sudo apt install -y libeigen3-dev

Verify the installation:

dpkg -s libeigen3-dev | grep Version

10. 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-tools

Verify the installation:

pkg-config --modversion pcl_common

11. Create a Catkin workspace

Create the ROS workspace directory:

mkdir -p ~/catkin_ws/src

cd ~/catkin_ws

catkin_make

Configure the workspace:

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

source ~/.bashrc

Verify the configuration:

echo $ROS_PACKAGE_PATH

12. 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_ros

13. Initial system test

Open the first terminal and start the ROS master:

roscore

Open a second terminal and launch RViz:

rosrun rviz rviz

Open a third terminal and launch Gazebo:

gazebo9

If 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