2. Linux installation from sources¶
For simplicity, the eProsima Shapes Demo installation manual follows the Colcon installation, since eProsima Fast DDS and Fast CDR dependencies are downloaded and installed at the same time that eProsima Shapes Demo is built. However, the user must assure that Qt 5 is installed. On Ubuntu Jammy (22.04) installations, Qt 5 development packages are distributed by Canonical as an APT package and can be downloaded by running the following on a terminal:
apt update apt install -y qtbase5-dev
Table of Contents
2.1. Colcon installation¶
To install eProsima Shapes Demo using colcon, please follow the steps below:
Install the eProsima Fast DDS dependencies and verify that the system meets the installation requirements. The complete list of requirements and dependencies can be found in the Fast DDS Linux Installation Manual. Specifically, follow the steps outlined in sections Requirements and Dependencies.
Install the ROS 2 development tools (Colcon and Vcstool) by executing the following command:
pip install -U colcon-common-extensions vcstool
Note
If this fails due to an Environment Error, add the
--user
flag to thepip
installation command.Create a ShapesDemo directory and download the repos file that will be used to install eProsima Shapes Demo and its dependencies:
mkdir -p ShapesDemo/src && cd ShapesDemo wget https://raw.githubusercontent.com/eProsima/ShapesDemo/master/shapes-demo.repos vcs import src < shapes-demo.repos
Build the packages:
colcon build
Link the application executable to make it accessible from the current directory:
source install/setup.bash
Run eProsima Shapes Demo:
ShapesDemo
2.2. ROS 2 features compilation¶
By default eProsima Shapes Demo can be built and used on a ROS 2 installation as long as an installation of Fast DDS version 2.5.1 or higher is available and a Qt 5 installation is available.
The build process will try to locate the Shapes Demo TypeSupport and, if present, will automatically enable ROS 2 compilation flags.
To download Shapes Demo and its dependencies, including the Shapes Demo TypeSupport, a different repos file, shapes-demo-ros2.repos, can be used. To build eProsima Shapes Demo with ROS 2 features enabled, follow these steps within a sourced ROS 2 Humble installation:
Install the required eProsima Fast DDS dependencies and verify that the system meets the installation requirements. The complete list of requirements and dependencies can be found in the Fast DDS Linux Installation Manual. Specifically, follow the steps outlined in sections Requirements and Dependencies.
Install the ROS 2 development tools (Colcon and Vcstool) by executing the following command:
apt update apt install -y python3-pip wget pip install -U colcon-common-extensions vcstool
Note
If this fails due to an Environment Error, add the
--user
flag to thepip
installation command.Create a shapes_demo_ws directory and download the ROS 2 version of the repos file that will be used to install eProsima Shapes Demo and its dependencies:
mkdir -p ~/shapes_demo_ws/src cd ~/shapes_demo_ws wget https://raw.githubusercontent.com/eProsima/ShapesDemo/master/shapes-demo-ros2.repos vcs import src < shapes-demo-ros2.repos
Build the packages:
cd ~/shapes_demo_ws colcon build
Link the application executable to make it accessible from the current directory:
source ~/shapes_demo_ws/install/setup.bash
Run eProsima Shapes Demo:
ShapesDemo
Note
When eProsima Shapes Demo is compiled with ROS 2, the Shapes Demo TypeSupport (see ROS 2 features compilation compilation section) and the ROS 2 Shapes Demo executable is launched in a context with a valid ROS 2 installation sourced, the default value of the “Use ROS 2 Topics” checkbox will be set to true. Otherwise, the checkbox will remain disabled.