Logging functions
rerun
def log(entity_path, entity, *extra, timeless=False, recording=None, strict=None)
Log data to Rerun.
This is the main entry point for logging data to rerun. It can be used to log anything
that implements the rerun.AsComponents
interface, or a collection of ComponentBatchLike
objects.
When logging data, you must always provide an entity_path for identifying the data. Note that the path prefix "rerun/" is considered reserved for use by the Rerun SDK itself and should not be used for logging user data. This is where Rerun will log additional information such as warnings.
The most common way to log is with one of the rerun archetypes, all of which implement
the AsComponents
interface.
For example, to log a 3D point:
rr.log("my/point", rr.Points3D(position=[1.0, 2.0, 3.0]))
The log
function can flexibly accept an arbitrary number of additional objects which will
be merged into the first entity so long as they don't expose conflicting components, for instance:
# Log three points with arrows sticking out of them,
# and a custom "confidence" component.
rr.log(
"my/points",
rr.Points2D([[0.2, 0.5], [0.9, 1.2], [1.0, 4.2]], radii=[0.1, 0.2, 0.3]),
rr.Arrows3D(vectors=[[0.3, 2.1], [0.2, -1.1], [-0.4, 0.1]]),
rr.AnyValues(confidence=[0.3, 0.4, 0.9]),
)
PARAMETER | DESCRIPTION |
---|---|
entity_path |
Path to the entity in the space hierarchy.
TYPE:
|
entity |
Anything that implements the
TYPE:
|
*extra |
An arbitrary number of additional component bundles implementing the
TYPE:
|
timeless |
If true, the entity will be timeless. Otherwise, the data will be timestamped automatically with
TYPE:
|
recording |
Specifies the
TYPE:
|
strict |
If True, raise exceptions on non-loggable data.
If False, warn on non-loggable data.
if None, use the global default from
TYPE:
|
See also: rerun.log_components
.
def set_time_sequence(timeline, sequence, recording=None)
Set the current time for this thread as an integer sequence.
Used for all subsequent logging on the same thread,
until the next call to set_time_sequence
.
For example: set_time_sequence("frame_nr", frame_nr)
.
You can remove a timeline again using disable_timeline("frame_nr")
.
There is no requirement of monotonicity. You can move the time backwards if you like.
PARAMETER | DESCRIPTION |
---|---|
timeline |
The name of the timeline to set the time for.
TYPE:
|
sequence |
The current time on the timeline in integer units.
TYPE:
|
recording |
Specifies the
TYPE:
|
def set_time_seconds(timeline, seconds, recording=None)
Set the current time for this thread in seconds.
Used for all subsequent logging on the same thread,
until the next call to rerun.set_time_seconds
or rerun.set_time_nanos
.
For example: set_time_seconds("capture_time", seconds_since_unix_epoch)
.
You can remove a timeline again using disable_timeline("capture_time")
.
Very large values will automatically be interpreted as seconds since unix epoch (1970-01-01).
Small values (less than a few years) will be interpreted as relative
some unknown point in time, and will be shown as e.g. +3.132s
.
The bindings has a built-in time which is log_time
, and is logged as seconds
since unix epoch.
There is no requirement of monotonicity. You can move the time backwards if you like.
PARAMETER | DESCRIPTION |
---|---|
timeline |
The name of the timeline to set the time for.
TYPE:
|
seconds |
The current time on the timeline in seconds.
TYPE:
|
recording |
Specifies the
TYPE:
|
def set_time_nanos(timeline, nanos, recording=None)
Set the current time for this thread.
Used for all subsequent logging on the same thread,
until the next call to rerun.set_time_nanos
or rerun.set_time_seconds
.
For example: set_time_nanos("capture_time", nanos_since_unix_epoch)
.
You can remove a timeline again using disable_timeline("capture_time")
.
Very large values will automatically be interpreted as nanoseconds since unix epoch (1970-01-01).
Small values (less than a few years) will be interpreted as relative
some unknown point in time, and will be shown as e.g. +3.132s
.
The bindings has a built-in time which is log_time
, and is logged as nanos since
unix epoch.
There is no requirement of monotonicity. You can move the time backwards if you like.
PARAMETER | DESCRIPTION |
---|---|
timeline |
The name of the timeline to set the time for.
TYPE:
|
nanos |
The current time on the timeline in nanoseconds.
TYPE:
|
recording |
Specifies the
TYPE:
|