ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
4

Stamped std_msgs

asked 2011-04-12 10:01:35 -0500

Enrique gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
8

answered 2011-04-12 11:35:31 -0500

kwc gravatar image

updated 2011-04-12 13:27:14 -0500

tfoote gravatar image

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.

edit flag offensive delete link more

Comments

1

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)

AReimann gravatar image AReimann  ( 2016-03-23 20:35:18 -0500 )edit

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.

tfoote gravatar image tfoote  ( 2020-03-30 12:53:47 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2011-04-12 10:01:35 -0500

Seen: 8,565 times

Last updated: Apr 12 '11