0
$\begingroup$

Rosanswers logo

I wonder if there is a simple way to have std_msgs messages with a std_msgs::Header. For example, suppose you want to have an Stamped version of a std_msgs::Float64MultiArray.

Or, on the contrary, do I have to create such Stamped version by defining a new message type (e.g. StampedFloat64MultiArray), as explained here?


Originally posted by Enrique on ROS Answers with karma: 834 on 2011-04-12

Post score: 4

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You have to create a new message type.

We don't plan to offer our own "Stamped" versions of the std_msgs as Header itself is a bit too tied to a particular implementation of coordinate frames (it's only in std_msgs for historical reasons).

The contents of std_msgs are designed to be building blocks not standalone messages. A well designed ROS message will stand alone and can be processed regardless of where it came from. The topic can add semantic meaning but should not be necessary for interpreting the data. For example the sensor_msgs/LaserScan contains all the information required to process it as a laser scan regardless of the topic. Whereas a message of StampedFloat cannot be interpreted w/o knowing the context of what the message is representing.


Originally posted by kwc with karma: 12244 on 2011-04-12

This answer was ACCEPTED on the original site

Post score: 8


Original comments

Comment by AReimann on 2016-03-23:
Any improvement planned on this in the future?

It is a problem if you want to plot data from another machine and the machine is not time synchronized. (and you compare it with something which has time stamps)

Comment by tfoote on 2020-03-30:
As stated in the answer you should make semantically meaningful message definition to then be able to plot it. Even if it's just a bool with a header give it a name that's meaningful.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.