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

Is Header required in a message?

asked 2014-02-28 02:10:02 -0500

veger gravatar image

http://wiki.ros.org/msg states:

The special nature of Header is mainly for historical reasons, such as preserving recorded data.

Does this mean that for newly created messages this field should/must omitted? Or should I still include it (to have normal/full functionality)?

I guess my question actually is: What is this Header type and why do I need it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-02-28 02:35:13 -0500

dornhege gravatar image

updated 2014-02-28 02:35:48 -0500

Short answer: Include a Header in your message iff you need a header.

Longer answer: Header contains standardized information like a time stamp and frame id for TF. If your messages is of a nature that requires such things, it is good practice to use the standard Header instead of producing such things by yourself. If your message does not need such information, you don't need a header.

The special nature is that ROS classes might handle a message with header slightly different. There is the old seq id that is automatically incremented by publishers. In all other cases publishers do publish exactly the message you give them.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-02-28 02:10:02 -0500

Seen: 1,524 times

Last updated: Feb 28 '14