Skip to content

Set TopicDataType name before registering types in DomainParticipant #73

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

Merged
merged 2 commits into from
Apr 7, 2025

Conversation

Carlosespicur
Copy link
Contributor

@Carlosespicur Carlosespicur commented Apr 2, 2025

This PR solves an issue reported in eProsima/Fast-DDS-python#222.

If the user sets the type name manually using TopicDataType::set_name(type_name_A), an error happens when trying to create the topic in the Plotjuggler side Participant.

On the Publisher side, the TypeObject that is registered in the TypeObjectRegistry is built with a type name type_name_B, hardcoded in the code generated by Fast DDS Gen.

On the PlotJuggler side, the Participant reconstructs the TypeSupport from the registered TypeObject, so TypeSupport->get_name() returns type_name_B instead of type_name_A, which is received an stored internally through the on_data_writer_discovery callback implementation. Therefore, the Participant registers the type with the name type_name_B, while the topic is attempted to be created with type name type_name_A, causing an error.

There are two possible solutions to fix the problem:

  1. Use DomainParticipant API to register the type with type_name_A.
  2. Set TypeSupport type name to the type name discovered using TypeSupport->set_name(type_name_A) before registering the type.

This PR uses the second approach.

Signed-off-by: Carlosespicur <carlosespicur@proton.me>
Signed-off-by: Carlosespicur <carlosespicur@proton.me>
@rsanchez15 rsanchez15 force-pushed the hotfix/data-type-name branch from 5b7e668 to 7dc9ca0 Compare April 7, 2025 06:10
@rsanchez15 rsanchez15 merged commit 8f39f14 into main Apr 7, 2025
7 of 11 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.

2 participants