Skip to content

Commit

Permalink
IRONSIDE-763 -- follow the 7.3.0 merge to develop with a develop merg…
Browse files Browse the repository at this point in the history
…e to master. (#682)

* Add dynamic_data_skip_serialization example (#642)

Add dynamic_data_skip_serialization example for C++11 and Python. This is an upcoming feature in Connext DDS 7.3.0.

* Fix Web Integration Service library api example by using the webserver_option() function instead of the old document_root() function

* Fix formatting

* COMMUNITY-81 | Move GH Actions CI to Jenkins (#650)

* COMMUNITY-81: move GH Actions CI to Jenkins

* COMMUNITY-81: refactor Jenkinsfile

* COMMUNITY-81: update dockerfile name

* COMMUNITY-81: install python dependencies

* COMMUNITY-81: use pip3 instead of pip

* COMMUNITY-81: use pip3 instead of pip

* COMMUNITY-81: change connextdds installation path

* COMMUNITY-81: change timeout

* #651 #655: Fix overflow and eof issue

* filter-out removed files from linux_format.py fix #633 (#663)

* execute linters on release branches as well fixes #665 (#666)

* CORE-13335: Fix examples that assume invalid data cannot be ALIVE

(cherry picked from commit b89cfb8)

* CORE-13335: Fix linting errors

(cherry picked from commit 320539c)

* CORE-13335: Apply lint patch file

(cherry picked from commit 2a6219a)

* CORE-13335: PR feedback

(cherry picked from commit e2a1cbf)

* CORE-13335: Apply lint patch

(cherry picked from commit ada2dca)

* Improve documentation in Recording examples so the CMake command always works (#667)

* Improve documentation in Recording examples so the CMake command always works

* Remove trailing spaces

---------

Co-authored-by: Francisco Gallego Salido <fgallego@rti.com>

* Remove status badge from README fixes #659 (#660)

* Fix Routing Service file adapter examples

* ROUTING-1182: adding cross-compilation instructions where missing for Infrastructure Services

* Update VERSION for release/7.3.0 fix #677 (#678)

* Use new property names and values in the lightweight and cds examples (#672) (#679)

* Use new property names in the lightweight and cds examples

* schema url updates

* Fix linting

* #fix IRONSIDE-763 -- change version to 7.3.0 in csproj files, and update README ... (#680) (#681)

---------

Co-authored-by: Alex Campos <alejandro@rti.com>
Co-authored-by: Francisco Gallego Salido <fgallego@rti.com>
Co-authored-by: Fernando García Aranda <fgarcia@rti.com>
Co-authored-by: Manuel Jesús Núñez Ruiz <manueljesusnunezruiz@gmail.com>
Co-authored-by: Antonio Lopez <alopez@rti.com>
Co-authored-by: lulivi <luislivilla@gmail.com>
Co-authored-by: Sam Raeburn <sam@rti.com>
Co-authored-by: Francisco Gallego Salido <fgallegosalido@gmail.com>
Co-authored-by: Sam <raeburnsamuel@gmail.com>
Co-authored-by: Juan Luis Jimenez Simon <juan@rti.com>
Co-authored-by: Luis Colmenero <colmenero@rti.com>
  • Loading branch information
12 people authored Apr 11, 2024
1 parent 900c593 commit 5934acd
Show file tree
Hide file tree
Showing 46 changed files with 1,287 additions and 60 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/lint_markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ on:
branches:
- master
- develop
- release/*
paths:
- '**/*.md'

pull_request:
branches:
- master
- develop
- release/*
paths:
- '**/*.md'

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ on:
branches:
- master
- develop
- release/*
paths:
- '**/*.py'

pull_request:
branches:
- master
- develop
- release/*
paths:
- '**/*.py'

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint_source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
branches:
- master
- develop
- release/*
paths:
- '**/*.[ch]x?x?'
- '**/*.java'
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# rticonnextdds-examples

[![Build and run static analysis](https://github.com/rticommunity/rticonnextdds-examples/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/rticommunity/rticonnextdds-examples/actions/workflows/build.yml)

This repository includes examples on how to use specific features of RTI
Connext DDS.

Expand All @@ -16,9 +14,10 @@ for further information about how to contribute with new examples to this reposi
The examples contained in the
[master](https://github.com/rticommunity/rticonnextdds-examples/tree/master)
branch of this repository have been built and tested against RTI Connext DDS
7.2.0. If you need examples that have been built and tested against older
7.3.0. If you need examples that have been built and tested against older
versions of RTI Connext DDS, please check out the appropriate branch:

- [release/7.2.0](https://github.com/rticommunity/rticonnextdds-examples/tree/release/7.2.0)
- [release/7.1.0](https://github.com/rticommunity/rticonnextdds-examples/tree/release/7.1.0)
- [release/7.0.0](https://github.com/rticommunity/rticonnextdds-examples/tree/release/7.0.0)
- [release/6.1.1](https://github.com/rticommunity/rticonnextdds-examples/tree/release/6.1.1)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.2.0
7.3.0
24 changes: 24 additions & 0 deletions examples/cloud_discovery_service/library_api/c++11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,30 @@ you want to link against. For example:
cmake -DCONNEXTDDS_ARCH=x64Linux3gcc5.4.0 ..
```

### Cross-compilation

When you need to cross-compile the example, the above
command will not work, the assigned compiler won't be the cross-compiler and
errors may happen when linking against the cross-compiled Connext binaries.
To fix this, you have to create a file with the architecture name and call
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
An example of the file to create with the toolchain settings (e.g. for an
ARM architectures):

```cmake
set(CMAKE_SYSTEM_NAME Linux)
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
```

Then you can call CMake like this:

```bash
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
-DCONNEXTDDS_ARCH=<connext architecture> ..
```

### CMake Build Infrastructure

The `CMakeListst.txt` script that builds this example uses a generic CMake
Expand Down
26 changes: 25 additions & 1 deletion examples/cloud_discovery_service/library_api/c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,33 @@ you want to link against. For example:
cmake -DCONNEXTDDS_ARCH=x64Linux3gcc5.4.0 ..
```

### Cross-compilation

When you need to cross-compile the example, the above
command will not work, the assigned compiler won't be the cross-compiler and
errors may happen when linking against the cross-compiled Connext binaries.
To fix this, you have to create a file with the architecture name and call
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
An example of the file to create with the toolchain settings (e.g. for an
ARM architectures):

```cmake
set(CMAKE_SYSTEM_NAME Linux)
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
```

Then you can call CMake like this:

```bash
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
-DCONNEXTDDS_ARCH=<connext architecture> ..
```

### CMake Build Infrastructure

The `CMakeListst.txt` script that builds this example uses a generic CMake
The `CMakeLists.txt` script that builds this example uses a generic CMake
function called `connextdds_add_example` that defines all the necessary constructs
to:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Rti.ConnextDds.Extra" Version="7.2.0" />
<PackageReference Include="Rti.ConnextDds.Extra" Version="7.3.0" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1"/>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Rti.ConnextDds.Extra" Version="7.2.0" />
<PackageReference Include="Rti.ConnextDds.Extra" Version="7.3.0" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1"/>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Rti.ConnextDds" Version="7.2.0" />
<PackageReference Include="Rti.ConnextDds" Version="7.3.0" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1"/>
</ItemGroup>

Expand Down
30 changes: 30 additions & 0 deletions examples/connext_dds/dynamic_data_skip_serialization/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Example Code: Skip Data Serialization for Data Recording

## Concept

There are scenarios where the need to deserialize or inspect data is not necessary.
A common example is recording data. In this case, the application can simply
record the binary data as it is received, and then replay it later. This provides
a significant performance improvement.

The DynamicData API provides a mode that allows sending or receiving data in its
CDR format, without serializing or deserializing it.

Note that while Connext provides a Recording Service, there may be situations
where a custom Recording application may be useful.

## Example Description

This example implements a simple recording application that uses the DynamicData
API to receive data in CDR format and directly record it in a file. The example
also provides a replay option that reads the data buffers from the file
and publishes them back. For convenience, an option to publish a few samples
to test the record and replay functionality is also provided.

The key parts of the example are implemented in the ``record()`` and
``replay()`` functions in the example source code for each language.

The example is very simple and uses a single type and topic, but it could be
extended to use discovered types (see the
[built-in topics example](../builtin_topics/)) to implement a more
general-purpose recording application.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# (c) 2024 Copyright, Real-Time Innovations, Inc. All rights reserved.
#
# RTI grants Licensee a license to use, modify, compile, and create derivative
# works of the Software. Licensee has the right to distribute object form
# only for use with RTI products. The Software is provided "as is", with no
# warranty of any type, including any warranty for fitness for any purpose.
# RTI is under no obligation to maintain or support the Software. RTI shall
# not be liable for any incidental or consequential damages arising out of the
# use or inability to use the software.
#
cmake_minimum_required(VERSION 3.11)
project(rtiexamples-dynamic-data-skip-serialization)
list(APPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../resources/cmake/Modules"
)
include(ConnextDdsConfigureCmakeUtils)
connextdds_configure_cmake_utils()

# Find the RTI Connext DDS libraries
if(NOT RTIConnextDDS_FOUND)
find_package(RTIConnextDDS
"7.3.0"
REQUIRED
COMPONENTS
core
)
endif()

set(CMAKE_CXX_STANDARD 11)
set(PLATFORM_MODERN_CXX_STANDARD 11)

add_executable(recorder_cxx2
"${CMAKE_CURRENT_SOURCE_DIR}/util.cxx"
"${CMAKE_CURRENT_SOURCE_DIR}/recorder.cxx"
)

target_link_libraries(recorder_cxx2
PUBLIC
RTIConnextDDS::cpp2_api
)

target_include_directories(recorder_cxx2
PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}/src"
)

set_target_properties(recorder_cxx2
PROPERTIES
OUTPUT_NAME "recorder")


if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set_target_properties(recorder_cxx2
PROPERTIES
LINK_FLAGS -Wl,--no-as-needed)
endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Example Code: Skip Data Serialization for Data Recording

## Building the Example :wrench:

To build this example, first run CMake to generate the corresponding build
files. We recommend you use a separate directory to store all the generated
files (e.g., ./build).

```sh
mkdir build
cd build
cmake ..
```

Once you have run CMake, you will find a number of new files in your build
directory (the list of generated files will depend on the specific CMake
Generator). To build the example, run CMake as follows:

```sh
cmake --build .
```

**Note**: if you are using a multi-configuration generator, such as Visual
Studio solutions, you can specify the configuration mode to build as follows:

```sh
cmake --build . --config Release|Debug
```

Alternatively, you can use directly the generated infrastructure (e.g.,
Makefiles or Visual Studio Solutions) to build the example. If you generated
Makefiles in the configuration process, run make to build the example. Likewise,
if you generated a Visual Studio solution, open the solution and follow the
regular build process.

## Running the Example

From the build directory, in one command prompt run the recorder:

```sh
./recorder --record data.bin
```

In a second command prompt run the publisher:

```sh
./recorder --publish
```

The recorder application will print a message each time a sample is recorded.

Now kill the recorder and run the replay application. A file called `data.bin`
will have been created in the current directory.

Now we will run a subscriber and a reply application.

To subscribe to the data we will simply use **rtiddsspy**:

```sh
<Connext installation>/bin/rtiddsspy -printSample
```

Now run the application that replays the data recorded in `data.bin`:

```sh
./recorder --replay data.bin
```

The subscriber will print the data that is being replayed.
Loading

0 comments on commit 5934acd

Please sign in to comment.