And I think those are very legitimate issues. It seems that the core of your concerns surrounds use of the message to decode information and what to do when that information is nonsensical for a system. Is that a relatively accurate summary? If you’re less concerned with message size and more with the use of it, I think that’s something all together different from what I was thinking above.

Perhaps then we actually just need a twist_converter.hpp-like header. Something to take in a Twist message with the characterization of the base and give back out only sensible fields, and throw exceptions if you try to access fields that are nonsense (or I suppose also if fields are filled out that shouldn’t be).

Maybe we create a new message type: [Something]Stamped which looks a little like

Header header
geometry_msgs/Vector3 linear
geometry_msgs/Vector3 angular
String encoding

and a set of headers that will take it in and output some struct of data that it may actually want to use. Or simply an object that allows access to all information but throws exceptions when you try to access things your encoding type thinks is unreasonable.

1 Like