NEWAI chat: ask your fleet anything, in plain language. Chat with your fleet Read more →
Best practices · Episodes and recordings

Recording what robots do: episodes, cycles and flight recordings

Report each task attempt as an episode, with pf.episode in Python or an existing ROS result topic with no code. You get yield, cycle time and the step that fails most, every failed cycle recorded from 10 s before to 5 s after, and incidents saved as MCAP files to replay or open in any MCAP tool.

Decide what one episode is

Yield and cycle time only mean something when one episode is one attempt at one task, with a clear pass or fail: a pick, a delivery, one assembly cycle. Not a shift, and not a whole ROS launch.

  • Task names become a label on every episode metric, so use the same name on every robot: "motor assembly" on line 3 and line 4, not "assembly_v2" on one of them.
  • Steps are the physical phases of the task, such as pick_stator, insert_rotor and press_fit. An episode can have up to 64. The failing step is what tells you where to look.
  • A failure is a result, not an error. Failed episodes are warnings, never errors, so a bad hour on the line doesn't look like a crash.
  • RL is covered already. With Gymnasium, pf run records one rl.episode per environment episode with its return, length and success. Use pf.episode for your own task attempts.

Each episode sends an episode.started and an episode.finished event with its steps and their durations, the metrics app.episode.success (1 or 0) and app.episode.duration_s with the labels task and service, and an episode span.

Check: count ten attempts by hand on one robot and compare them with the count and yield on Models › Cycles. They should match before you trust the fleet numbers.

Report episodes from Python with pf.episode

The context form fits code where one function runs the whole task:

import physicalfleet as pf

for part in parts:
    with pf.episode(task="motor assembly", line="3") as ep:
        with ep.step("pick_stator"):
            pick(part.stator)
        ep.step("insert_rotor")              # a marker: runs until the next step
        if not insert(part.rotor):
            ep.set(success=False, failed_step="insert_rotor")
            continue
        ep.step("press_fit")
        if not press():
            ep.set(success=False, failed_step="press_fit")
  • ep.step(name) works as a with block, or as a marker that runs until the next step or the end of the episode.
  • ep.set(success=..., failed_step=..., **fields) records the result. success also accepts strings such as "failed".
  • The result is success unless you set success=False, an exception escaped (it is re-raised unchanged), or a step raised.
  • The failed step is the one you name, else the first step that failed, else the step running at that moment.
  • Keyword arguments such as line="3" are recorded with the episode.

The library never blocks and never raises, and without an agent the calls do nothing, so the same code runs in simulation, in CI and on the robot.

Check: force one failure on a bench robot, for example by raising inside a step. Models › Cycles should show it with that step as the failed step.

Start and end episodes in different places

State machines and ROS nodes rarely start and finish a task in one function. Name the episode instead of using with:

import physicalfleet as pf

def on_gripper_closed(msg):        # for example, ROS 2 subscription callbacks
    pf.episode_start("pick")

def on_part_placed(msg):
    pf.episode_end("pick", success=True)

def on_part_dropped(msg):
    pf.episode_end("pick", success=False, failed_step="transport")

# or keep an object
ep = pf.episode(task="pick").start()
...
ep.end(success=True)

Starting a task that is still open ends the open one as a failure. That is usually right after a reset, but if one process runs two attempts of the same task at once (two grippers, two stations), give each its own task name.

Each episode also shows on the Development workbench the moment it ends, as a point on the episode-duration chart with failures in red. The workbench is part of the paid plan.

Check: watch Models › Cycles while the robot runs a few attempts. Each finished attempt should appear once, with its duration close to what you measure by hand. A failure you didn't expect usually means a start fired twice before its end.

Count cycles from a ROS topic, with no code

Many cells already publish the result of each cycle on a ROS topic. If yours does, you don't need the SDK at all.

The agent recognises these result topics: a Bool, a number, a String state such as running, done or failed, or JSON events, where a safety_stop event fails the running cycle. It reads likely topics in the background and adopts the one that reports finished cycles. When it can't tell, because two topics look right or a likely one reported nothing for a day, it asks in Fleet › Agent requests: "Which topic tells when an assembly cycle passed or failed?"

One click answers for every machine asking. You can pick a topic, type one, or choose None of these. Topics for the cycle start, the current step and the task can be added the same way, and a cycle that never finishes times out after 600 seconds by default. Cycles from ROS show under the service ros.

Answers can be changed later under Answered: the machines forget the old answer and ask again. Owners and admins answer; members see the requests.

If no topic carries the result yet, add pf.episode_start and pf.episode_end to the node that knows it (above). It takes a few lines and gives you named steps too.

Check: after you answer, the card says what it turned on, for example "Sent to 3 machines. Cycle tracking turns on within a minute." Cycles should then appear on Models › Cycles as the next ones finish.

Read yield, cycle time and the failing step

Once episodes flow, PhysicalFleet turns them into the numbers a line manager asks for, per robot and across the fleet:

  • Models › Cycles on the machine page: yield, number of cycles, cycle time (p50), the step that fails most, failures by step, and the latest cycles with Investigate and Replay.
  • Cycle yield (24 h) on the Overview, as soon as any machine reports cycles.
  • Insights in Debugging › Investigate: machines whose yield is lower than their peers', releases that changed yield, and chains of known causes such as GPU temperature, then CPU throttling, then inference time, then cycle yield.
  • Release safety: yield and cycle time are guarded by the rollout health gate, so a release that lowers yield or slows cycles stops itself. See robot policies.

To be told when yield drops, turn on the suggested task success rule, or write one on the episode metrics with outside its normal range, which learns each robot's usual for each hour of the day. More on rules: observability and alerts.

Check: the step that fails most on Models › Cycles should match what operators report. If it doesn't, look again at the step names or the failed_step logic.

Let failed cycles record themselves

A failed cycle is the moment you most want to see again, and the one nobody was watching. PhysicalFleet records every failed cycle from 10 seconds before it started to 5 seconds after it ended, and uploads it right after.

A cycle recording holds joint states (up to 50 Hz), the planned trajectory or controller targets, TF, wrench, tracking error, step markers, model confidence, and cameras at 10 frames a second. One good cycle per task per hour is recorded too, so you always have a normal one to compare with. Cycle recordings are capped at a handful an hour per machine, so a bad shift can't flood your budget.

Motion comes from ROS. The agent decodes JointState, JointTrajectory, FollowJointTrajectory feedback, DisplayTrajectory, TF and WrenchStamped on its own, read only, and reads robot_description for the 3D arm. Publish the URDF on robot_description, with its meshes on the robot, and the replay shows the arm in 3D. If the agent picks the wrong joint or plan topics, use Chat with us in the dashboard's account menu and we set them for your fleet.

Tracking error records on its own too: when an arm is more than 0.1 rad off its planned path for 10 seconds, the built-in rule raises a warning and saves a recording.

Check: fail a cycle on a bench robot. Once the recording has uploaded, the cycle's row on Models › Cycles should offer Replay.

Know what a flight recording holds

Every machine keeps the last five minutes in memory, like a flight recorder: metrics every second, every log line (masked), events, ROS logs, and a camera frame every two seconds from up to two cameras.

Automatically, when something goes wrong (a stuck model, a lost ROS node, a silent topic, a crash, an out-of-memory kill, a crashing service, a critical alert or an arm off its path), the agent waits 30 seconds for the aftermath and saves one recording covering the incident, linked to its issues. A recording made while offline uploads later.
On request, save one yourself: Save the last 5 minutes on the machine's Files tab, Save the last 1 min / 5 min in Remote › Cameras, or Save last 5 min on the Development workbench. Requests always work and never count toward the daily limit.

Every recording is a standard MCAP file of at most 60 MB, with channels for metrics, logs, events, ROS logs and camera frames in common schemas for logs, compressed images and transforms. Cycle recordings add joints, plan, TF, wrench, tracking, episode markers and model confidence.

Crashes also leave a crash bundle: a summary, the app's last 300 log lines, its systemd status or container details (environment hidden), core dump information and a kernel and system snapshot, all masked on the machine. Recordings and bundles sit on the machine's Files tab, to replay, download or delete.

Check: press Save the last 5 minutes on a test robot. The page shows each stage (asking the machine, saving, uploading) until the recording is there.

Set recording budgets with the link in mind

Automatic recordings follow the machine's bandwidth level, with a daily limit per machine so they can't add up:

Bandwidth levelAutomatic recordingsDaily limit
Very lowNone: only when someone asks0
LowYes, without camera frames10 MB
NormalYes, with camera frames25 MB
HighYes100 MB
Very highYes250 MB

Past the limit, automatic recordings pause until midnight UTC, and the machine's Files tab shows how much was used today. A robot on a SIM plan at Low still records incidents, without camera frames. A lab robot on Wi-Fi can run at High or Very high. Set the level in Settings › Organization › Fleet › Machine defaults, or per machine on its Overview › Settings.

The storage level caps how many recordings the agent keeps on the machine itself, next to its offline backlog, and the agent always leaves free disk for your software. Small camera frames in recordings can be turned off for privacy: ask us with Chat with us.

Recordings you keep count as Storage ($0.10 per 100 MB a month), and their upload as Data transfer ($0.15 per 100 MB). On the Free plan, storage and data transfer are free. See pricing.

Check: pf status on the machine prints its bandwidth level, marked automatic when it was chosen for you, and the state of its data budget.

Replay an incident on one timeline

A recording is only useful if you can line it up with everything else. Open one from its issue, the machine's Files tab, Remote › Cameras › Recordings, or the Replay link on a cycle. It plays in Debugging › Investigate › Timeline: camera frames, metrics, logs and events at the playhead, with play, pause and scrub.

For task cycles you also get:

  • step markers on the scrub bar, with the failed step in red;
  • Chart a field: any recorded value, synced to the playhead;
  • Compare with a good cycle, side by side;
  • the arm in 3D from its URDF, with the planned path drawn as a ghost that turns red above 0.1 rad of tracking error.

Around the incident, the Timeline also shows synced metric charts, the window's events and logs, the open issues, and What changed before: the 24 hours of package, file, container and setting changes leading up to it. Earlier, Later and zoom move the window.

To work outside PhysicalFleet, download the MCAP file and open it in any MCAP tool.

Check: on a failed cycle, Compare with a good cycle should put both cycles side by side. If no good cycle is offered, that task hasn't had a recorded good cycle yet.

Record camera clips on purpose

There is no continuous video recording. Keep what you need while you watch:

  • Snapshot: a still image (up to 1280 px wide) from the machine's Hardware tab or Remote › Cameras, kept with the machine's files.
  • Live: a live view in your browser through the PhysicalFleet relay, several cameras at once, with no public IP.
  • Record: a clip of what you are watching, up to 10 minutes, saved for the team.
  • Save the last 1 min / 5 min: pulls from the flight recorder, so you can keep what just happened.

If the robot's own app holds the camera, frames come from its ROS image topic, so your app keeps the camera. A camera another program holds without publishing on ROS is not opened, and the page names that program. A live view runs for up to 15 minutes at a time (press Watch again to keep going), is for owners and admins, and is logged in the audit log. A live view's frames count as data transfer ($0.15 per 100 MB on a paid month; free on the Free plan). Machines installed with --no-camera never send images.

On the Development workbench (paid plan), up to four cameras run live side by side, each with Record and Snapshot, and they don't count as data transfer while you have the plan.

Check: recorded clips appear under Remote › Cameras › Recordings for everyone on the team.

Export hard frames for labelling

The one dataset you can export from PhysicalFleet is hard frames: the images a vision classifier was unsure of. They are the frames most worth labelling next.

Image classifiers in PyTorch or ONNX Runtime are recognised under pf run or the library. A frame is hard when confidence is under 0.6 by default, or 0.15 below the model's own usual. Hard frames collect in a gallery on the machine's Models tab, and Export dataset downloads a zip of JPEGs with a labels.json, up to 2,000 frames or 200 MB per export.

They are sent within the bandwidth level (10 a day at Low, 100 at Normal, more at High and Very high, none at Very low), never from machines installed with --no-camera. The app needs Pillow or OpenCV, and must run as root or in the physicalfleet group.

Episodes and cycle recordings are not exported in a training format, and teleop sessions are not recorded automatically. Flight recordings are standard MCAP files you can download, so the raw data stays yours; turning it into a training set is up to your own tools.

Check: open the gallery after a day of traffic and confirm the predicted classes and confidences look right before you export.

Checklist
  • Define one episode as one attempt at one task, with a clear pass or fail.
  • Use the same task names on every robot.
  • Name steps after physical phases, and set failed_step when you know it.
  • Use pf.episode_start and pf.episode_end when start and end are in different callbacks.
  • For cells that already publish results, answer the cycle-topic card in Fleet › Agent requests.
  • Compare Models › Cycles with a manual count before you trust the numbers.
  • Publish joint states, the plan and robot_description so replays show the arm.
  • Pick each machine's bandwidth level with its recording budget in mind.
  • Save the last 5 minutes by hand when you see something odd.
  • Turn on the health gate so yield and cycle time can stop a bad release.
  • Export hard frames regularly for labelling.
Common mistakes

Episodes that are too long

An episode that spans a shift or a whole launch averages the failures away. Keep it to one attempt at one task.

Different task names for the same task

"pick" on one robot and "pick_v2" on another split yield in two, and peer comparisons stop working. Use one name per task across the fleet.

Starting a new attempt before ending the last

Starting a task that is still open ends the open one as a failure, so yield reads lower than it is. Make sure every start has an end.

Reporting the same cycle twice

If the cell publishes a result topic and the code also calls pf.episode for the same cycle, it is counted under two services. Pick one source per cell.

Expecting continuous video

Machines keep a rolling five minutes and save it on incidents or on request. Save the last 5 minutes, or press Record, when you need footage.

Leaving field robots at Very low

At Very low, nothing is recorded automatically. Use Low with a data budget instead: incidents still record, without camera frames.

No robot_description on the robot

Without a URDF on robot_description, failed-cycle replays have no 3D arm. Publish it, with its meshes on the robot.

Written for PhysicalFleet as of December 3, 2026.

FAQ

Episodes and recordings: common questions

Something else? Talk to our team.

How do I measure robot cycle time and yield?

Wrap each task attempt in pf.episode, or let the agent read an existing ROS result topic. PhysicalFleet shows yield, cycle time (p50), the step that fails most and failures by step per machine, and Cycle yield (24 h) across the fleet.

Do I need to change code to count cycles?

Not if the cell already publishes each cycle's result on a ROS topic: a Bool, a number, a state string or JSON events. The agent finds the topic, or asks you to confirm it once in Fleet › Agent requests.

What is in a robot flight recording?

The minutes around an incident, including 30 seconds of aftermath: metrics every second, every log line (masked), events, ROS logs and a camera frame every two seconds. Failed-cycle recordings add joints, plan, TF, wrench, tracking error, step markers, model confidence and cameras at 10 frames a second.

Can I open the recordings outside PhysicalFleet?

Yes. Every recording is a standard MCAP file of at most 60 MB. Download it from the machine's Files tab and open it in any MCAP tool.

Does PhysicalFleet record video continuously?

No. Machines keep a rolling five minutes in memory and save it on incidents or when you ask. Camera clips are recorded on purpose, up to 10 minutes each.

Can I export episodes as a training dataset?

No. The one dataset export is hard frames from vision classifiers: a zip of JPEGs with a labels.json. Episodes and recordings are not exported in a training format, though you can download the MCAP files.

Are teleop sessions recorded as episodes?

No. Teleop sessions are not recorded automatically and are not turned into episodes. Episodes come from your code or a ROS topic, and camera clips are recorded by hand.

How much data do recordings use?

Automatic recordings follow the bandwidth level, with a daily limit per machine: 10 MB at Low (no camera frames), 25 MB at Normal, 100 MB at High and 250 MB at Very high. Recordings you ask for don't count toward it.

From the lab bench. To the entire fleet.

Connect your first machine in minutes, develop it in the lab and run your whole fleet in production from one place.

Free for up to 3 machines · Then pay as you go