Skip to content

Commit

Permalink
Fast DDS statistics backend migration to Fast DDS v3.0 (#239)
Browse files Browse the repository at this point in the history
* Enable CI for Fast DDS v3

Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com>

* Migrate fastdds_statistics_backend to Fast DDS 3

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Fix HelloWorldExample compilation

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Fix error in callbacks overriting

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Add documentation

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Exclude topic_types folder in doxygen-config

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Update documentation

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Fix DiscoveryServers in Monitor

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Update DataWriter Callback

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Refactor backend tests

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Add missing type_object_registry() method in DomainParticipantFactory mock class

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Fix InitMonitor tests

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Change mock TypeObjectRegistry

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Refactor Participant discovery structures

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Uncrustify

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Refactor communication example

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Uncrustify

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* #Refs: 21302: Fix deadlock caused by Subscriber destructor

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: Regenerate types with Gen v4.0.0

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>

* Refs #21302: Add review comments

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

* Refs #21302: uncrustify

Signed-off-by: Carlosespicur <carlosespicur@proton.me>

---------

Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com>
Signed-off-by: Carlosespicur <carlosespicur@proton.me>
Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
Co-authored-by: Raul Sanchez-Mateos <raul@eprosima.com>
Co-authored-by: JesusPoderoso <jesuspoderoso@eprosima.com>
  • Loading branch information
3 people authored Sep 2, 2024
1 parent a0a6225 commit b71a4f1
Show file tree
Hide file tree
Showing 155 changed files with 30,665 additions and 39,509 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
dest_branch:
- '1.x'
- '2.x'
steps:
- name: Mirror action step
id: mirror
Expand Down
28 changes: 12 additions & 16 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,23 @@
name: nightly

on:
workflow_dispatch:
schedule:
- cron: '0 5 * * *'

jobs:

reusable_tests_v2:
name: reusable_tests_v2
reusable_tests:
strategy:
fail-fast: false
matrix:
- custom_version_build: 'v2'
ref: '1.x'
- custom_version_build: 'v3'
ref: 'main'
name: reusable_tests
uses: ./.github/workflows/reusable-workflow.yml
with:
custom_version_build: 'v2'
custom_version_build: ${{ matrix.custom_version_build }}
dependencies_artifact_postfix: '_nightly'
ref: '1.x'
ref: ${{ matrix.ref }}
secrets: inherit

# Uncomment this block to run the tests for Fast DDS v3 when Fast DDS Statistics Backend is updated
# Also specify here (and above) the workflow version/branch to use (@v0, @main, etc.)
# reusable_tests_v3:
# name: reusable_tests_v3
# uses: ./.github/workflows/reusable-workflow.yml
# with:
# custom_version_build: 'v3'
# dependencies_artifact_postfix: '_nightly'
# ref: 'main'
# secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
name: reusable_tests
uses: ./.github/workflows/reusable-workflow.yml
with:
custom_version_build: ${{ inputs.custom_version_build || 'v2' }}
custom_version_build: ${{ inputs.custom_version_build || 'v3' }}
dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix || '_nightly' }}
ref: ${{ github.ref }}
secrets: inherit
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ include(${PROJECT_SOURCE_DIR}/cmake/common/asan.cmake)
###############################################################################
# Load external projects.
###############################################################################
set(FASTDDS_MIN_VERSION "2.13.0")
set(FASTDDS_MIN_VERSION "3.0.0")

find_package(fastcdr REQUIRED)
find_package(fastrtps ${FASTDDS_MIN_VERSION} REQUIRED)
find_package(fastdds ${FASTDDS_MIN_VERSION} REQUIRED)

###############################################################################
# Test system configuration
Expand Down
4 changes: 2 additions & 2 deletions cmake/packaging/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ if(NOT fastcdr_FOUND)
find_package(fastcdr)
endif()

if(NOT fastrtps_FOUND)
find_package(fastrtps)
if(NOT fastdds_FOUND)
find_package(fastdds)
endif()

include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake)
4 changes: 2 additions & 2 deletions colcon.meta
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"names":
{
"fastrtps":
"fastdds":
{
"cmake-args":
[
Expand All @@ -12,7 +12,7 @@
{
"cmake-args":
[
"-DBUILD_DOCS=OFF",
"-DBUILD_DOCS=ON",
"-DCOMPILE_EXAMPLES=OFF",
]
}
Expand Down
2 changes: 1 addition & 1 deletion colcon.pkg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "fastdds_statistics_backend",
"type": "cmake",
"build-dependencies": ["fastrtps"]
"build-dependencies": ["fastcdr", "fastdds"]
}
33 changes: 3 additions & 30 deletions docs/code/StatisticsBackendTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,13 @@ void init_monitor_examples()
StatisticsBackend::init_monitor(0);

// Init a monitor for a Fast DDS Discovery Server network which server is located in IPv4
// address 127.0.0.1 and port 11811 using UDP as transport layer, and that uses the default GUID prefix
// eprosima::fastdds::rtps::DEFAULT_ROS2_SERVER_GUIDPREFIX.
// address 127.0.0.1 and port 11811 using UDP as transport layer.
// The monitor has no listener associated.
EntityId disc_server_monitor_id =
StatisticsBackend::init_monitor("UDPv4:[127.0.0.1]:11811");

// Init a monitor for a Fast DDS Discovery Server network which server is located in IPv4
// address 127.0.0.1 and port 11811 using UDP as transport layer, and that uses the GUID prefix
// "44.53.01.5f.45.50.52.4f.53.49.4d.41".
// The monitor has no listener associated.
EntityId disc_server_prefix_monitor_id =
StatisticsBackend::init_monitor("44.53.01.5f.45.50.52.4f.53.49.4d.41", "UDPv4:[localhost]:11811");
//!--
static_cast<void>(domain_monitor_id);
static_cast<void>(disc_server_monitor_id);
static_cast<void>(disc_server_prefix_monitor_id);
}
{
//CONF-INIT-MONITOR-LISTENER-EXAMPLE
Expand All @@ -70,23 +61,14 @@ void init_monitor_examples()
StatisticsBackend::init_monitor(0, &domain_listener);

// Init a monitor for a Fast DDS Discovery Server network which server is located in IPv4
// address 127.0.0.1 and port 11811 using UDP as transport layer, and that uses the default GUID prefix
// eprosima::fastdds::rtps::DEFAULT_ROS2_SERVER_GUIDPREFIX.
// address 127.0.0.1 and port 11811 using UDP as transport layer.
// The monitor uses a custom listener.
EntityId disc_server_monitor_id =
StatisticsBackend::init_monitor("UDPv4:[127.0.0.1]:11811", &domain_listener);

// Init a monitor for a Fast DDS Discovery Server network which server is located in IPv4
// address 127.0.0.1 and port 11811 using UDP transport layer, and that uses the GUID prefix
// "44.53.01.5f.45.50.52.4f.53.49.4d.41".
// The monitor uses a custom listener.
EntityId disc_server_prefix_monitor_id =
StatisticsBackend::init_monitor("44.53.01.5f.45.50.52.4f.53.49.4d.41", "UDPv4:[127.0.0.1]:11811",
&domain_listener);
//!--
static_cast<void>(domain_monitor_id);
static_cast<void>(disc_server_monitor_id);
static_cast<void>(disc_server_prefix_monitor_id);
}
{
//CONF-INIT-MONITOR-MASKS-EXAMPLE
Expand All @@ -103,24 +85,15 @@ void init_monitor_examples()
StatisticsBackend::init_monitor(0, &domain_listener, callback_mask, datakind_mask);

// Init a monitor for a Fast DDS Discovery Server network which server is located in IPv4
// address 127.0.0.1 and port 11811 using UDP transport layer, and that uses the default GUID prefix
// eprosima::fastdds::rtps::DEFAULT_ROS2_SERVER_GUIDPREFIX.
// address 127.0.0.1 and port 11811 using UDP transport layer.
// The monitor uses a custom listener, a CallbackMask, and a DataKindMask.
EntityId disc_server_monitor_id =
StatisticsBackend::init_monitor("UDPv4:[localhost]:11811", &domain_listener, callback_mask,
datakind_mask);

// Init a monitor for a Fast DDS Discovery Server network which server is located in IPv4
// address 127.0.0.1 and port 11811 using UDP transport layer, and that uses the GUID prefix
// "44.53.01.5f.45.50.52.4f.53.49.4d.41".
// The monitor uses a custom listener, a CallbackMask, and a DataKindMask.
EntityId disc_server_prefix_monitor_id =
StatisticsBackend::init_monitor("44.53.01.5f.45.50.52.4f.53.49.4d.41", "UDPv4:[127.0.0.1]:11811",
&domain_listener, callback_mask, datakind_mask);
//!--
static_cast<void>(domain_monitor_id);
static_cast<void>(disc_server_monitor_id);
static_cast<void>(disc_server_prefix_monitor_id);
}
}

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_cmake_project_version(cmakelists):
}
"""
matches = re.findall(
'project\(.*VERSION\s+(\d+)\.(\d+)\.(\d+)',
r'project\(.*VERSION\s+(\d+)\.(\d+)\.(\d+)',
"".join(open(cmakelists, 'r').readlines()),
flags=re.MULTILINE)[0]
return {
Expand Down Expand Up @@ -297,7 +297,7 @@ def configure_doxyfile(
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down
3 changes: 2 additions & 1 deletion docs/doxygen-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ FILE_PATTERNS = *.c \
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = "*/nlohmann-json/*"
EXCLUDE_PATTERNS = "*/nlohmann-json/*" \
"*/topic_types/*
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = "@PROJECT_SOURCE_DIR@"
EXAMPLE_PATTERNS = *
Expand Down
23 changes: 12 additions & 11 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ breathe==4.35.0
colcon-common-extensions==0.2.1
colcon-mixin==0.2.0
doc8==0.10.1
docutils==0.16.0
docutils==0.20.1
GitPython==3.1.41
setuptools==67.6.0
sphinx_rtd_theme==0.5.2
sphinx-tabs==3.2.0
sphinx==4.3.1
sphinxcontrib-applehelp==1.0.4
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.1
sphinx_rtd_theme==2.0.0
sphinx-tabs==3.4.5
sphinx==7.3.6
sphinxcontrib-applehelp==1.0.8
sphinxcontrib-devhelp==1.0.6
sphinxcontrib-htmlhelp==2.0.5
sphinxcontrib-imagehelper==1.1.1
sphinxcontrib-plantuml==0.22
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sphinxcontrib.spelling==7.2.1
sphinxcontrib-plantuml==0.29
sphinxcontrib-qthelp==1.0.7
sphinxcontrib-serializinghtml==1.1.10
sphinxcontrib.spelling==8.0.0
vcstool==0.3.0
xmlschema==2.1.1
4 changes: 2 additions & 2 deletions docs/rst/notes/notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ This release includes the following **dependencies update**:
- `v2.14.0 <https://github.com/eProsima/Fast-DDS/releases/tag/v2.14.0>`_
* - Fast DDS Gen
- `eProsima/Fast-DDS-Gen <https://github.com/eProsima/Fast-DDS-Gen>`_
- `v3.0.0 <https://github.com/eProsima/Fast-DDS-Gen/releases/tag/v3.0.0>`_
- `v3.0.0 <https://github.com/eProsima/Fast-DDS-Gen/releases/tag/v3.0.0>`__
- `v3.3.0 <https://github.com/eProsima/Fast-DDS-Gen/releases/tag/v3.3.0>`_
* - IDL Parser
- `eProsima/IDL-Parser <https://github.com/eProsima/IDL-Parser.git>`_
- `v1.7.2 <https://github.com/eProsima/IDL-Parser/releases/tag/v1.7.2>`_
- `v3.0.0 <https://github.com/eProsima/IDL-Parser/releases/tag/v3.0.0>`_
- `v3.0.0 <https://github.com/eProsima/IDL-Parser/releases/tag/v3.0.0>`__


Previous versions
Expand Down
2 changes: 1 addition & 1 deletion docs/rst/notes/previous_versions/v1.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This release includes the following **dependencies update**:
* - Fast DDS Gen
- `eProsima/Fast-DDS-Gen <https://github.com/eProsima/Fast-DDS-Gen>`_
- `v2.5.1 <https://github.com/eProsima/Fast-DDS-Gen/releases/tag/v2.5.1>`_
- `v3.0.0 <https://github.com/eProsima/Fast-DDS-Gen/releases/tag/v3.0.0>`_
- `v3.0.0 <https://github.com/eProsima/Fast-DDS-Gen/releases/tag/v3.0.0>`__
* - IDL Parser
- `eProsima/IDL-Parser <https://github.com/eProsima/IDL-Parser.git>`_
- `v1.6.0 <https://github.com/eProsima/IDL-Parser/releases/tag/v1.6.0>`_
Expand Down
2 changes: 1 addition & 1 deletion docs/rst/statistics_backend/get_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Get statistical data
|DataKind-api| within a time frame (for more information about all the reported |DataKind-api|, please refer to
:ref:`types_data_kind`).
This time interval is evenly divided into the specified number of bins, each one with size
:math:`(t_to - t_from)/(\# of bins)`.
:math:`(t_{to} - t_{from})/(\# bins)`.
For each of these bins, a new |StatisticsData-api| value is calculated applying the given |StatisticKind-api| to all the
data points in it.
The result is a collection of |StatisticsData-api| elements with size equal to the number of specified bins.
Expand Down
2 changes: 1 addition & 1 deletion docs/rst/statistics_backend/init_monitor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Initializing a monitor on a certain Domain ID makes *eProsima Fast DDS Statistic
start monitoring the statistics data and entity discoveries on that domain.
No statistics data will be gathered unless there is a monitor initialized in the required domain.

|StatisticsBackend-api| provides three overloads of |init_monitor-api| that can be used to start a monitorization on a
|StatisticsBackend-api| provides two overloads of |init_monitor-api| that can be used to start a monitorization on a
DDS domain or a *Fast DDS* Discovery Server network.

.. literalinclude:: /code/StatisticsBackendTests.cpp
Expand Down
8 changes: 4 additions & 4 deletions examples/cpp/HelloWorldExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ if(NOT fastcdr_FOUND)
find_package(fastcdr REQUIRED)
endif()

if(NOT fastrtps_FOUND)
find_package(fastrtps REQUIRED)
if(NOT fastdds_FOUND)
find_package(fastdds REQUIRED)
endif()

if(NOT fastdds_statistics_backend_FOUND)
Expand All @@ -43,7 +43,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR
endif()
endif()

message(STATUS "Configuring HelloWorld example...")
file(GLOB HELLOWORLD_EXAMPLE_SOURCES_CXX "*.cxx")
file(GLOB HELLOWORLD_EXAMPLE_SOURCES_CPP "*.cpp")

Expand All @@ -52,6 +51,7 @@ target_compile_definitions(HelloWorldExample PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
target_link_libraries(HelloWorldExample fastrtps fastcdr fastdds_statistics_backend)

target_link_libraries(HelloWorldExample fastdds fastcdr fastdds_statistics_backend)
install(TARGETS HelloWorldExample
RUNTIME DESTINATION examples/cpp/HelloWorldExample/${BIN_INSTALL_DIR})
Loading

0 comments on commit b71a4f1

Please sign in to comment.