1. Factory pDigger
  2. Developers

Build on what the camera sees.

The unit over your work area interprets one camera: which hand moved which stone, when, and where it went. Its API gives you that record as it happens, from plain-language events down to every model output. Try each call in your browser on real recordings, then make the same calls from Python, TypeScript, Go or Rust.

One session, three levels

Ask for the level you need.

High level

The interpreter

Stones, hands, events and the activities they add up to: a move from lift to place, a burst of pushes. Every one comes with a sentence you can log or show.

world · events · stones · focus · sources · session

Mid level

Streams and draw lists

Frames as server-sent events, NDJSON or a long-poll, with cursors that resume where you left off; final 2-D and 3-D draw lists for a canvas or three.js.

frames/stream · frames · render/overlay2d · render/scene3d

Low level

Frames and the codec

Every layer of every grid frame, five per second of video: the model's packet, the overlay, the scene, the hand cards and the world, and the region images.

frames/{g} · raw/packets · raw/stream · rasters

The interpreter's words

Events you can read aloud.

The SDKs join the world's events into activities and describe each one the same way in every language. These lines are the interpreter's own output over nine seconds of the published dry1 recording.

4:55.2  Right hand pushes stones 580 and 589 (3 pushes in 0.2 s)
4:56.6  stone 614 appears
4:56.6  stone 575 is removed (no longer seen)
5:01.6  Right hand drops stone 571 after 1.6 s
5:01.4  Left hand pushes stones 578, 585, 586 and 614 (17 pushes in 2.2 s)
5:03.6  Right hand pushes stones 572 and 587 (5 pushes in 0.4 s)
dry1, 4:55 to 5:04, read from the published recording.

SDKs

Four languages, one behaviour.

Each SDK has the same three levels, async streams that resume by themselves, a replay of the published recordings for work away from the line, and a test server for your own unit tests. The interpreter's output is identical in all four.

Python

pdigger-factory-sdk

import asyncio
from pdigger_factory_sdk import FactoryClient

async def main():
    async with FactoryClient("http://factory-orin.local:8120") as factory:
        async for activity in factory.interpreter().activities():
            print(activity.describe())

asyncio.run(main())

Python 3.10+, asyncio, one dependency (httpx).

TypeScript

pdigger-factory-sdk

import { FactoryClient } from "pdigger-factory-sdk";

const factory = new FactoryClient("http://factory-orin.local:8120");
for await (const activity of factory.interpreter().activities()) {
  console.log(activity.describe());
}

Node 18+, browsers, Deno and Bun; no runtime dependencies. Three.js views in pdigger-factory-sdk/viz.

Go

github.com/eprojac/pdigger-factory-sdk-go

client, err := pdiggerfactory.New("http://factory-orin.local:8120")
if err != nil {
	log.Fatal(err)
}
for activity, err := range client.Interpreter().Activities(ctx) {
	if err != nil {
		log.Print(err) // the stream reconnects by itself; a cancelled ctx ends it
		continue
	}
	fmt.Println(activity.Describe())
}

Go 1.23+, standard library only, iterators over the stream.

Rust

pdigger-factory-sdk

use futures::StreamExt;
use pdigger_factory_sdk::FactoryClient;

let factory = FactoryClient::new("http://factory-orin.local:8120")?;
let mut activities = factory.interpreter().activities();
while let Some(activity) = activities.next().await {
    println!("{}", activity?.describe());
}

tokio and reqwest (rustls); an egui viewer in pdigger-factory-viz.

The live camera

Live by default, recordings on request.

The shipped unit has one live camera stream, selected when a session starts, beside the recorded videos. The SDKs and the demo support it now.

  • The catalog lists it first, as live, with no duration; default_video is live.
  • It runs at 1.0x. When the unit falls behind it skips frames, so g jumps, rather than slowing the clock.
  • Selecting it takes no time, and a seek is refused (not_seekable).
  • Pause freezes the shared view; play continues at the live edge in the same session.

On your line

One unit, one shared session.

  • The API is served by the unit on the factory network, at http://<unit>:8120/api/v2, with its own docs at /api/docs/.
  • Everyone watching follows the same session. Select, seek, pause, play and the stone highlight change it for all of them; every control can be checked first with dry_run=1.
  • Errors have one shape everywhere: a message, a stable code, and the field or the wait in milliseconds where they apply.
  • The demo on this site plays its own session in your browser, so nothing you try here reaches a unit.

Want this on your line?

Tell us what happens on your floor and what you need to see.

Discuss a pilot