ROS1_bridge: How to map multiple messages and variables with custom datatypes between ROS1- ROS2 using mapping rule yaml file?
If there are multiple messages from one ros1 package are to be mapped to multiple messages from one ros2 package, how it should be done using yaml file? I need such mapping in following use-cases:
1) Suppose ros1 package has messages like A.msg, B.msg and ROS2 package has messages like X.msg, Y.msg and I want to map variables of messages as A <-> X, B<->Y. So I tried the mapping in YAML file as: I
ros1_package_name: 'ros1_test'
ros1_message_name: 'A'
ros2_package_name: 'ros2_test'
ros2_message_name: 'X'
fields_1_to_2:
a_var: 'x_var'
ros1_package_name: 'ros1_test'
ros1_message_name: 'B'
ros2_package_name: 'ros2_test'
ros2_message_name: 'Y'
fields_1_to_2:
b_var: 'y_var'
If this mapping is used, ROS1 bridge only maps B<->Y. The A<->X mapping is not done; Probably because it is overwritten. So how exactly such multiple message mapping should be done?
2) In this scenario, the problem is with mapping variables of custom datatype consider that A.msg is a message in ROS1 package. X.msg, Y.msg are the messages in ROS2 package; which are as follows:
A. msg (ROS1 message)
int32 a_var
X.msg (ROS2 message)
Y x_var
Y.msg (ROS2 message)
int32 y1
float32 y2
int32 y3
In this case, how to map A.msg <->X.msg and variables a_var <-> x_var.y1 using mapping rules in yaml file?
Looking forward to suggestions and answers.