Custom Mappings
Overview
Map any ROS 2 message type to Rerun archetypes via JSON5 config.
Custom message mappings let you visualize any ROS 2 message type in Rerun without writing code. Define a JSON5 file that maps message fields to Rerun archetypes, and Rewire handles the rest.
Usage
rewire record --mappings mappings.json5Generating a template
Use rewire mappings generate to scaffold a mappings file from the types currently discoverable on
the network. Rewire inspects each topic, resolves custom message schemas, and writes a JSON5
template you can edit.
rewire mappings generate --output mappings.json5Basic example
[
{
type: "my_robot/MotorStatus",
entity: "motor",
fields: {
temperature: { archetype: "Scalars" },
rpm: { archetype: "Scalars" },
status_text: { archetype: "TextLog" },
}
},
]This maps the my_robot/MotorStatus message so that:
temperatureis logged as aScalarsentityrpmis logged as aScalarsentitystatus_textis logged as aTextLogentity
Mapping entry structure
Each entry in the mappings array has:
| Field | Required | Description |
|---|---|---|
type | Yes | Full ROS 2 message type (e.g., my_robot/MotorStatus) |
entity | No | Custom Rerun entity path prefix |
fields | Yes | Map of field name to archetype mapping |
Field mapping types
Fields can be mapped in four ways:
- Leaf — single value to a simple archetype (
Scalars,TextLog,TextDocument) - Composite — multiple sub-fields to a complex archetype (
Points3D,Boxes2D, etc.) - Expansion — iterate over arrays with
each - Nested — recurse into sub-messages with
fields
See Archetypes for the full list of supported archetypes and Examples for real-world mapping patterns.
