ros_msg_parser icon indicating copy to clipboard operation
ros_msg_parser copied to clipboard

Fix ROSMessage::updateMissingPkgNames() for ambiguous message names

Open meyerj opened this issue 3 years ago • 1 comments

Fix ROSMessage::updateMissingPkgNames() for the case that types with the same message name but different package names are registered.

We used ros_msg_parser in a case where a message was using two different definitions of Header, a custom one with additional fields, but also std_msgs/Header indirectly via a nested geometry_msgs/Vector3Stamped defined as

# This represents a Vector3 with reference coordinate frame and timestamp
Header header
Vector3 vector

so without an explicit package name for Header and Vector3. The previous implementation of ROSMessage::updateMissingPkgNames() then completed this type with the name of the custom package, whose Header message was registered first, and hence parsing failed.

According to the rules defined in http://wiki.ros.org/msg#Fields unqualified types must be resolved in the local package only, with Header as the only exception. I assume that Header is only resolved to std_msgs/Header if no message named Header is defined in the same package.

meyerj avatar Sep 17 '22 09:09 meyerj

Note: The PlotJuggler plugin for ROS 1 at ros1_introspection/src/ros_message.cpp would also be affected...

meyerj avatar Sep 19 '22 14:09 meyerj