Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply automatic mapping rules in case only package+message mapping ex…
…ists (#382) * Fix message mapping by removing early return so other rules can still be applied In determine_field_mapping, there was an early return inside a loop over all mapping rules. IF there we any mapping rules but they don't specify field mappings, the early return made the function return without creating mappings automatically. For a particular message type, ROS 1's uuid_msgs/UniqueID vs ROS 2's unique_identifier_msgs/UUID, the message definition is exacly the same but type name is not. The only mapping fule defined in for unique_identifier_msgs/UUID is that it maps to uuid_msgs/UniqueID, but no field mappings are needed because the definitions are the same. But, then we hit the early return (because the for-loop is ran without any rule applying to the message at hand and thus not `continue`-ing in a code branch handling a rule) and return without applying the normal automatic field mapping generation rules. By removing the early return, the other rules are applied and the mapping rules for handling the exact same message defintions are applied Signed-off-by: Loy van Beek <loy.vanbeek@mojin-robotics.de> * Account for fields mapped by rules when checking for missed fields The code after the early return mentioned in the previous commit assumed all fields would match by name, which was of course true. But not anymore, so the missing check now only fails when the missing fields are also not already accounted for via a mapping Signed-off-by: Loy van Beek <loy.vanbeek@mojin-robotics.de> * Fix flake8 violations Signed-off-by: Loy van Beek <loy.vanbeek@mojin-robotics.de> Signed-off-by: Loy van Beek <loy.vanbeek@mojin-robotics.de>
- Loading branch information