RecorderManager#
The RecorderManager is the per-scene component that drives every recorder: it holds the registered recorders, samples their data functions as the scene steps, and flushes and closes them when recording stops. You do not construct or call it directly. Register recorders through scene.start_recording (or sensor.start_recording) and stop them through scene.stop_recording; the manager does the rest.
For the recording workflow, registering recorders, and camera video capture, see Recording data.
- class genesis.recorders.recorder_manager.RecorderManager(step_dt: float)[source]#
Bases:
objectManage the creation, processing, and cleanup of all data recorders.
- Parameters:
step_dt (float) – The simulation time step.
- RECORDER_TYPES_MAP = {<class 'genesis.options.recorders.PyQtLinePlot'>: <class 'genesis.recorders.plotters.PyQtLinePlotter'>, <class 'genesis.options.recorders.MPLLinePlot'>: <class 'genesis.recorders.plotters.MPLLinePlotter'>, <class 'genesis.options.recorders.MPLImagePlot'>: <class 'genesis.recorders.plotters.MPLImagePlotter'>, <class 'genesis.options.recorders.MPLVectorFieldPlot'>: <class 'genesis.recorders.plotters.MPLVectorFieldPlotter'>, <class 'genesis.options.recorders.VideoFile'>: <class 'genesis.recorders.file_writers.VideoFileWriter'>, <class 'genesis.options.recorders.CSVFile'>: <class 'genesis.recorders.file_writers.CSVFileWriter'>, <class 'genesis.options.recorders.NPZFile'>: <class 'genesis.recorders.file_writers.NPZFileWriter'>, <class 'genesis.options.recorders.TrajectoryFile'>: <class 'genesis.recorders.trajectory.TrajectoryFileWriter'>}#
- add_recorder(data_func: Callable[[], Any], rec_options: RecorderOptions) Recorder[source]#
Automatically read and process data. See RecorderOptions for more details.
- Parameters:
data_func (Callable[[], Any]) – A callable with no arguments that returns the data a step records. A recorder that overrides ‘Recorder._get_frame’ receives from it the object it reads the frame from (the trajectory recorder receives a TrajectorySource).
rec_options (RecorderOptions) – The options for the recorder which determines how the data is recorded and processed.
- Returns:
recorder – The created recorder object.
- Return type:
- step(global_step: int)[source]#
Increment the step count and process data from each recording configuration.
In threaded mode, data is put in queues. In non-threaded mode, data is processed synchronously.
- record(global_step: int)[source]#
Record the current state through every recorder, whatever its sampling rate.
- property is_recording: bool#
- property is_built: bool#
See also#
Recording data: task-oriented guide to recording.
Recorder: base recorder class.
File writers and Plotters: the recorder options you pass to
add_recorder.Scene:
scene.add_recorder,scene.start_recording, andscene.stop_recording.