Skip to content

Runtime Interface Reflection: rmw_fastrtps#655

Merged
wjwwood merged 18 commits intorollingfrom
runtime_interface_reflection
Apr 8, 2023
Merged

Runtime Interface Reflection: rmw_fastrtps#655
wjwwood merged 18 commits intorollingfrom
runtime_interface_reflection

Conversation

@methylDragon
Copy link
Copy Markdown
Contributor

@methylDragon methylDragon commented Jan 3, 2023

This PR is part of the runtime interface reflection subscription feature of REP-2011: ros2/ros2#1374

Description

This PR includes implementation of the new rmw APIs for supporting runtime interface reflection:

  • Getting serialization support
  • Converting from serialized data to dynamic data
  • rmw_features labels

It also includes:

  • Utilities for type name mangling
  • An alternate FastDDS subscriber creation pathway supporting runtime types
    • (There's quite a bit of code duplication here, I'm not sure what the best approach is for whittling it down)

TODO:

  • Implement take_dynamic_data

@methylDragon methylDragon force-pushed the runtime_interface_reflection branch 4 times, most recently from 403a9f9 to fd7a44d Compare January 25, 2023 10:09
@methylDragon methylDragon force-pushed the runtime_interface_reflection branch from fd7a44d to 9f0b14a Compare January 30, 2023 09:25
@methylDragon methylDragon force-pushed the runtime_interface_reflection branch 2 times, most recently from 479ae06 to f390143 Compare March 2, 2023 22:31
@methylDragon methylDragon force-pushed the runtime_interface_reflection branch 4 times, most recently from 50ad2fb to 6b7a024 Compare March 23, 2023 02:05
@methylDragon methylDragon force-pushed the runtime_interface_reflection branch 3 times, most recently from f9d10df to 3134b7e Compare March 30, 2023 00:38
@methylDragon methylDragon marked this pull request as ready for review April 2, 2023 00:50
@methylDragon methylDragon force-pushed the runtime_interface_reflection branch 10 times, most recently from 106ac92 to 2e1cd56 Compare April 7, 2023 01:58
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
@methylDragon methylDragon force-pushed the runtime_interface_reflection branch from 2e1cd56 to 1097480 Compare April 7, 2023 01:58
Signed-off-by: methylDragon <methylDragon@gmail.com>
Comment on lines +150 to +165
// void
// on_type_discovery(
// DomainParticipant *,
// const eprosima::fastrtps::rtps::SampleIdentity &,
// const eprosima::fastrtps::string_255 & topic_name,
// const eprosima::fastrtps::types::TypeIdentifier *,
// const eprosima::fastrtps::types::TypeObject *,
// eprosima::fastrtps::types::DynamicType_ptr dyn_type)) final
// {
// NOTE(methylDragon): The dynamic type deferred case is !! NOT SUPPORTED !!
// This is because currently subscriptions are required to have the type at
// construction to create the listener. Deferring it means that the listener
// construction will have to be deferred, and that would require logic changes
// elsewhere (e.g. to check for listener initialization status), which is
// }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this just be removed then? I think (as I've stated elsewhere) we should just not use NOTE. I think this should either be a TODO or not left in.

Copy link
Copy Markdown
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I had a few comments, but they're more questions and clean up of comments than anything. I'm less worried about the polish of this pr since it's not part of the user facing API and also its functionality is covered by examples and tests above.

Comment on lines +305 to +312
// NOTE(methylDragon): I'm not sure if this is essential or not...
// It doesn't appear in the dynamic type example for FastDDS though
// if (!rmw_fastrtps_shared_cpp::register_type_object(type_support, type_name)) {
// RMW_SET_ERROR_MSG_WITH_FORMAT_STRING(
// "failed to register type object with incompatible type %s",
// type_name.c_str());
// return nullptr;
// }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think at this point we should remove snippets like this.

Comment on lines +160 to +163
// NOTE(methylDragon): The dynamic type deferred case is !! NOT SUPPORTED !!
// This is because it's difficult as-is to create a subscription without
// already having the type. Too much restructuring is needed elsewhere to
// support deferral...
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove this or is this suppose to be accompanied with a check of some sort?

Signed-off-by: methylDragon <methylDragon@gmail.com>
Copy link
Copy Markdown
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my comments should still be addressed, but since they're all about code comments, I think we should merge this and fix them up in a follow up. @methylDragon can you make an issue for that if you don't have time to make a pr?

@wjwwood wjwwood merged commit d575a7f into rolling Apr 8, 2023
@delete-merged-branch delete-merged-branch bot deleted the runtime_interface_reflection branch April 8, 2023 19:00
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