1. Linux installation from sources¶
The instructions for installing the eProsima DDS Record from sources and its required dependencies are provided in this page. It is organized as follows:
1.1. Dependencies installation¶
DDS Recorder depends on eProsima Fast DDS library and certain Debian packages. This section describes the instructions for installing DDS Recorder dependencies and requirements in a Linux environment from sources. The following packages will be installed:
foonathan_memory_vendor
, an STL compatible C++ memory allocation library.fastcdr
, a C++ library that serializes according to the standard CDR serialization mechanism.fastrtps
, the core library of eProsima Fast DDS library.cmake_utils
, an eProsima utils library for CMake.cpp_utils
, an eProsima utils library for C++.ddspipe
, an eProsima internal library that enables the communication of DDS interfaces.
First of all, the Requirements and Dependencies detailed below need to be met. Afterwards, the user can choose whether to follow either the colcon or the CMake installation instructions.
1.1.1. Requirements¶
The installation of eProsima DDS Record in a Linux environment from sources requires the following tools to be installed in the system:
Colcon [optional]
Fast DDS Python [for remote controller only]
Gtest [for test only]
1.1.1.1. CMake, g++, pip, wget and git¶
These packages provide the tools required to install eProsima DDS Record and its dependencies from command line. Install CMake, g++, pip, wget and git using the package manager of the appropriate Linux distribution. For example, on Ubuntu use the command:
sudo apt install cmake g++ pip wget git
1.1.1.2. Colcon¶
colcon is a command line tool based on CMake aimed at building sets of software packages. Install the ROS 2 development tools (colcon and vcstool) by executing the following command:
pip3 install -U colcon-common-extensions vcstool
Note
If this fails due to an Environment Error, add the --user
flag to the pip3
installation command.
1.1.1.3. Fast DDS Python¶
eProsima Fast DDS Python is a Python binding for the eProsima Fast DDS C++ library. It is only required for the remote controller application.
Clone the Github repository into the eProsima DDS Record workspace and compile it with colcon as a dependency package. Use the following command to download the code:
git clone https://github.com/eProsima/Fast-DDS-python.git src/Fast-DDS-python
1.1.1.4. Gtest¶
Gtest is a unit testing library for C++. By default, eProsima DDS Record does not compile tests. It is possible to activate them with the opportune CMake options when calling colcon or CMake. For more details, please refer to the CMake options section. For a detailed description of the Gtest installation process, please refer to the Gtest Installation Guide.
It is also possible to clone the Gtest Github repository into the eProsima DDS Record workspace and compile it with colcon as a dependency package. Use the following command to download the code:
git clone --branch release-1.11.0 https://github.com/google/googletest src/googletest-distribution
1.1.2. Dependencies¶
eProsima DDS Record has the following dependencies, when installed from sources in a Linux environment:
SWIG [for remote controller only]
1.1.2.1. Asio and TinyXML2 libraries¶
Asio is a cross-platform C++ library for network and low-level I/O programming, which provides a consistent asynchronous model. TinyXML2 is a simple, small and efficient C++ XML parser. Install these libraries using the package manager of the appropriate Linux distribution. For example, on Ubuntu use the command:
sudo apt install libasio-dev libtinyxml2-dev
1.1.2.2. OpenSSL¶
OpenSSL is a robust toolkit for the TLS and SSL protocols and a general-purpose cryptography library. Install OpenSSL using the package manager of the appropriate Linux distribution. For example, on Ubuntu use the command:
sudo apt install libssl-dev
1.1.2.3. yaml-cpp¶
yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec, and is used by DDS Recorder application to parse the provided configuration files. Install yaml-cpp using the package manager of the appropriate Linux distribution. For example, on Ubuntu use the command:
sudo apt install libyaml-cpp-dev
1.1.2.4. SWIG¶
SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. It is leveraged by Fast DDS Python to generate a Python wrapper over Fast DDS library. SWIG is only a requirement for the remote controller application. It can be installed using the package manager of the appropriate Linux distribution. For example, on Ubuntu use the command:
sudo apt install swig libpython3-dev
1.1.2.5. MCAP dependencies¶
MCAP is a modular container format and logging library for pub/sub messages with arbitrary message serialization. It is primarily intended for use in robotics applications, and works well under various workloads, resource constraints, and durability requirements. MCAP C++ library is packed within DDS Recorder as a header-only, but its dependencies need to be installed using the package manager of the appropriate Linux distribution. For example, on Ubuntu use the command:
sudo apt install liblz4-dev libzstd-dev
1.1.2.6. eProsima dependencies¶
If it already exists in the system an installation of Fast DDS and DDS Pipe libraries, just source this libraries when building eProsima DDS Record by running the following commands. In other case, just skip this step.
source <fastdds-installation-path>/install/setup.bash
source <ddspipe-installation-path>/install/setup.bash
1.2. Colcon installation (recommended)¶
Create a
DDS-Record
directory and download the.repos
file that will be used to install eProsima DDS Record and its dependencies:mkdir -p ~/DDS-Record/src cd ~/DDS-Record wget https://raw.githubusercontent.com/eProsima/DDS-Recorder/main/ddsrecorder.repos vcs import src < ddsrecorder.repos
Note
In case there is already a Fast DDS installation in the system it is not required to download and build every dependency in the
.repos
file. It is just needed to download and build the eProsima DDS Record project having sourced its dependencies. Refer to section eProsima dependencies in order to check how to source Fast DDS library.Build the packages:
colcon build
Note
To install both DDS Recorder and its remote controller application, compilation flag -DBUILD_DDSRECORDER_CONTROLLER=ON
is required.
Note
Being based on CMake, it is possible to pass the CMake configuration options to the colcon build
command.
For more information on the specific syntax, please refer to the CMake specific arguments page of the colcon manual.
1.3. CMake installation¶
This section explains how to compile eProsima DDS Record with CMake, either locally or globally.
1.3.1. Local installation¶
Create a
DDS-Recorder
directory where to download and build DDS Recorder and its dependencies:mkdir -p ~/DDS-Record/src mkdir -p ~/DDS-Record/build cd ~/DDS-Record wget https://raw.githubusercontent.com/eProsima/DDS-Recorder/main/ddsrecorder.repos vcs import src < ddsrecorder.repos
Compile all dependencies using CMake.
-
cd ~/DDS-Record mkdir build/foonathan_memory_vendor cd build/foonathan_memory_vendor cmake ~/DDS-Record/src/foonathan_memory_vendor -DCMAKE_INSTALL_PREFIX=~/DDS-Record/install -DBUILD_SHARED_LIBS=ON cmake --build . --target install
-
cd ~/DDS-Record mkdir build/fastcdr cd build/fastcdr cmake ~/DDS-Record/src/fastcdr -DCMAKE_INSTALL_PREFIX=~/DDS-Record/install cmake --build . --target install
-
cd ~/DDS-Record mkdir build/fastdds cd build/fastdds cmake ~/DDS-Record/src/fastdds -DCMAKE_INSTALL_PREFIX=~/DDS-Record/install -DCMAKE_PREFIX_PATH=~/DDS-Record/install cmake --build . --target install
-
# CMake Utils cd ~/DDS-Record mkdir build/cmake_utils cd build/cmake_utils cmake ~/DDS-Record/src/dev-utils/cmake_utils -DCMAKE_INSTALL_PREFIX=~/DDS-Record/install -DCMAKE_PREFIX_PATH=~/DDS-Record/install cmake --build . --target install # C++ Utils cd ~/DDS-Record mkdir build/cpp_utils cd build/cpp_utils cmake ~/DDS-Record/src/dev-utils/cpp_utils -DCMAKE_INSTALL_PREFIX=~/DDS-Record/install -DCMAKE_PREFIX_PATH=~/DDS-Record/install cmake --build . --target install
-
# ddspipe_core cd ~/DDS-Record mkdir build/ddspipe_core cd build/ddspipe_core cmake ~/DDS-Record/src/ddspipe/ddspipe_core -DCMAKE_INSTALL_PREFIX=~/DDS-Record/install -DCMAKE_PREFIX_PATH=~/DDS-Record/install cmake --build . --target install # ddspipe_participants cd ~/DDS-Record mkdir build/ddspipe_participants cd build/ddspipe_participants cmake ~/DDS-Record/src/ddspipe/ddspipe_participants -DCMAKE_INSTALL_PREFIX=~/DDS-Record/install -DCMAKE_PREFIX_PATH=~/DDS-Record/install cmake --build . --target install # ddspipe_yaml cd ~/DDS-Record mkdir build/ddspipe_yaml cd build/ddspipe_yaml cmake ~/DDS-Record/src/ddspipe/ddspipe_yaml -DCMAKE_INSTALL_PREFIX=~/DDS-Record/install -DCMAKE_PREFIX_PATH=~/DDS-Record/install cmake --build . --target install
-
Once all dependencies are installed, install eProsima DDS Record:
# ddsrecorder_participants cd ~/DDS-Record mkdir build/ddsrecorder_participants cd build/ddsrecorder_participants cmake ~/DDS-Record/src/ddsrecorder/ddsrecorder_participants -DCMAKE_INSTALL_PREFIX=~/DDS-Record/install -DCMAKE_PREFIX_PATH=~/DDS-Record/install cmake --build . --target install # ddsrecorder_yaml cd ~/DDS-Record mkdir build/ddsrecorder_yaml cd build/ddsrecorder_yaml cmake ~/DDS-Record/src/ddsrecorder/ddsrecorder_yaml -DCMAKE_INSTALL_PREFIX=~/DDS-Record/install -DCMAKE_PREFIX_PATH=~/DDS-Record/install cmake --build . --target install # ddsrecorder cd ~/DDS-Record mkdir build/ddsrecorder_tool cd build/ddsrecorder_tool cmake ~/DDS-Record/src/ddsrecorder/ddsrecorder -DCMAKE_INSTALL_PREFIX=~/DDS-Record/install -DCMAKE_PREFIX_PATH=~/DDS-Record/install cmake --build . --target install
Note
By default, eProsima DDS Record does not compile tests. However, they can be activated by downloading and installing Gtest and building with CMake option
-DBUILD_TESTS=ON
.Optionally, install the remote controller application along with its dependency Fast DDS Python:
# Fast DDS Python cd ~/DDS-Record mkdir build/fastdds_python cd build/fastdds_python cmake ~/DDS-Record/src/Fast-DDS-python/fastdds_python -DCMAKE_INSTALL_PREFIX=~/DDS-Record/install -DCMAKE_PREFIX_PATH=~/DDS-Record/install cmake --build . --target install # Remote Controller Application cd ~/DDS-Record mkdir build/controller_tool cd build/controller_tool cmake ~/DDS-Record/src/ddsrecorder/controller/controller_tool -DCMAKE_INSTALL_PREFIX=~/DDS-Record/install -DCMAKE_PREFIX_PATH=~/DDS-Record/install cmake --build . --target install
1.3.2. Global installation¶
To install eProsima DDS Record system-wide instead of locally, remove all the flags that appear in the configuration steps of Fast-CDR
, Fast-DDS
, Dev-Utils
, DDS-Pipe
, and DDS-Record
, and change the first in the configuration step of foonathan_memory_vendor
to the following:
-DCMAKE_INSTALL_PREFIX=/usr/local/ -DBUILD_SHARED_LIBS=ON
1.4. Run an application¶
To run the DDS Recorder tool, source the installation path and execute the executable file that has been installed in <install-path>/ddsrecorder_tool/bin/ddsrecorder
:
# If built has been done using colcon, all projects could be sourced as follows
source install/setup.bash
./<install-path>/ddsrecorder_tool/bin/ddsrecorder
Be sure that this executable has execution permissions.