Feature showcase
State timeline
This example simulates a robot work cell and demonstrates every feature of the state timeline view.
Used Rerun types
StateChange, StateConfiguration, TextDocument
Logging and visualizing with Rerun
Discrete states are logged with the StateChange archetype.
Each logged StateChange marks a transition into a new state, and the state timeline view displays these as horizontal colored lanes over time.
The example covers all features of the view:
- State transitions: each entity gets its own lane, and a state extends until the next transition (
robot/task). - Custom styling:
StateConfigurationmaps raw state values to display labels and colors (robot/task). - Automatic styling: without a configuration, raw values are used as labels and colors come from a built-in palette (
robot/gripper). - Label fallback: a
labelsarray shorter thanvaluesfalls back to the raw value for the missing entries (robot/connection). - State resets: logging an empty string resets the state and leaves a gap in the lane (
robot/connection). - Per-state visibility: the
visiblearray ofStateConfigurationhides noisy states (robot/diagnostics). - Columnar logging: batches of state changes can be sent in one call with
send_columns;nullentries reset the state and leave a gap, just like empty strings (conveyor). - Beyond strings: any string, integer, float, or boolean component can drive a state lane, including custom components logged with
DynamicArchetype. The blueprint maps them onto theStateChange:stateslot of the state visualizer, so integer enums and boolean flags each get their own lane;StateConfigurationapplies to them too, keyed by the displayed form of the value (plc). - Blueprint: state timeline views are scoped with
originand filtered withcontentsentity path expressions.
Run the code
To run this example, make sure you have the Rerun repository checked out and the latest SDK installed:
pip install --upgrade rerun-sdk # install the latest Rerun SDK
git clone git@github.com:rerun-io/rerun.git # Clone the repository
cd rerunInstall the necessary libraries specified in the requirements file:
pip install -e examples/python/state_timelineTo experiment with the provided example, simply execute the main Python script:
python -m state_timelineIf you wish to customize it, explore additional features, or save it, use the CLI with the --help option for guidance:
python -m state_timeline --help