rclcpp icon indicating copy to clipboard operation
rclcpp copied to clipboard

Dnae adas/generic subscriber and publisher

Open DensoADAS opened this issue 4 years ago • 12 comments

using SerializedMessage and support in intraprocess manager to create a generic subscriber / publisher without previously known message type

DensoADAS avatar Apr 21 '20 13:04 DensoADAS

@Karsten1987 I did not create a spezialzation of Publisher for SerializedMessages as I disklike copying so much redudant code. I redesigned it so the changes to the Publisher are reduced. I hope it does not break to much with the current api. (But I have also a version with a spezialized publisher in backup)

DensoADAS avatar Apr 21 '20 13:04 DensoADAS

depends on #1076

DensoADAS avatar Apr 21 '20 13:04 DensoADAS

A few questions before reviewing, I'm probably missing some context from https://github.com/ros2/rclcpp/pull/973 discussion:

  • what's the goal of the "generic" publisher/subscription?
  • how they differ from Publisher/Subscription?

Thanks!

ivanpauno avatar Apr 21 '20 19:04 ivanpauno

A few questions before reviewing, I'm probably missing some context from #973 discussion:

* what's the goal of the "generic" publisher/subscription?

* how they differ from `Publisher`/`Subscription`?

Thanks!

The "generic" publisher/subscriber allows communication without knowing the message type to compile time. Therefore a serialized message can bei published or received and the endpoint has to handle the content itself. This is used for example in rosbag2.

This implementation supports now intraprocess communication when using the C++ version of serialized messages which make the memory handling more safe.

DensoADAS avatar Apr 22 '20 04:04 DensoADAS

The "generic" publisher/subscriber allows communication without knowing the message type to compile time. Therefore a serialized message can bei published or received and the endpoint has to handle the content itself. This is used for example in rosbag2.

Ah ok. So in those cases, you use MessageT=SerializedMessageBase, and you don't need to know the message type at compile time, right?

ivanpauno avatar Apr 22 '20 14:04 ivanpauno

CI (build everything, test rclcpp):

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Karsten1987 avatar Apr 22 '20 16:04 Karsten1987

Switching back to create_generic_... would solve this. Do you have another suggestion?

DensoADAS avatar Apr 22 '20 18:04 DensoADAS

@Karsten1987 I lost a little bit the track of the conversation. What's the current status?

DensoADAS avatar Apr 24 '20 14:04 DensoADAS

In my opinion, https://github.com/ros2/rclcpp/pull/1076#discussion_r413487908 this is where we stand. I think the intraprocess manager should be sorted out before pushing forward with this change.

Karsten1987 avatar Apr 24 '20 15:04 Karsten1987

Thanks @DensoADAS for iterating over this PR.

Unfortunately, we've passed API freeze for Foxy and after talking with @jacobperron (the Foxy lead), we've decided to table this for G-Turtle.

Karsten1987 avatar Apr 29 '20 18:04 Karsten1987

Is a generic subscriber available in Foxy? I don't think I can use ROS2 until it is in. :/

nyxaria avatar Aug 17 '20 08:08 nyxaria

Is a generic subscriber available in Foxy?

Not in rclcpp. Unless something like this PR can be done in an ABI compatible way, I don't think we can expect it to land in Foxy.

As mentioned on ROS Answers, you can do this in Python and/or copy the C++ implementation from rosbag2 for your application.

jacobperron avatar Aug 17 '20 17:08 jacobperron