Interop with DDS application using existing .idl files

Open
#86 4 comments 0 reactions 1 assignee View on GitHub

@asorbini is already working on this.

Since May 12, 2022.

Assessment

This issue has not been assessed yet.

Description

I'm trying to create a ROS2 node that can listen to messages being published from an existing DDS application. I think I've checked most of the regular interop checkboxes, however still no luck with the interop

  • Same domain id
  • Same QoS settings
  • Both using RTI DDS
  • Topic name starts with rt/
  • Type is under two modules which line up with my ros2 package

I created a message package where I try to pass my existing .idl files into the rosidl_generate_interfaces cmake function. However it seems like we depend on rosidl_typesupport_fastrtps_cpp to parse the idl files. This means I cannot use the exact same .idl files as I do in my existing DDS application. Even when I strip the .idl down (No constants, no usings, etc..) to something that is parseable by fastrtps, the generated type doesn't seem to lineup with the type used by my DDS application. Verified this assumption in rtiadminconsole
image

.idl's as they are defined in my ROS2 package

my_msgs/msg/header.idl

module my_msgs {
    module msg {
        struct Header {
            long id;  //@key
            unsigned long long sendCount;
        };
    };
};

my_msgs/msg/telemetry.idl

#include "header.idl"

module my_msgs {
    module msg {
        struct Telemetry {
            my_msgs::msg::Header header;  //@key
            sequence<octet, 65536> data;
        };
    };
};

CMakeLists.txt

cmake_minimum_required(VERSION 3.8)
project(my_msgs)

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

# find dependencies
find_package(ament_cmake REQUIRED)

find_package(rosidl_default_generators REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
        "msg/header.idl"
        "msg/telemetry.idl"
        )

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  # the following line skips the linter which checks for copyrights
  # uncomment the line when a copyright and license is not present in all source files
  #set(ament_cmake_copyright_FOUND TRUE)
  # the following line skips cpplint (only works in a git repo)
  # uncomment the line when this package is not in a git repo
  #set(ament_cmake_cpplint_FOUND TRUE)
  ament_lint_auto_find_test_dependencies()
endif()

ament_package()

package.xml

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>my_msgs</name>
  <version>0.0.0</version>
  <description>TODO: Package description</description>
  <maintainer email="<real email>">sam</maintainer>
  <license>TODO: License declaration</license>

  <buildtool_depend>ament_cmake</buildtool_depend>

  <build_depend>rosidl_default_generators</build_depend>
  <exec_depend>rosidl_default_runtime</exec_depend>
  <member_of_group>rosidl_interface_packages</member_of_group>

  <test_depend>ament_lint_auto</test_depend>
  <test_depend>ament_lint_common</test_depend>

  <export>
    <build_type>ament_cmake</build_type>
  </export>
</package>

Defined in my DDS application

header.idl

module my_msgs {
    module msg {
        struct Header {
            long id;  //@key
            unsigned long long sendCount;
        };
    };
};

telemetry.idl

#include "header.idl"

module my_msgs {
    module msg {
        struct Telemetry {
            Header header;  //@key
            sequence<octet, 65536> data;
        };
    };
};

It seems like I should be using rosidl_typesupport_connext as it uses rtiddsgen. But its not supported for galactic and up under the guise that this is the new rmw implementation https://github.com/ros2/rosidl_typesupport_connext/issues/70.

Am I missing something?

Dominant language
C++
Stars
68
Forks
42
Avg merge
9d 15h
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ros2/rmw_connextdds

All issues in ros2/rmw_connextdds

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.