-
Notifications
You must be signed in to change notification settings - Fork 610
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
Dynamic Subscription (REP-2011 subset) #1374
Comments
@methylDragon Hey! I was trying to run the demo locally, but I had trouble compiling:
Am I missing changes or something? |
Hey @allenh1 ! The examples won't compile if you have the other non-FastDDS middlewares in your workspace. (I see that your colcon is building rmw_cyclonedds without complaints, for example.) The ros2.repos file I have supplied with the examples should have commented out iceoryx, and cyclone (and omitted connext). Check to make sure you didn't source any other ROS 2 workspaces/bases before compiling and running the commands! (Check your bashrc too!) |
Ah, apologies @allenh1 , it turns out that I also missed out pushing a change... I need to update EDIT: I've updated it. You can delete your cloned workspace and rerun the same commands, and it should work (remember to ensure that there are no other middlewares available in your workspace other than FastDDS!) 🤞 |
@methylDragon awesome. Thanks! I'll give this a try shortly. |
Oh.. you also need to build ros2cli (and ros2run) also 🤦 , my fault for working in a dirty workspace where I had run I've refined the setup commands. |
Builds here are ordered from most recent to oldest.
Move dynamic typesupport struct to rosidl and fix some memory issues via valgrind (Some memory corruption errors I have no idea how to fix, still...)
Add support for type description changes and codegen (still trying to debug exports on Windows)
Fix warnings and windows linking errors, trying to export on public
Fix usage of `rosidl_typesupport` and `rosidl_typesupport_fastrtps`
I missed out using Emerson's branch of rosidl_typesupport and rosidl_typesupport_fastrtps Fixing windows build
Another one, windows build fixed |
We're just gonna try testing with and without a gtest linking fix on (Fix is in:) == After Fix == ODR fix, fixed ODR: |
Doing a run for rviz as well, Fix is in: == BEFORE FIX == == AFTER FIX == |
Allocator refactor is being built on top of this wave of PRs: #1405 |
I've approved all the prs, and windows debug is at least into running tests, so hopefully it comes back green-ish tomorrow. I'll merge all of these then. |
Tests lgtm, let me double check the prs since some other stuff was merged. |
They look ok, I'm going to merge 🤞, let's see what the nightlies say! |
This issue has been mentioned on ROS Discourse. There might be relevant details there: |
Description
This issue describes and lists the relevant PRs that allow subscriptions to receive messages (i.e. DynamicData) with descriptions/types constructed at runtime, and use that type to access fields of those messages without using message-specific compiled structs, as specified in ros-infrastructure/rep#358
Note: This does NOT include:
Also, this feature set only supports rmw_fastrtps currently.
Demoing This Feature
The status of this feature development is reflected in https://github.com/methylDragon/ros-type-introspection-prototype
Then in two terminals:
Feature Description
rosidl_message_type_support_t
implementationDynamicSubscription
subscription class that supports a callback that takes dynamic dataDynamicSubscription
to workPrototype serialization support libraries and implementations of this feature will be made for FastDDS in rmw, rcl, rclcpp, and rmw_fastrtps.
Implementation Considerations
See REP-2011 for the feature specification.
(The REP will have to be updated slightly since the implementation of this feature exposed certain necessary refinements.)
FastDDS was chosen for the prototype implementation because it is currently the default rmw for ROS 2.
Additionally, some other REP-2011 features have barebones/minimal implementations that were created to support this feature. As other subsets of REP-2011 get implemented (e.g. the type description message and its utilities), sections of this feature will need to be swapped out with those implementations, namely:
The type description message's C struct and how it is usedRelevant PRs
The top level PRs need to be merged and built alongside each other. The demos repo (and setup instructions above) will ensure the proper branches are checked out for the build.
Interim Stubs
These are so we can get in ABI stable backports (to tide us over the freeze)
Stub Impl
TODOs
When this feature is considered more stable:
Additional Waves
Additional notes/issues
const correctness and lifetime management of
rosidl_message_type_support_t
The
rosidl_message_type_support_t
was, in all cases prior to this feature, populated and used as a compile-time static objects.This feature makes it so that users can generate and populate their own type support structs, which means that they will have to manage its lifetime.
Furthermore, the const void * typesupport implementation of the struct means that runtime mutation of the typesupport implementation is not logically const correct even though it is physically const correct. This is troublesome because mutation of the typesupport is necessary for deferring the getting of dynamic types.
FastDDS Issues
For Posterity
If you want to add new (C compatible) serialization support functionality, follow these steps!
Details
rosidl_dynamic_typesupport
)serialization_support_interface.h
dynamic_data.h
)dynamic_data.c
)dynamic_data.h
)serialization_support.cpp
)e.g. dynamic_data.cpp
)DynamicMessage.h
DynamicMessage.cpp
The text was updated successfully, but these errors were encountered: