problem during converting grid_map_msgs message from ros1 to ros2
Required Info:
- Operating System:
- Ubuntu 20.04
- ROS Versions
- ROS1 noetic, ROS2 Foxy
- Installation type:
- Source
Steps to reproduce issue
I have converted a grid_map_msgs type message from ros1 to ros2. I have a ros1 version for noetic and ros2 version for foxy. I have installed ros-noetic-grid-map-msgs from binaries in ros1 and built grid-map-msgs foxy devel in ros2 from the source. Now I can convert the message to 90% using ros1_bridge and I can see the message is able to publish the grid_map_msgs in ros2 but for some reason, the header and frame id seems to be publishing null value in ros2 side. Other data are correct.
ROS2 repo: https://github.com/ANYbotics/grid_map...
ROS1 repo: https://github.com/ANYbotics/grid_map...
For ros1 side,
grid_map_msgs
looks following:
GridMapInfo info
string[] layers
string[] basic_layers
std_msgs/Float32MultiArray[] data
uint16 outer_start_index
uint16 inner_start_index
grid_map_info
looks following:
Header header
float64 resolution
float64 length_x
float64 length_y
geometry_msgs/Pose pose
For ros2 side,
grid_map_msgs
looks following:
std_msgs/Header header
GridMapInfo info
string[] layers
string[] basic_layers
std_msgs/Float32MultiArray[] data
uint16 outer_start_index
uint16 inner_start_index
grid_map_info_msgs
looks the following:
float64 resolution
float64 length_x
float64 length_y
geometry_msgs/Pose pose
As you can clearly see, in ros2 side the header and frame id has been swapped from grid_map_info
to grid_map_msgs
. In ros1 side, the header and frame id was inside grid_map_info
and grid_map_info
was called inside grid_map_msgs
.
Expected behavior
The grid_map_msgs ros2 package should map the frame id and header from the grid_map_info_msgs in ros1 package. During mapping, the way it should map:
grid_map_msgs.msgs.GridMap.header (ros2) = grid_map_msgs.GridMapInfo.header (ros1)
grid_map_msgs.msgs.GridMap.frame_id (ros2) = grid_map_msgs.GridMapInfo.frame_id (ros1)
Actual behavior
The grid_map_msgs ros2 package is mapping the frame id and header from the grid_map_msgs in ros1 package right now.
grid_map_msgs.msgs.GridMap.header (ros2) = grid_map_msgs.GridMap.header (ros1, which is null)
grid_map_msgs.msgs.GridMap.frame_id (ros2) = grid_map_msgs.GridMap.frame_id (ros1, which is null)
My question is, how can I manually edit the conversion file (inside build/install of bridge workspace) so that I can map that specific element (header and frameid) inside grid_map_msgs manually before or after the build?