rmw_fastrtps: Bind a Fast RTPS publisher with a ROS 2 subscriber fails

Bug report

Required Info:

  • Operating System:
    • Ubuntu 18.04
  • Installation type:
    • binaries
  • Version or commit hash:
    • latest release for bouncy
  • DDS implementation:
    • Fast RTPS

Steps to reproduce issue

Follow the steps set in:

  1. https://dev.px4.io/en/middleware/micrortps.html#setting-up-the-workspaces
  2. https://dev.px4.io/en/middleware/micrortps.html#building-the-workspaces
  3. https://dev.px4.io/en/middleware/micrortps.html#testing-the-px4-fastrpts-bridge-with-ros2-and-ros

The above will generate sources and headers for a micro RTPS agent which will publish and subscribe to/from data coming from the ROS2 Fast RTPS layer.

Expected behavior

With Ardent, the agent is able to bind with ROS2 publishers/subscribers - a Publisher matched or a Subscriber matched message appears on the console output of the agent.

UPDATE: It’s expected to work on ROS2 Crystal as well.

Actual behavior

Currently it only appears to work using Ardent. UPDATE: Works on Bouncy as well. Doesn’t work on Crystal.

Additional information

It’s not obvious to me if this is related to the current implementation of the rmw_fastrtps to Bouncy, but it was proven that this problem only occurs while using Bouncy. The bind happens when using Ardent.

UPDATE: Works now in Bouncy. Doesn’t work on Crystal.

The current template used for the micro-RTPS agent Publisher is https://github.com/PX4/px4_ros_com/blob/master/msg/templates/Publisher.cpp.template#L76-L104. Again, this template works well with Ardent and allows binding the agent and the ROS2 nodes. I tried to research the current implementation of Fast RTPS publishers and subscribers inside rmw_fastrtps but could not find any relevant differences that would limit the functionality.

Any tips to solve this are welcomed!

Thanks in advance!

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 38 (16 by maintainers)

Most upvoted comments

You should be able to see the exact names with this script:

#!/usr/bin/env python3

import pprint

import rclpy

rclpy.init()
n = rclpy.create_node('list_no_demangle')
pprint.pprint(n.get_topic_names_and_types(True))

For example with talker I get this:

[('rq/_ros2cli_node_daemon_87/describe_parametersRequest',
  ['rcl_interfaces::srv::dds_::DescribeParameters_Request_']),
 ('rq/_ros2cli_node_daemon_87/get_parameter_typesRequest',
  ['rcl_interfaces::srv::dds_::GetParameterTypes_Request_']),
 ('rq/_ros2cli_node_daemon_87/get_parametersRequest',
  ['rcl_interfaces::srv::dds_::GetParameters_Request_']),
 ('rq/_ros2cli_node_daemon_87/list_parametersRequest',
  ['rcl_interfaces::srv::dds_::ListParameters_Request_']),
 ('rq/_ros2cli_node_daemon_87/set_parametersRequest',
  ['rcl_interfaces::srv::dds_::SetParameters_Request_']),
 ('rq/_ros2cli_node_daemon_87/set_parameters_atomicallyRequest',
  ['rcl_interfaces::srv::dds_::SetParametersAtomically_Request_']),
 ('rq/list_no_demangle/describe_parametersRequest',
  ['rcl_interfaces::srv::dds_::DescribeParameters_Request_']),
 ('rq/list_no_demangle/get_parameter_typesRequest',
  ['rcl_interfaces::srv::dds_::GetParameterTypes_Request_']),
 ('rq/list_no_demangle/get_parametersRequest',
  ['rcl_interfaces::srv::dds_::GetParameters_Request_']),
 ('rq/list_no_demangle/list_parametersRequest',
  ['rcl_interfaces::srv::dds_::ListParameters_Request_']),
 ('rq/list_no_demangle/set_parametersRequest',
  ['rcl_interfaces::srv::dds_::SetParameters_Request_']),
 ('rq/list_no_demangle/set_parameters_atomicallyRequest',
  ['rcl_interfaces::srv::dds_::SetParametersAtomically_Request_']),
 ('rq/talker/describe_parametersRequest',
  ['rcl_interfaces::srv::dds_::DescribeParameters_Request_']),
 ('rq/talker/get_parameter_typesRequest',
  ['rcl_interfaces::srv::dds_::GetParameterTypes_Request_']),
 ('rq/talker/get_parametersRequest',
  ['rcl_interfaces::srv::dds_::GetParameters_Request_']),
 ('rq/talker/list_parametersRequest',
  ['rcl_interfaces::srv::dds_::ListParameters_Request_']),
 ('rq/talker/set_parametersRequest',
  ['rcl_interfaces::srv::dds_::SetParameters_Request_']),
 ('rq/talker/set_parameters_atomicallyRequest',
  ['rcl_interfaces::srv::dds_::SetParametersAtomically_Request_']),
 ('rr/_ros2cli_node_daemon_87/describe_parametersReply',
  ['rcl_interfaces::srv::dds_::DescribeParameters_Response_']),
 ('rr/_ros2cli_node_daemon_87/get_parameter_typesReply',
  ['rcl_interfaces::srv::dds_::GetParameterTypes_Response_']),
 ('rr/_ros2cli_node_daemon_87/get_parametersReply',
  ['rcl_interfaces::srv::dds_::GetParameters_Response_']),
 ('rr/_ros2cli_node_daemon_87/list_parametersReply',
  ['rcl_interfaces::srv::dds_::ListParameters_Response_']),
 ('rr/_ros2cli_node_daemon_87/set_parametersReply',
  ['rcl_interfaces::srv::dds_::SetParameters_Response_']),
 ('rr/_ros2cli_node_daemon_87/set_parameters_atomicallyReply',
  ['rcl_interfaces::srv::dds_::SetParametersAtomically_Response_']),
 ('rr/list_no_demangle/describe_parametersReply',
  ['rcl_interfaces::srv::dds_::DescribeParameters_Response_']),
 ('rr/list_no_demangle/get_parameter_typesReply',
  ['rcl_interfaces::srv::dds_::GetParameterTypes_Response_']),
 ('rr/list_no_demangle/get_parametersReply',
  ['rcl_interfaces::srv::dds_::GetParameters_Response_']),
 ('rr/list_no_demangle/list_parametersReply',
  ['rcl_interfaces::srv::dds_::ListParameters_Response_']),
 ('rr/list_no_demangle/set_parametersReply',
  ['rcl_interfaces::srv::dds_::SetParameters_Response_']),
 ('rr/list_no_demangle/set_parameters_atomicallyReply',
  ['rcl_interfaces::srv::dds_::SetParametersAtomically_Response_']),
 ('rr/talker/describe_parametersReply',
  ['rcl_interfaces::srv::dds_::DescribeParameters_Response_']),
 ('rr/talker/get_parameter_typesReply',
  ['rcl_interfaces::srv::dds_::GetParameterTypes_Response_']),
 ('rr/talker/get_parametersReply',
  ['rcl_interfaces::srv::dds_::GetParameters_Response_']),
 ('rr/talker/list_parametersReply',
  ['rcl_interfaces::srv::dds_::ListParameters_Response_']),
 ('rr/talker/set_parametersReply',
  ['rcl_interfaces::srv::dds_::SetParameters_Response_']),
 ('rr/talker/set_parameters_atomicallyReply',
  ['rcl_interfaces::srv::dds_::SetParametersAtomically_Response_']),
 ('rt/chatter', ['std_msgs::msg::dds_::String_']),
 ('rt/parameter_events', ['rcl_interfaces::msg::dds_::ParameterEvent_'])]

Note this:

 ('rt/chatter', ['std_msgs::msg::dds_::String_']),

Your topic name needs to be something like this /rt/SensorCombined_topic to match the mangling happening in ROS 2. Since I am not sure about the exact value out of my head I suggest to print the value used in ROS 2 FastRTPS.