msg: urtps: change the topic Data Type name to match expected on ROS2 #13907
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe problem solved by this pull request
This change allows that our micro-RTPS agent communicates with ROS 2 Dashing (Eloquent not tested yet).
Describe your solution
Most of the problem was presented and followed in eProsima/Fast-DDS#829. The issue is that the topic data type name that is generated by
fastrtpsgen
, set in the<msg_name>PubSubTypes.cpp
files, doesn't match the expected type name of the ROS 2 participant topics. So the solution taken was to directly "reset" the type naming on both Publisher and Subscriber source code.Thumbs up for @ldg810 for finding and pointing https://answers.ros.org/question/319723/use-ros2-fastrtps-with-standalone-fastrtps-programs/ in eProsima/Fast-DDS#829, which allowed me to fix this. Thanks @ldg810!
Describe possible alternatives
If we find a way of adjusting the naming being set here by an argument passed through the generator, this could be used instead of the default
scopedname
.@richiware is this possible by any means? I understand that the scope is built based on the directory structure, but
rosidl_generate_interfaces()
puts the generated IDL's underpx4_msgs/msg/
, while this wasn't a problem forrosidl_generate_dds_interfaces()
, since the generated IDL's where put underpx4_msgs/msg/dds_fastrtps
, which in return would get you the right scope name.If the above is not possible, one way I am seeing is to create a temp dir and copy the IDL files for it so to generate the code with the right scope.
Test data / coverage
Tested with
px4_ros_com
and SITL with UDP.FYI @thomasgubler @jkflying.