Skip to content

Commit

Permalink
Merge branch 'master' into Deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
rotu committed Apr 30, 2020
2 parents a489c34 + f820994 commit 84045f8
Show file tree
Hide file tree
Showing 24 changed files with 1,875 additions and 1,806 deletions.
11 changes: 11 additions & 0 deletions .github/resources/suppress_other_rmw.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
definitions:
- &empty_repo
type: zip
url: data:application/zip;base64,UEsFBgAAAAAAAAAAAAAAAAAAAAAAAA==

repositories:
ros2/rosidl_typesupport_connext/COLCON_IGNORE: *empty_repo
ros2/rmw_connext/COLCON_IGNORE: *empty_repo

ros2/rosidl_typesupport_fastrtps/COLCON_IGNORE: *empty_repo
ros2/rmw_fastrtps/COLCON_IGNORE: *empty_repo
17 changes: 6 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,19 @@ jobs:
strategy:
fail-fast: false
matrix:
rosdistro: [dashing, eloquent, master]
rosdistro: [master]
os: [ubuntu-18.04, macOS-latest, windows-latest]
exclude:
# pending https://github.com/ament/ament_cmake/pull/233
- rosdistro: eloquent
os: windows-latest
# pending https://github.com/ament/ament_cmake/pull/234
- rosdistro: dashing
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- if: runner.os == 'Linux'
# azure ubuntu repo can be flaky so add an alternate source
run: sed -e 's/azure.archive.ubuntu.com/us.archive.ubuntu.com/g' -e t -e d /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/nonazure.list
- name: Acquire ROS dependencies
uses: ros-tooling/[email protected].17
uses: ros-tooling/[email protected].20
- name: Build and test ROS
uses: ros-tooling/[email protected].15
uses: ros-tooling/[email protected].16
with:
package-name: rmw_cyclonedds_cpp
vcs-repo-file-url: https://raw.githubusercontent.com/ros2/ros2/${{ matrix.rosdistro }}/ros2.repos
vcs-repo-file-url: >
https://raw.githubusercontent.com/ros2/ros2/${{ matrix.rosdistro }}/ros2.repos
https://raw.githubusercontent.com/${{github.repository}}/${{github.sha}}/.github/resources/suppress_other_rmw.repos
57 changes: 46 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,61 @@ Cyclone DDS is ready to use. It seeks to give the fastest, easiest, and most rob

1. Install:

```
apt install ros-eloquent-rmw-cyclonedds-cpp
```
or
```
apt install ros-dashing-rmw-cyclonedds-cpp
```
```
apt install ros-eloquent-rmw-cyclonedds-cpp
```
or
```
apt install ros-dashing-rmw-cyclonedds-cpp
```

2) Set env variable and run ROS2 apps as usual:
2. Set env variable and run ROS2 apps as usual:

```export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp```
```export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp```

3) Confirm RMW: In Eloquent, to confirm which RMW you're using:
3. Confirm RMW: In Eloquent and later, to confirm which RMW you're using:

```ros2 doctor --report```


## Performance recommendations

With large samples (100s of kilobytes), excessive latency can be caused by running out of space in the OS-level receive buffer. For this reason, on Linux, we recommend increasing the buffer size:
* Temporarily (until reboot): `sudo sysctl -w net.core.rmem_max=8388608 net.core.rmem_default=8388608`
* Permanently: `echo "net.core.rmem_max=8388608\nnet.core.rmem_default=8388608\n" | sudo tee /etc/sysctl.d/60-cyclonedds.conf`

## Debugging

So Cyclone isn't playing nice or not giving you the performance you had hoped for? That's not good... Please [file an issue against this repository](https://github.com/ros2/rmw_cyclonedds/issues/new)!

The `ddsperf` tool distributed with Cyclone DDS can be used to check that communication works *without* ROS. Run `ddsperf sanity` on two different machines - if the "mean" value is above `100000us`, there are likely network issues.

If you're having trouble with nodes discovering others or can't use multicast *at all* on your network setup, you can circumvent discovery:

`export CYCLONEDDS_URI='<Discovery><Peers><Peer Address='myroshost.local' /><Peer Address='myroshost2.local' /></></>'`

Here are some ways to generate additional debugging info that can help identify the problem faster, and are helpful on an issue ticket:

* Configure Cyclone to create richer debugging output:

* To see the output live:

`export CYCLONEDDS_URI='<Tracing><Verbosity>trace</><Out>stderr</></>'`

* To send to `/var/log/`:

`export CYCLONEDDS_URI='<Tracing><Verbosity>trace</><Out>/var/log/cyclonedds.${CYCLONEDDS_PID}.log</></>'`

* Create a Wireshark capture:

`wireshark -k -w wireshark.pcap.gz`

## Building from source and contributing

Note the `master` branch maintains compatibility with ROS releases Dashing and later, including the not-yet-released [*Foxy*](https://index.ros.org/doc/ros2/Releases/Release-Foxy-Fitzroy/).
The following branches are actively maintained:

* `master`, which targets the upcoming ROS version, [*Foxy*](https://index.ros.org/doc/ros2/Releases/Release-Foxy-Fitzroy/).
* `dashing-eloquent`, which maintains compatibility with ROS releases [*Dashing*](https://index.ros.org/doc/ros2/Releases/Release-Dashing-Diademata/) and [*Eloquent*](https://index.ros.org/doc/ros2/Releases/Release-Eloquent-Elusor/)

If building ROS2 from source ([ros2.repos](https://github.com/ros2/ros2/blob/master/ros2.repos)), you already have this package and Cyclone DDS:

Expand Down
27 changes: 0 additions & 27 deletions cyclonedds_cmake_module/CHANGELOG.rst

This file was deleted.

31 changes: 0 additions & 31 deletions cyclonedds_cmake_module/CMakeLists.txt

This file was deleted.

70 changes: 0 additions & 70 deletions cyclonedds_cmake_module/cmake/Modules/FindCycloneDDS.cmake

This file was deleted.

15 changes: 0 additions & 15 deletions cyclonedds_cmake_module/cyclonedds_cmake_module-extras.cmake

This file was deleted.

18 changes: 0 additions & 18 deletions cyclonedds_cmake_module/package.xml

This file was deleted.

26 changes: 19 additions & 7 deletions rmw_cyclonedds_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ if(NOT CMAKE_CXX_STANDARD)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
add_compile_options(-Wall -Wextra -Wpedantic -Wimplicit-fallthrough)
endif()

find_package(ament_cmake_ros REQUIRED)

find_package(rcutils REQUIRED)
find_package(rcpputils REQUIRED)

find_package(cyclonedds_cmake_module REQUIRED)
#find_package(cyclonedds_cmake_module REQUIRED)
find_package(CycloneDDS QUIET CONFIG)
if(NOT CycloneDDS_FOUND)
message(WARNING "Could not find Eclipse Cyclone DDS - skipping '${PROJECT_NAME}'")
Expand All @@ -38,23 +39,26 @@ if(NOT CycloneDDS_FOUND)
endif()

find_package(rmw REQUIRED)
find_package(rosidl_generator_c REQUIRED)
find_package(rmw_dds_common REQUIRED)
find_package(rosidl_runtime_c REQUIRED)
find_package(rosidl_typesupport_introspection_c REQUIRED)
find_package(rosidl_typesupport_introspection_cpp REQUIRED)

ament_export_dependencies(rcutils)
ament_export_dependencies(rcpputils)
ament_export_dependencies(rmw)
ament_export_dependencies(rosidl_generator_c)
ament_export_dependencies(rosidl_runtime_c)
ament_export_dependencies(rmw_dds_common)
ament_export_dependencies(rosidl_typesupport_introspection_c)
ament_export_dependencies(rosidl_typesupport_introspection_cpp)

add_library(rmw_cyclonedds_cpp
src/rmw_node.cpp
src/serdata.cpp
src/serdes.cpp
src/graphrhc.cpp
src/u16string.cpp
src/exception.cpp
src/demangle.cpp
src/deserialization_exception.cpp
src/Serialization.cpp
src/TypeSupport2.cpp src/Deserialization.cpp src/Deserialization.hpp src/CDRCursor.hpp src/CDR.hpp)
Expand All @@ -64,14 +68,18 @@ target_include_directories(rmw_cyclonedds_cpp PUBLIC
$<INSTALL_INTERFACE:include>
)

target_link_libraries(rmw_cyclonedds_cpp CycloneDDS::ddsc)
target_link_libraries(rmw_cyclonedds_cpp
CycloneDDS::ddsc
)

ament_target_dependencies(rmw_cyclonedds_cpp
"rcutils"
"rcpputils"
"rosidl_typesupport_introspection_c"
"rosidl_typesupport_introspection_cpp"
"rmw"
"rosidl_generator_c"
"rmw_dds_common"
"rosidl_runtime_c"
)

configure_rmw_library(rmw_cyclonedds_cpp)
Expand Down Expand Up @@ -113,3 +121,7 @@ install(
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

include(cmake/get_rmw_cyclonedds_output_filter.cmake)
get_rmw_cyclonedds_output_filter(rmw_cyclonedds_output_patterns)
ament_index_register_resource("rmw_output_patterns" CONTENT "${rmw_cyclonedds_output_patterns}")
31 changes: 31 additions & 0 deletions rmw_cyclonedds_cpp/cmake/get_rmw_cyclonedds_output_filter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2020 Open Source Robotics Foundation, Inc.
#
# 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.

#
# Get patterns for output filtering for CycloneDDS RMW.
#
# :param output_patterns: patterns that will be used to identify console
# output generated by CycloneDDS.
# :type output_filter: string
#
# @public
#
macro(get_rmw_cyclonedds_output_filter output_patterns)
if(NOT "${ARGN}" STREQUAL "")
message(FATAL_ERROR "get_rmw_cyclonedds_output_filter() called with "
"unused arguments: ${ARGN}")
endif()

set(${output_patterns} ".*using network interface \\w+ \\(.*\\) selected arbitrarily from:.*")
endmacro()
Loading

0 comments on commit 84045f8

Please sign in to comment.