Skip to content

Commit

Permalink
Merge branch 'develop' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogs9 authored Mar 29, 2021
2 parents b596f1d + f6d7f20 commit 0aea832
Show file tree
Hide file tree
Showing 64 changed files with 4,512 additions and 1,710 deletions.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/general-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: General issue
about: General issue template for micro XRCE-DDS Agent
title: ''
labels: ''
assignees: ''

---

## Issue template

- Hardware description: <!-- hardware where you are running the micro XRCE-DDS Agent -->
- OS: <!-- OS where you are using the micro XRCE-DDS Agent -->
- Installation type: <!-- CMake flags, FastDDS version, etc -->
- Version or commit hash: <!-- version or branch used to compile the micro XRCE-DDS Agent -->

#### Steps to reproduce the issue
<!-- Detailed instructions on how to reliably reproduce this issue http://sscce.org/-->

#### Expected behavior

#### Actual behavior

#### Additional information
42 changes: 25 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ option(UAGENT_ISOLATED_INSTALL "Install the project and dependencies into separa
option(UAGENT_USE_INTERNAL_GTEST "Enable internal GTest libraries." OFF)
option(BUILD_SHARED_LIBS "Control shared/static building." ON)

option(UAGENT_USE_SYSTEM_FASTDDS "Force find and use system installed Fast-DDS." OFF)
option(UAGENT_FAST_PROFILE "Build FastMiddleware profile." ON)
option(UAGENT_CED_PROFILE "Build CedMiddleware profile." ON)
option(UAGENT_DISCOVERY_PROFILE "Build Discovery profile." ON)
option(UAGENT_P2P_PROFILE "Build P2P discovery profile." ON)
option(UAGENT_LOGGER_PROFILE "Build logger profile." ON)
option(UAGENT_SECURITY_PROFILE "Build security profile." OFF)
option(UAGENT_CLI_PROFILE "Build CLI profile." ON)
option(UAGENT_BUILD_EXECUTABLE "Build MicroXRCE-DDS Agent provided executable." ON)
option(UAGENT_BUILD_EXECUTABLE "Build Micro XRCE-DDS Agent provided executable." ON)
option(UAGENT_BUILD_USAGE_EXAMPLES "Build Micro XRCE-DDS Agent built-in usage examples" OFF)

set(UAGENT_P2P_CLIENT_VERSION 2.0.0 CACHE STRING "Sets Micro XRCE-DDS client version for P2P")
set(UAGENT_P2P_CLIENT_TAG develop CACHE STRING "Sets Micro XRCE-DDS client tag for P2P")

option(UAGENT_BUILD_CI_TESTS "Build CI test cases.")
if(UAGENT_BUILD_CI_TESTS)
Expand Down Expand Up @@ -67,23 +71,21 @@ set(_fastcdr_version 1.0.13)
set(_fastcdr_tag v1.0.13)
list(APPEND _deps "fastcdr\;${_fastcdr_version}")

if(UAGENT_CLI_PROFILE)
set(_cli11_version 1.7.1)
set(_cli11_tag v1.7.1)
list(APPEND _deps "CLI11\;${_cli11_version}")
endif()

if(UAGENT_P2P_PROFILE)
set(_microxrcedds_client_version 1.2.3)
set(_microxrcedds_client_tag v1.2.3)
set(_microxrcedds_client_version ${UAGENT_P2P_CLIENT_VERSION})
set(_microxrcedds_client_tag ${UAGENT_P2P_CLIENT_TAG})
list(APPEND _deps "microxrcedds_client\;${_microxrcedds_client_version}")
endif()

if(UAGENT_FAST_PROFILE)
set(_fastdds_version 2.0)
set(_fastdds_tag 2.0.x)
if(UAGENT_USE_SYSTEM_FASTDDS)
set(_fastdds_version 2)
else()
set(_fastdds_version 2.0.2)
set(_fastdds_tag v2.0.2)
set(_foonathan_memory_tag c619113) # This tag should be updated every time it gets updated in foonathan_memory_vendor eProsima's package
endif()
list(APPEND _deps "fastrtps\;${_fastdds_version}")
set(_foonathan_memory_tag c619113) # This tag should be updated every time it gets updated in foonathan_memory_vendor eProsima's package
endif()

if(UAGENT_LOGGER_PROFILE)
Expand All @@ -97,7 +99,7 @@ endif()
###############################################################################
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
if(NOT UAGENT_SUPERBUILD)
project(microxrcedds_agent VERSION "1.4.2" LANGUAGES C CXX)
project(microxrcedds_agent VERSION "2.0.0" LANGUAGES C CXX)
else()
project(uagent_superbuild NONE)
include(${PROJECT_SOURCE_DIR}/cmake/SuperBuild.cmake)
Expand Down Expand Up @@ -129,6 +131,7 @@ set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${PROJECT_BINARY_DIR}/temp_install)
foreach(d ${_deps})
list(GET d 0 _name)
list(GET d 1 _version)
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${PROJECT_BINARY_DIR}/temp_install/${_name}-${_version})
find_package(${_name} ${_version} REQUIRED)
endforeach()

Expand Down Expand Up @@ -188,9 +191,10 @@ set(SRCS
src/cpp/types/SubMessageHeader.cpp
src/cpp/message/InputMessage.cpp
src/cpp/message/OutputMessage.cpp
$<$<NOT:$<BOOL:${UAGENT_CLI_PROFILE}>>:src/cpp/utils/ArgumentParser.cpp>
src/cpp/utils/ArgumentParser.cpp
src/cpp/transport/Server.cpp
src/cpp/transport/serial/SerialProtocol.cpp
src/cpp/transport/stream_framing/StreamFramingProtocol.cpp
src/cpp/transport/custom/CustomAgent.cpp
${TRANSPORT_SRCS}
$<$<BOOL:${UAGENT_DISCOVERY_PROFILE}>:src/cpp/transport/discovery/DiscoveryServer.cpp>
$<$<BOOL:${UAGENT_FAST_PROFILE}>:src/cpp/types/TopicPubSubType.cpp>
Expand Down Expand Up @@ -284,7 +288,6 @@ target_link_libraries(${PROJECT_NAME}
$<$<PLATFORM_ID:Windows>:ws2_32>
$<$<PLATFORM_ID:Windows>:iphlpapi>
$<$<BOOL:${UAGENT_LOGGER_PROFILE}>:spdlog::spdlog>
$<$<BOOL:${UAGENT_CLI_PROFILE}>:CLI11::CLI11>
PRIVATE
$<$<BOOL:${UAGENT_FAST_PROFILE}>:fastrtps>
$<$<BOOL:${UAGENT_P2P_PROFILE}>:microxrcedds_client>
Expand Down Expand Up @@ -324,6 +327,11 @@ if(UAGENT_BUILD_EXECUTABLE)
)
endif()

# Examples
if(UAGENT_BUILD_USAGE_EXAMPLES)
add_subdirectory(examples/custom_agent)
endif()

# XML default profile used to launch exec in the building folder
file(COPY ${PROJECT_SOURCE_DIR}/agent.refs
DESTINATION ${PROJECT_BINARY_DIR}
Expand Down
3 changes: 1 addition & 2 deletions CTestConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# MemoryCheck configuration.
find_program(MEMORYCHECK_COMMAND NAMES valgrind)
set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --quiet --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=50 --xml=yes --xml-file=test_%p_memcheck.xml \"--suppressions=${CMAKE_CURRENT_SOURCE_DIR}/ci/valgrind.supp\"")

set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --log-fd=2 --quiet --tool=memcheck --leak-check=yes --show-reachable=yes --error-exitcode=1 --num-callers=50 \"--suppressions=${CMAKE_CURRENT_SOURCE_DIR}/ci/valgrind.supp\"")
# Coverage configuration.
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
find_program(COVERAGE_COMMAND NAMES gcov)
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ ADD . /agent/
# Build Micro XRCE-DDS Agent and install
RUN cd /agent/build && \
cmake -DCMAKE_INSTALL_PREFIX=../install \
-DUAGENT_ISOLATED_INSTALL=OFF \
.. &&\
make && make install
make -j $(nproc) && make install

# Prepare Micro XRCE-DDS Agent artifacts
RUN cd /agent && \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ This is made possible by the creation of *DDS Entities* on the *Agent* as a resu

The communication between a *Micro XRCE-DDS Client* and a *Micro XRCE-DDS Agent* is achieved by means of several kinds of built-in transports: **UDPv4**, **UDPv6**, **TCPv4**, **TCPv6** and **Serial** communication. In addition, there is the possibility for the user to generate its own **Custom** transport.
You can use an *Agent* with these transports by means of the standalone executable generated when building the project, which comes with a built-in CLI tool to select one of the transports listed above.

This built-in *Agent* can also be installed and launched using the provided [Snap package](https://snapcraft.io/micro-xrce-dds-agent) or the provided [Docker image](https://hub.docker.com/r/eprosima/micro-xrce-dds-agent/).

![Architecture](docs/agent_architecture.png)

## Documentation

You can access *Micro XRCE-DDS* documentation online, which is hosted on Read the Docs.
You can access the *eProsima Micro XRCE-DDS* user documentation online, which is hosted on Read the Docs.

* [Start Page](http://micro-xrce-dds.readthedocs.io)
* [Installation manual](http://micro-xrce-dds.readthedocs.io/en/latest/installation.html)
Expand Down
8 changes: 4 additions & 4 deletions ci/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ include(ExternalProject)
include(CheckCXXCompilerFlag)
include(CheckCCompilerFlag)

set(_c_flags "-fwrapv -fprofile-arcs -ftest-coverage")
set(_cxx_flags "-fwrapv -fprofile-arcs -ftest-coverage")
set(_exe_linker_flags "-fprofile-arcs -ftest-coverage")
set(_shared_linker_flags "-fprofile-arcs -ftest-coverage")
set(_c_flags "-fwrapv -fprofile-arcs -ftest-coverage --coverage -fno-inline -fno-inline-small-functions -fno-default-inline")
set(_cxx_flags "-fwrapv -fprofile-arcs -ftest-coverage --coverage -fno-inline -fno-inline-small-functions -fno-default-inline")
set(_exe_linker_flags "-fprofile-arcs -ftest-coverage --coverage -fno-inline -fno-inline-small-functions -fno-default-inline")
set(_shared_linker_flags "-fprofile-arcs -ftest-coverage --coverage -fno-inline -fno-inline-small-functions -fno-default-inline")

check_cxx_compiler_flag("-fprofile-abs-path" _have_cxx_fprofile_abs_path)
if(_have_cxx_fprofile_abs_path)
Expand Down
38 changes: 6 additions & 32 deletions cmake/SuperBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if(UAGENT_P2P_PROFILE)
PREFIX
${PROJECT_BINARY_DIR}/microxrcedds_client
INSTALL_DIR
${PROJECT_BINARY_DIR}/temp_install
${PROJECT_BINARY_DIR}/temp_install/microxrcedds_client-${_microxrcedds_client_version}
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
Expand Down Expand Up @@ -77,7 +77,7 @@ if(NOT fastcdr_FOUND)
list(APPEND _deps fastcdr)
endif()

if(UAGENT_FAST_PROFILE)
if(UAGENT_FAST_PROFILE AND NOT UAGENT_USE_SYSTEM_FASTDDS)
# Foonathan memory.
unset(foonathan_memory_DIR CACHE)
find_package(foonathan_memory QUIET)
Expand All @@ -104,7 +104,7 @@ if(UAGENT_FAST_PROFILE)
# Fast DDS.
unset(fastdds_DIR CACHE)
find_package(fastrtps ${_fastdds_version} EXACT QUIET)
if(NOT fastdds_FOUND)
if(NOT fastrtps_FOUND)
ExternalProject_Add(fastdds
GIT_REPOSITORY
https://github.com/eProsima/Fast-DDS.git
Expand All @@ -126,6 +126,7 @@ if(UAGENT_FAST_PROFILE)
-DTHIRDPARTY:BOOL=ON
-DCOMPILE_TOOLS:BOOL=OFF
-DSECURITY:BOOL=${UAGENT_SECURITY_PROFILE}
-DSHM_TRANSPORT_DEFAULT:BOOL=OFF
DEPENDS
fastcdr
foonathan_memory
Expand All @@ -139,35 +140,6 @@ if(UAGENT_FAST_PROFILE)
endif()
endif()

# CLI11.
if(UAGENT_CLI_PROFILE)
unset(CLI11_DIR CACHE)
find_package(CLI11 ${_cli11_version} EXACT QUIET)
if(NOT CLI11_FOUND)
ExternalProject_Add(cli11
GIT_REPOSITORY
https://github.com/CLIUtils/CLI11.git
GIT_TAG
${_cli11_tag}
PREFIX
${PROJECT_BINARY_DIR}/CLI11
INSTALL_DIR
${PROJECT_BINARY_DIR}/temp_install/cli11-${_cli11_version}
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH};${CMAKE_INSTALL_PREFIX}
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCLI11_TESTING:BOOL=OFF
-DCLI11_EXAMPLES:BOOL=OFF
)
list(APPEND _deps cli11)
endif()
endif()

if(UAGENT_LOGGER_PROFILE)
# spdlog.
unset(spdlog_DIR CACHE)
Expand Down Expand Up @@ -248,6 +220,8 @@ if(NOT Sanitizers_FOUND)
""
INSTALL_COMMAND
""
CMAKE_ARGS
$<$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.16.3>:-DCMAKE_POLICY_DEFAULT_CMP0077=OLD> # Disable CMP0077 unset warning
CMAKE_CACHE_ARGS
-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE}
)
Expand Down
2 changes: 1 addition & 1 deletion colcon.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
],
"cmake-args":[
"-DUAGENT_ISOLATED_INSTALL=OFF",
"-DUAGENT_CLI_PROFILE=OFF"
"-DUAGENT_USE_SYSTEM_FASTDDS=ON"
]
}
Binary file added docs/Agent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/General.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/agent_architecture.png
Binary file not shown.
30 changes: 30 additions & 0 deletions examples/custom_agent/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2021-present Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if (UAGENT_BUILD_USAGE_EXAMPLES)
add_executable(CustomXRCEAgent custom_agent.cpp)
target_link_libraries(CustomXRCEAgent
PRIVATE
${PROJECT_NAME}
$<$<BOOL:$<PLATFORM_ID:Linux>>:rt>
$<$<BOOL:$<PLATFORM_ID:Linux>>:dl>
)

set_target_properties(CustomXRCEAgent
PROPERTIES
CXX_STANDARD
11
CXX_STANDARD_REQUIRED
YES
)
endif()
Loading

0 comments on commit 0aea832

Please sign in to comment.