Bugfix: Guess ROS msgs types within package before selecting external to package type #922
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In some scenarios for msg types defined with fields of types with the same type name as types that exist in other packages, the type will be resolved to a package which is not that of the root type containing the field. As an example:
motion_msgs/Motion
defined as:The
Point
in this type is part of ourmotion_msgs
package and thus is referred to without a package name. When being deserialized it current is resolved togeometry_msgs/Point
instead ofmotion_msgs/Point
, resulting in a size mismatch and overrun further into deserializing the msg.The change in the PR would check for the existence of a
Point
type with the same package asmotion_msgs/Motion
, matchingmotion_msgs/Point
first instead ofgeometry_msgs
, before matching a type outside the root type's package.This appears to have been introduced in the latest ROS refactor somehow as we haven't had any issues loading bag files with this type in the past.
Attached bag showing a buffer overrun in the deserialization due to using
geometry_msgs/Point
instead of the custom definedmotion_msgs/Point
when deserializing themotion_msgs/Motion
type. Bag contains exactly one of the offending msg.plotjuggler_test_case.zip