Header
stamp is seconds since the Unix epoch (or since sim start); frame_id names the frame.
Full docstring
WHY float seconds, not ROS's (sec, nanosec): it is what every trajectory and controller in this codebase already uses. float64 resolves 0.24 µs at today's epoch; `stamp_ns` and `from_ns` exist for the lossless edge (bags, MCAP). `meta` is context ROS has no field for (an origin, units, where the numbers came from, what a cleaner changed) as an immutable ``str -> str`` mapping. WHY on the header, not a free-form field on each message: the header is already the one place a message says what its numbers are relative to (`frame_id`); meta extends that slot, so every stamped message and every trajectory gets it once, and everything that keeps the header (slicing, `.at()`, `resample`, serialisation) keeps it too. WHY strings only: the values are read by people and other tools; a number would be `str()`-ed silently, so it is refused and the caller picks the spelling (``repr(origin)``). Dropped on ROS export: std_msgs/Header has only stamp and frame_id (docs/DESIGN.md, "Header.meta").
Fields
| Name | Type | Default |
|---|---|---|
stamp | float | 0.0 |
frame_id | str | '' |
meta | Mapping[str, str] | FrozenDict() |
Example
One instance from the package's own test catalog; the output is its real repr().
Header(stamp=1761600000.25, frame_id='camera_color_optical_frame')to_dict() as JSON
{
"_type": "std/Header",
"stamp": 1761600000.25,
"frame_id": "camera_color_optical_frame",
"meta": {}
}Long arrays are cut after 16 values and say so with “…”.
Functions
Constructors
Classmethods and staticmethods: ways to build one.
Related types
Used by
Types whose fields refer to it.
PoseStamped TransformStamped CameraInfo Image Imu JointState PointCloud JointTrajectory JointTrajectoryPoint PoseTrajectory PoseTrajectoryPoint Trajectory TrajectoryPoint Detection2D Detection2DArray Detection3D Detection3DArray