1. Linux installation from sources

The instructions for installing the PlotJuggler eProsima Edition from sources and the required Qt installation are provided in this page. It is organized as follows:

1.1. Dependencies installation

PlotJuggler eProsima Edition depends on eProsima Fast DDS library, Qt, PlotJuggler, and certain Debian packages. This section describes the instructions for installing PlotJuggler eProsima Edition dependencies and requirements in a Linux environment from sources. The following packages will be installed:

  • foonathan_memory_vendor, an STL compatible C++ memory allocator library.

  • fastcdr, a C++ library that serializes according to the standard CDR serialization mechanism.

  • fastrtps, the core library of eProsima Fast DDS library.

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 PlotJuggler eProsima Edition in a Linux environment from binaries requires the following tools to be installed in the system:

1.1.1.1. CMake, g++, pip, wget and git

These packages provide the tools required to install PlotJuggler eProsima Edition 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. Gtest

Gtest is a unit testing library for C++. By default, PlotJuggler eProsima Edition 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 installation section. For a detailed description of the Gtest installation process, please refer to the Gtest Installation Guide.

1.1.2. Dependencies

PlotJuggler eProsima Edition has the following dependencies, when installed from sources in a Linux environment:

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. eProsima dependencies

If it already exists in the system an installation of Fast DDS library, just source this library when building the PlotJuggler eProsima Edition by using the command:

source <fastdds-installation-path>/install/setup.bash

In other case, just download Fast DDS project from sources and build it together with PlotJuggler eProsima Edition using colcon as it is explained in section Colcon installation.

1.1.2.4. Qt 5.15

Qt 5.15 is needed in order to build PlotJuggler eProsima Edition. To install this Qt version, refer to Qt Downloads website.

Note

When going through the installation steps, make sure the box of component Qt Charts is checked.

1.2. Colcon installation

  1. Create a DDS-Visualizer-Plugin directory and download the .repos file that will be used to install PlotJuggler eProsima Edition and its dependencies:

    mkdir -p ~/DDS-Visualizer-Plugin/src
    cd ~/DDS-Visualizer-Plugin
    wget https://raw.githubusercontent.com/eProsima/fastdds-visualizer-plugin/main/fastdds_visualizer_plugin.repos
    vcs import src < fastdds_visualizer_plugin.repos
    

    Note

    In case there is an already Fast DDS and/or PlotJuggler 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 PlotJuggler eProsima Edition project having sourced its dependencies. Refer to section eProsima dependencies in order to check how to source Fast DDS and PlotJuggler, respectively.

  2. Build the packages:

    colcon build --cmake-args
    
  3. Then run post-installation script setup.bash, so that plotjuggler is visible:

    source ~/DDS-Visualizer-Plugin/install/setup.bash
    

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 PlotJuggler eProsima Edition with CMake, either locally or globally.

1.3.1. Local installation

  1. Create a Fast-DDS directory where to download and build PlotJuggler eProsima Edition and its dependencies:

    mkdir ~/DDS-Visualizer-Plugin
    
  2. Clone the following dependencies and compile them using CMake.

    • Foonathan memory

      cd ~/DDS-Visualizer-Plugin
      git clone https://github.com/eProsima/foonathan_memory_vendor.git
      mkdir foonathan_memory_vendor/build
      cd foonathan_memory_vendor/build
      cmake .. -DCMAKE_INSTALL_PREFIX=~/DDS-Visualizer-Plugin/install -DBUILD_SHARED_LIBS=ON
      cmake --build . --target install
      
    • Fast CDR

      cd ~/DDS-Visualizer-Plugin
      git clone https://github.com/eProsima/Fast-CDR.git
      mkdir Fast-CDR/build
      cd Fast-CDR/build
      cmake .. -DCMAKE_INSTALL_PREFIX=~/DDS-Visualizer-Plugin/install
      cmake --build . --target install
      
    • Fast DDS

      cd ~/DDS-Visualizer-Plugin
      git clone https://github.com/eProsima/Fast-DDS.git
      mkdir Fast-DDS/build
      cd Fast-DDS/build
      cmake .. -DCMAKE_INSTALL_PREFIX=~/DDS-Visualizer-Plugin/install -DCMAKE_PREFIX_PATH=~/DDS-Visualizer-Plugin/install
      cmake --build . --target install
      
    • PlotJuggler

      cd ~/DDS-Visualizer-Plugin
      git clone https://github.com/facontidavide/PlotJuggler.git
      mkdir PlotJuggler/build
      cd PlotJuggler/build
      cmake .. -DCMAKE_INSTALL_PREFIX=~/DDS-Visualizer-Plugin/install -DCMAKE_PREFIX_PATH=~/DDS-Visualizer-Plugin/install
      cmake --build . --target install
      
  3. Once all dependencies are installed, install PlotJuggler eProsima Edition:

    cd ~/DDS-Visualizer-Plugin
    git clone https://github.com/eProsima/fastdds-visualizer-plugin.git
    mkdir fastdds-visualizer-plugin/build
    cd fastdds-visualizer-plugin/build
    cmake .. \
        -DCMAKE_INSTALL_PREFIX=~/DDS-Visualizer-Plugin/install \
        -DCMAKE_PREFIX_PATH=~/DDS-Visualizer-Plugin/install
    cmake --build . --target install
    

    Note

    By default, PlotJuggler eProsima Edition does not compile tests. However, they can be activated by downloading and installing Gtest and building with CMake option -DBUILD_TESTS=ON.

  4. Finally, extend LD_LIBRARY_PATH and PATH environment variables:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/DDS-Visualizer-Plugin/install/lib
    export PATH=$PATH:~/DDS-Visualizer-Plugin/install/bin
    

    Note

    Consider adding these lines to your ~/.bashrc for permanent effect.

1.3.2. Global installation

To install PlotJuggler eProsima Edition system-wide instead of locally, remove all the flags that appear in the configuration steps of Fast-CDR, Fast-DDS, and DDS-Visualizer-Plugin, 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 PlotJuggler eProsima Edition application, do not forget to source the Fast DDS libraries if installed from colcon, or extend LD_LIBRARY_PATH and PATH environment variables if CMake installation was used. Then execute plotjuggler:

# If built has been done using colcon, all projects could be sourced as follows
source install/setup.bash

# If built has been done using cmake directly, extend following environment variables
# with your installation lib/ and bin/ paths:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/DDS-Visualizer-Plugin/install/lib
export PATH=$PATH:~/DDS-Visualizer-Plugin/install/bin

# Finally run plotjuggler
plotjuggler

1.4.1. Source Plugin

In case the PlotJuggler eProsima Edition binary compiled libfastdds_visualizer_plugin_datastream_plugin.so is not in the same folder than the PlotJuggler eProsima Edition executable plotjuggler, the plugin will not be automatically loaded. For this purpose, the user must add the binary path in the application. Once running the PlotJuggler eProsima Edition executable, go to App -> Preferences -> Plugins and add the folder path that contains the binary of the plugin libfastdds_visualizer_plugin_datastream_plugin.so. In case of colcon installation, this folder is <workspace_path>/install/fastdds_visualizer_plugin/bin.

To load new plugins added, the application must be restarted. New plugins added will be stored within the Qt configuration, and will be automatically loaded every time the application is started.

Note

If the plugin does not load properly or app crashes, check that the Fast DDS libraries have been correctly exported to the path. Check Run an application steps.