Skip to content
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

Implemented ROS2 subscriber and use TypeAdapter #111

Merged
merged 4 commits into from
Aug 5, 2024
Merged

Conversation

shuhaowu
Copy link
Contributor

@shuhaowu shuhaowu commented Aug 4, 2024

Will need to implement an "all value" subscriber with a queue as well, but that will happen in a separate PR.

Closes: #100
Closes: #109

This is pretty inefficiently implemented for now. This only implements
the latest value subscriber.

Need to significantly overhaul the code to not use a functional
converter, but a type which would enable better compile time detection
of wrong usage. Possibly reuse rclcpp::TypeAdapter for this. That's in a
future commit tho. Right now this sets up some temporary
code/scaffolding.

Will need to implement an "all value" subscriber with a queue as well,
but this will happen after the TypeAdapter overhaul. Some
simplification/optimization might also occur before that.
@shuhaowu shuhaowu force-pushed the ros2-subscriber branch 2 times, most recently from eb23f65 to a4920e8 Compare August 4, 2024 04:47
@shuhaowu shuhaowu changed the title Added basic scaffolding for ROS2 subscriber Implemented ROS2 subscriber and use TypeAdapter Aug 4, 2024
@shuhaowu shuhaowu force-pushed the ros2-subscriber branch 2 times, most recently from 935db73 to 2bbb998 Compare August 4, 2024 04:52
@shuhaowu shuhaowu marked this pull request as ready for review August 4, 2024 04:52
This uses standard facility to support type conversion, which
significantly simplifies the code, is more performant, and is safer (as
compile time we can check for more errors).

Fixes #109
The publisher example is now reworked to show two ways of doing things:

1. simple_data.cc: RealtimeT == RosT
2. complex_data.cc RealtimeT != RosT and a TypeAdapter is used
@shuhaowu shuhaowu force-pushed the ros2-subscriber branch 5 times, most recently from 4e15a49 to 3753f67 Compare August 5, 2024 02:06
@shuhaowu shuhaowu merged commit 23c59c8 into master Aug 5, 2024
3 checks passed
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.

Look into leveraging rclcpp::TypeAdapters ROS2 subscriber
1 participant