Skip to content

Conversation

@gonzodepedro
Copy link
Contributor

This PR adds the functionality to allow the creation of publishers and subscribers using the Protobufe type, instead of a TypeAdapter type, which makes the code more readable.

The user would be able to use this:

publisher_ = this->create_publisher<std_msgs::msg::pb::String>();
subscription = this->create_subscription<std_msgs::msg::pb::String>()

Instead of the old way:

publisher_ = this->create_publisher<std_msgs::msg::typesupport_protobuf_cpp::StringTypeAdapter>()
subscription = this->create_subscription<std_msgs::msg::typesupport_protobuf_cpp::StringTypeAdapter>(

In order to allow for this, a call to the RCLCPP_USING_CUSTOM_TYPE_AS_ROS_MESSAGE_TYPE macro is generated for each of the generated protobuf types along with the required TypeAdapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants