Ros1_Bridge: Custom message pairing failed if those messages have non- identical names in ros1 and ros2
I am developing simple publisher- subscriber with custom messages.
The name of custom message file is 'EgoData.msg' in ROS1 and 'Size.msg' in ROS2 workspace. I have done the mapping in yaml file as follows:
ros1_package_name: 'ros1_test' ros1_message_name: 'EgoData' ros2_package_name: 'bridge_test' ros2_message_name: 'Size' fields_1_to_2: vehicleLength: 'length'
I have done all the necessary steps for bridging custom messages. After I run dynamic bridge, publisher and subscriber, I get following error:
failed to create 1to2 bridge for topic '/chatter' with ROS 1 type 'ros1_test/EgoData' and ROS 2 type 'bridge_test/Size': No template specialization for the pair
For debugging, I also checked generated/bridge_test_factories.cpp, it does not show any mapping of ros1 to ros 2.
Now, if I keep the name of custom messages at ros1 and ros2 same, say, I make ROS1 message name as 'Size.msg', and then build-run necessary nodes - publisher, subscriber and bridge; the pairing gets successful:
created 1to2 bridge for topic '/chatter' with ROS 1 type 'ros1_test/Size' and ROS 2 type 'bridge_test/Size' [INFO] [ros1_bridge]: Passing message from ROS 1 ros1_test/Size to ROS 2 bridge_test/Size (showing msg only once per type)
I have seen example mapping_rules.yaml where, even though service names are different, I can see them paired when I print using "--print-pairs". But in my case it's not working for messages. So is it something like the name of custom messages which we want to bridge must be identical? Or do I need to do any extra steps other than mentioned in documentation for custom messages? Kindly let me know the probable finding.
Looking forward to the answer.
Please consider sharing all your code to check if there is any difference to what is recommended in the docs. They are supposed to work as-is.
Hi, sorry for the delayed reply. I have uploaded the code here. I am using ros1 kinetic and ros2 bouncy- colcon build. Please let me know if any other information is needed.
A reminder that I have posted code's link in my previous comment, the issue is still not solved. Please let me know your view.