Skip to content

Commit

Permalink
fix missing fields check for mappings to substructures
Browse files Browse the repository at this point in the history
This happens for rcl_interfaces/Log

'header.stamp' gets mapped to 'stamp'. For the old check on both messages where some fields missing: 'topics' in ros2 and 'stamp' in ros1. That 'stamp' was mapped via the custom rule above wasn't recognized by the old logic. For now we say if there a custom field mappings for a field we skip this check.
  • Loading branch information
hoffmann-stefan committed Oct 30, 2024
1 parent 53078d3 commit 7efc9cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ros1_bridge/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,10 @@ def determine_field_mapping(ros1_msg, ros2_msg, mapping_rules, msg_idx):
# check that no fields exist in ROS 2 but not in ROS 1
# since then it might be the case that those have been renamed and should be mapped
for ros2_member in ros2_spec.structure.members:
if any(ros2_member == key[0] for key in mapping.fields_2_to_1.keys()):
# If they are explicitly mapped this should be fine...
continue

for ros1_field in ros1_spec.parsed_fields():
if ros1_field.name.lower() == ros2_member.name:
break
Expand Down

0 comments on commit 7efc9cb

Please sign in to comment.