Local archive¶
Appliance-local archive control lives on client.archive and
client.robot(...).archive. Cloud catalog reads use
client.platform.archive.listBags(), listVideos(), and listImages()
(see Cloud archive catalog).
core.getImage returns the next frame in memory for processing.
archive.captureImage saves a JPEG to appliance disk.
archive.captureVideo records an MP4 session with stop().
archive.recordBag / playBag control local rosbag recording and playback
(see Local rosbag recording).
Image and video capture example:
import time
from olo import Client
# @olo-playground: autofill-sim-topics
TOPIC = "/image"
MESSAGE_TYPE = "sensor_msgs/msg/Image"
with Client() as client:
robot = client.robot()
# Capture one JPEG from /image and save it on the appliance.
snapshot = robot.archive.capture_image(topic=TOPIC, message_type=MESSAGE_TYPE)
print(f"Saved image: {snapshot.file_path} ({snapshot.file_size} bytes)")
# Record a 10s MP4 from the same topic.
with robot.archive.capture_video(topic=TOPIC, message_type=MESSAGE_TYPE) as session:
print(f"Recording video on {TOPIC} for 10s...")
time.sleep(10)
result = session.stop()
print(f"Saved video: {result.file_path} ({result.frame_count} frames, {result.duration_seconds:.1f}s)")
# List saved images and videos on the appliance.
print("Images:", [item.filename for item in robot.archive.list_images()])
print("Videos:", [item.filename for item in robot.archive.list_videos()])
import { connect } from "olo/node";
// @olo-playground: autofill-sim-topics
const TOPIC = "/image";
const MESSAGE_TYPE = "sensor_msgs/msg/Image";
const client = connect();
const robot = await client.robot();
// Capture one JPEG from /image and save it on the appliance.
const snapshot = await robot.archive.captureImage({ topic: TOPIC, messageType: MESSAGE_TYPE });
console.log(`Saved image: ${snapshot.filePath} (${snapshot.fileSize} bytes)`);
// Record a 10s MP4 from the same topic.
await using session = await robot.archive.captureVideo({
topic: TOPIC,
messageType: MESSAGE_TYPE,
});
console.log(`Recording video on ${TOPIC} for 10s...`);
await new Promise((r) => setTimeout(r, 10_000));
const result = await session.stop();
console.log(
`Saved video: ${result.filePath} (${result.frameCount} frames, ${result.durationSeconds.toFixed(1)}s)`,
);
// List saved images and videos on the appliance.
console.log(
"Images:",
(await robot.archive.listImages()).map((item) => item.filename),
);
console.log(
"Videos:",
(await robot.archive.listVideos()).map((item) => item.filename),
);
Python API¶
Appliance-local archive (saved images, videos, and rosbags).
- class olo.archive.ArchiveHandle[source]¶
Bases:
objectNamespace-scoped archive handle (symmetry with other robot modules).
- class olo.archive.BagInfo[source]¶
Bases:
objectBagInfo(summary: olo.archive.types.BagSummary, topics: tuple[olo.archive.types.BagTopicInfo, …], compression: str)
- __init__(summary, topics, compression)¶
- Parameters:
summary (BagSummary)
topics (tuple[BagTopicInfo, ...])
compression (str)
- Return type:
None
- class olo.archive.BagSessionTerminalEvent[source]¶
Bases:
objectBagSessionTerminalEvent(type: Literal[‘completed’, ‘failed’], exit_code: int, total_bytes: int | None = None, error_message: str | None = None)
- class olo.archive.BagSummary[source]¶
Bases:
objectBagSummary(name: str, total_bytes: int, file_count: int, created_at: datetime.datetime | None, updated_at: datetime.datetime | None, duration_seconds: float, message_count: int, storage_format: str)
- __init__(name, total_bytes, file_count, created_at, updated_at, duration_seconds, message_count, storage_format)¶
- class olo.archive.BagTopicInfo[source]¶
Bases:
objectBagTopicInfo(name: str, type: str, message_count: int)
- class olo.archive.CaptureImageResult[source]¶
Bases:
objectCaptureImageResult(filename: str, file_path: str, file_size: int, mime_type: str)
- class olo.archive.ImageSummary[source]¶
Bases:
objectImageSummary(filename: str, file_path: str, file_size: int, mime_type: str, created_at: datetime.datetime | None, modified_at: datetime.datetime | None)
- class olo.archive.StopBagPlaybackResult[source]¶
Bases:
objectStopBagPlaybackResult(playback_id: str)
- class olo.archive.StopBagRecordingResult[source]¶
Bases:
objectStopBagRecordingResult(recording_id: str, filename: str, total_bytes: int)
- class olo.archive.StopVideoCaptureResult[source]¶
Bases:
objectStopVideoCaptureResult(recording_id: str, filename: str, file_path: str, file_size: int, frame_count: int, duration_seconds: float, reason: str)
TypeScript API¶
Migration from SDK v1¶
oloClient.videoRecording.startRecording(topic, opts)→robot.archive.captureVideo({ topic, ... })oloClient.videoRecording.stopRecording(id)→session.stop()Local rosbag recording →
robot.archive.recordBag/playBag