examples/python/state_timeline/README.md
This example simulates a robot work cell and demonstrates every feature of the state timeline view.
<!-- TODO(RR-4240): replace the thumbnail above and place a screenshot here. Use `pixi run upload-image --help` for instructions. -->StateChange, StateConfiguration, TextDocument
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:
robot/task).StateConfiguration maps raw state values to display labels and colors (robot/task).robot/gripper).labels array shorter than values falls back to the raw value for the missing entries (robot/connection).robot/connection).visible array of StateConfiguration hides noisy states (robot/diagnostics).send_columns; null entries reset the state and leave a gap, just like empty strings (conveyor).DynamicArchetype. The blueprint maps them onto the StateChange:state slot of the state visualizer, so integer enums and boolean flags each get their own lane; StateConfiguration applies to them too, keyed by the displayed form of the value (plc).origin and filtered with contents entity path expressions.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 [email protected]:rerun-io/rerun.git # Clone the repository
cd rerun
Install the necessary libraries specified in the requirements file:
pip install -e examples/python/state_timeline
To experiment with the provided example, simply execute the main Python script:
python -m state_timeline
If 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