Events and Timelines
Timelines timelines
Each piece of logged data is associated with one or more timelines.
The logging SDK always creates two timelines for you:
log_tick
- a sequence timeline with the sequence number of the log calllog_time
- a temporal timeline with the time of the log call
You can use the set time functions (Python reference: set_time_sequence, set_time_seconds, set_time_nanos) to associate logs with other timestamps on other timelines. For example:
for frame in read_sensor_frames():
rr.set_time_sequence("frame_idx", frame.idx)
rr.set_time_seconds("sensor_time", frame.timestamp)
rr.log("sensor/points", rr.Points3D(frame.points))
This will add the logged points to the timelines log_time
, frame_idx
, and sensor_time
.
You can then choose which timeline you want to organize your data along in the expanded timeline view in the bottom of the Rerun Viewer.
Reset active timeline & differing data per timeline reset-active-timeline--differing-data-per-timeline
You can clear the active timeline(s) at any point using reset_time
.
This can be particularly useful when you want to log different data for individual timelines as illustrated here:
"""Log different data on different timelines."""
import rerun as rr
import rerun.blueprint as rrb
rr.init("rerun_example_different_data_per_timeline", spawn=True)
rr.set_time_sequence("blue timeline", 0)
rr.set_time_seconds("red timeline", 0.0)
rr.log("points", rr.Points2D([[0, 0], [1, 1]], radii=rr.Radius.ui_points(10.0)))
# Log a red color on one timeline.
rr.reset_time() # Clears all set timeline info.
rr.set_time_seconds("red timeline", 1.0)
rr.log_components("points", [rr.components.Color(0xFF0000FF)])
# And a blue color on the other.
rr.reset_time() # Clears all set timeline info.
rr.set_time_sequence("blue timeline", 1)
rr.log_components("points", [rr.components.Color(0x0000FFFF)])
# Set view bounds:
rr.send_blueprint(rrb.Spatial2DView(visual_bounds=rrb.VisualBounds2D(x_range=[-1, 2], y_range=[-1, 2])))
On one timeline the points will appear blue, on the other they appear red.
Sending many time points at once sending-many-time-points-at-once
To get full control over the logged timelines you can use send_columns
.
This is often a lot more efficient when you already have a chunk of temporal data, e.g. some sensor value over time.
Events events
An event refer to an instance of logging one or more component batches to one or more timelines. In the viewer, the Time panel provide a graphical representation of these events across time and entities.
Static data static-data
The rr.log()
function has a static=False
default argument.
If static=True
is used instead, the data logged becomes static. Static data belongs to all timelines (existing ones, and ones not yet created) and shadows any temporal data of the same type on the same entity.
This is useful for data that isn't part of normal data capture, but sets the scene for how it should be shown.
For instance, if you are logging cars on a street, perhaps you want to always show a street mesh as part of the scenery, and for that it makes sense for that data to be static.
Similarly, coordinate systems or annotation context are typically static.