-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable minimal changes with improved template logic #18
Comments
I think the way to do this is using: RCLCPP_USING_CUSTOM_TYPE_AS_ROS_MESSAGE_TYPE. |
I hacked a little bit our demo to use RCLCPP_USING_CUSTOM_TYPE_AS_ROS_MESSAGE_TYPE(std_msgs::msg::pb::String, std_msgs::msg::String);, by doing that I was able to construct the publisher with the custom type: publisher_ = this->create_publisher<std_msgs::msg::pb::String>("topic", 10); I couldn't find a way to construct the publisher with the ROS_Type and make it automatically use the adapter. |
Yeah, I think you're right reading: https://github.com/ros2/rclcpp/blob/6f6b5f2e3608eafeadb908aa4f6eded5b38c3043/rclcpp/include/rclcpp/type_adapter.hpp#L86C50-L95 And https://ros.org/reps/rep-2007.html#defining-a-type-adapter We can change it to allow declaring publish and subscribe on the adapted type if we inject the |
Merged via eclipse-ecal#33 |
The design of the TypeAdaptor shouldn't need this line changed.
You should be able to use the
And the compiler template logic should be able to let you publish with either data type if you've included the right headers. So I think that we're slightly off on how we have the headers/templates setup to enable this.
The text was updated successfully, but these errors were encountered: