was aiventure-david
Bipedal platform for the supertoys line. Here is the focus of embodied experimentation for the aeon-class machine intelligence (singlular cognition), including the inclusion of safety-guards and criteria.
This repository contains a Windows Forms control application and a Dynamixel motor control library for a 25-DOF bipedal robot. The current codebase supports:
- Hardware initialization over two serial buses (
COM4upper body,COM5lower body) - Motor torque on/off control by region and limb
- Per-motor and per-limb position capture
- Dictionary-based pose replay (
motor_name -> goal_position) - Pose/training persistence using SQLite and text files
The codebase does not yet implement a complete autonomous walking gait routine. The "walk three steps" UI handlers are currently empty stubs.
The GTK Real Atari 2600 view owns the live hardware experiment described
in the sibling atari-2600 repository. It starts the robot's V4L2 camera,
applies the versioned crop/perspective calibration in
joi-gtk/config/atari-camera-calibration.json, previews the rectified display,
and keeps the latest four processed frames for the Atari policy. It writes only
the documented Nano bridge commands (SET <mask> <duration_ms> and STOP) to
the USB serial bridge at 115200 baud. Direction bits are up=1, down=2,
left=4, right=8, and fire=16; the host rejects opposing directions and holds
over 250 ms before they reach the bridge.
Select the camera and /dev/ttyACM* or /dev/ttyUSB* Nano device in the Atari
window, start the camera, connect and record, then use the joystick pad. Each
session records processed-frame timestamps alongside requested and
Nano-confirmed actions in logs/atari-adventure/<timestamp>/episode.jsonl and
stores sampled calibrated JPEGs under its frames/ directory. The Nano's own
watchdog remains the authority that opens every dry relay contact on timeout,
malformed input, or serial loss. Commission the relay bridge with the Atari
disconnected before using it with the live console.
Run in base directory: dotnet run --project joi-gtk/joi-gtk.csproj
Detailed setup: Offline Stella Agent — Experiment 1.
--atari-stella-trial <local-ollama-vision-model> [decisions] is an
emulator-only trial for a local, non-OpenAI vision model. Start Stella with an
Adventure ROM, keep its game view visible on the desktop, and start a
local Ollama server with a vision-capable model. The command captures desktop
screenshots, asks the model to return one constrained text action (NONE,
UP, DOWN, LEFT, RIGHT, or FIRE), and logs its proposals under
logs/atari-stella-trial/.
ollama serve
dotnet run --project joi-gtk/joi-gtk.csproj -- --atari-stella-trial <model> 8This experiment cannot open a serial port, send Nano protocol commands, or
control real Atari hardware: every output is explicitly logged as
relay=disabled.
The experiment sequence is deliberately fixed:
- Experiment 1: Stella plus a local/non-OpenAI model; no Nano or relay.
- Experiment 2: Nano relay control with visible decision LEDs.
- Experiment 3: evaluate an OpenAI vision model against the established baseline.
The formal execution anchor for pose/routine programming is now documented in:
docs/epics/animation-training-epic.mddocs/process/daily-agent-prompts.mddocs/process/coppeliasim-integration.md
This epic defines the operating rule, milestones, acceptance criteria, and immediate backlog for making Animation Training the primary safe workflow.
Mandatory policy:
- Animation Training is the sole approved process for programming new poses and gaits.
- Agent work must align to
docs/epics/animation-training-epic.md.
joi-gtk supports per-motor safety guardrails from a JSON policy file:
- Source file:
joi-gtk/config/motor-overload-thresholds.json - Runtime copy:
joi-gtk/bin/Debug/net9.0/config/motor-overload-thresholds.json - Applied by:
joi-gtk/Services/RobotControlService.cs
Policy format:
{
"defaults": {
"overloadThreshold": 900,
"maxTemperature": 70,
"minVoltage": 90
},
"motors": {
"l_ankle_y": {
"overloadThreshold": 680,
"maxTemperature": 68,
"minVoltage": 92
},
"r_ankle_y": {
"overloadThreshold": 680
}
}
}How it works:
- Safety checks and monitor detection resolve per-motor values first.
- Guardrails covered: overload (
>=threshold), thermal (>=max), voltage (<=min). - If a motor is not listed for a guardrail, defaults are used.
- If the JSON is missing/invalid, code falls back to built-in defaults.
Tuning guidance for standing development:
- Start stricter on ankle and knee motors, then raise gradually as needed.
- Keep left/right thresholds symmetric unless hardware asymmetry is confirmed.
- Change only one joint group at a time and retest monitor alerts after each change.
joi-gtk now includes a machine-readable body model and a startup calibration algorithm:
- Body model file:
joi-gtk/config/body-model.json - Runtime copy:
joi-gtk/bin/Debug/net9.0/config/body-model.json - Calibration report output:
logs/body-awareness-last.json
Algorithm flow:
- Load body graph (
rootJoint, parent links, axes, location tags, hard/soft limits). - Read live joint telemetry (position/load/temperature/voltage) for each configured joint.
- Validate
positionagainst hard and soft bounds. - Build a calibration report for all joints (including missing model joints).
- In strict mode, fail startup on hard-limit or model-missing violations and apply torque-off fail-safe on upper/lower regions.
Usage:
- CLI strict (default):
dotnet run --project joi-gtk/joi-gtk.csproj -- --body-calibrate
- CLI relaxed (report only):
dotnet run --project joi-gtk/joi-gtk.csproj -- --body-calibrate --non-strict
- GTK:
Body Calibratebutton in main action row (strict mode).
How to use in training:
- Run body calibration once after initialize before gait/sweep sessions.
- If strict mode fails, inspect
logs/body-awareness-last.jsonand correct limits/mechanics first. - Keep
body-model.jsonupdated when parent links or safe operating ranges are tuned.
joi-gtk now writes persistent safety events to:
logs/safety-events.log
Each line records:
- UTC timestamp (
ISO-8601) - event type (
SAFETY_GATE_TRIP,MOTION_EXCEPTION) - action and phase
- motor scope
- fail-safe action result
- safety detail payload
Use the report command to summarize frequent safety trips from the persistent log:
- Auto-discovery (runtime then workspace log paths):
dotnet run --project joi-gtk/joi-gtk.csproj -- --safety-report
- Limit top rows:
dotnet run --project joi-gtk/joi-gtk.csproj -- --safety-report 10
- Explicit log file path:
dotnet run --project joi-gtk/joi-gtk.csproj -- --safety-report-file logs/safety-events.log
Report output includes:
- total parsed lines and malformed count
- top events/actions/phases
- most frequent motors involved in trips
- guardrail hit counts (
Comm,Overload,Thermal,Voltage,TorqueOff) - recent trip summaries (timestamp/action/phase/scope)
In Robot Monitoring, the Safe Sweep panel allows controlled back-and-forth joint tests.
Rules:
- Monitoring must be active before starting a sweep.
- Sweep uses motion safety checks (SafetyGate).
- Stop or failure returns the motor to its original position.
For chair-seated validation of arm-side safety gates, joi-gtk now includes a conservative right-arm handshake routine.
- CLI:
dotnet run --project joi-gtk/joi-gtk.csproj -- --seated-handshake-test- optional shake-count override:
dotnet run --project joi-gtk/joi-gtk.csproj -- --seated-handshake-test 4
Note:
- Main GTK no longer exposes a direct handshake button under the animation-training-only policy.
- Use Animation Training flows for canonical handshake behavior; keep CLI handshake for diagnostics/migration only.
Behavior:
- Uses
SafetyGatemotion protection for the right-arm motor scope. - Applies a small shoulder raise and elbow bend/extend shake cycle around current pose.
- Returns the arm to its starting pose in a
finallyblock (best effort). - Any guardrail violation still triggers fail-safe torque-off via existing safety paths.
A reusable labeled motor-body training sheet is available at:
images/motors_on_robot_training_map.svg
It overlays motor labels on images/motors_on_robot.png and includes a legend panel for training sessions and calibration notes.
joi-gtk now supports spoken intent/feedback announcements for user actions.
Packages:
AeonVoiceAeonVoice.Native
Runtime requirements:
- Bundled package data/config are auto-detected from app output.
- Optional overrides:
AEONVOICE_DATA_PATHandAEONVOICE_CONFIG_PATHfor custom data/config locationsARTHUR_AEONVOICE_VOICE(default:Leena)ARTHUR_SPEECH_ENABLED=0to disable speech
Behavior:
- Before a major action, robot voice announces intent.
- After action completion/failure, robot voice announces result.
- Voice failures do not block safety/control flow.
CLI check:
dotnet run --project joi-gtk/joi-gtk.csproj -- --voice-test- custom phrase:
dotnet run --project joi-gtk/joi-gtk.csproj -- --voice-test \"I will move to seated calibration pose.\"
joi-gtk now includes repo-scoped speech recognition integration using
Supertoys.PocketSphinx.
Scope policy:
- Runtime executable and model paths are resolved from app output only.
- No global system path probing is used for recognition runtime selection.
Runtime requirements:
- Build/runtime on
linux-arm64where bundled PocketSphinx runtime exists. - Bundled output paths expected:
runtimes/linux-arm64/native/pocketsphinxmodels/en-us/en-usmodels/en-us/cmudict-en-us.dictmodels/en-us/en-us.lm.bin
Optional environment variables:
ARTHUR_SPEECH_RECOGNITION_ENABLED=0to disable recognition integrationARTHUR_POCKETSPHINX_RIDto force runtime identifier (default: package runtime helper)
CLI checks:
- runtime status:
dotnet run --project joi-gtk/joi-gtk.csproj -- --speech-recog-status
- recognize an audio file (
.raw/.wav):dotnet run --project joi-gtk/joi-gtk.csproj -- --speech-recog-file /absolute/path/to/audio.wav
- 5-second command-window test (
START/STOP):dotnet run --project joi-gtk/joi-gtk.csproj -- --speech-command-test
Animation Training voice command syntax:
START-> begin training sessionSTOP-> stop and save training session
Tone behavior for training voice windows:
- one tone when 5-second recording window begins,
- same tone when recognition window ends,
- different completion tone when animation training is saved.
joi-gtk now supports MPU telemetry from an external Arduino bridge over USB serial.
Default runtime configuration:
ARTHUR_IMU_PORT=/dev/ttyUSB2ARTHUR_IMU_BAUD=115200
Integration points:
RobotControlServicewires the serial IMU provider intoWalkControllersafety checks.- Main window includes:
Read IMUbutton: shows current parsed pitch/roll/yaw and provider status.Balance Stepbutton: applies a conservative compensation step using ankles/hips.
Expected serial line format example:
Xs=...; Ys=...; Zs=...; Xc=...; Yc=...; Zc=...;
Current mapping:
pitch <- Xc(fallbackXs)roll <- Yc(fallbackYs)yaw <- Zc(fallbackZs)
Capture a full current-pose snapshot and tag it as Stable Sitting Position:
dotnet run --project joi-gtk/joi-gtk.csproj -- --capture-stable-sitting
Storage format (db/positions.db) uses normalized tables:
pose_snapshot(id, pose_name, captured_at_utc, motor_count, note)pose_snapshot_value(snapshot_id, motor_name, position_value)
This represents one pose as one snapshot row plus many per-motor rows.
Daily baseline rule (enforced):
- The robot must have a same-day
Stable Sitting Positionsnapshot before training routines run. - If baseline is missing or from a previous day, training actions fail with an operator-visible message.
- Routines currently gated:
--seated-handshake-test- supervised walk actions
- any animation training begin/replay path (service-enforced)
Recommended start-of-day flow:
- Place robot in normal seated baseline posture.
- Run
dotnet run --project joi-gtk/joi-gtk.csproj -- --capture-stable-sitting. - Start training routines.
Training replay CLI (policy-aligned):
- Replay latest captured sequence for a phrase:
dotnet run --project joi-gtk/joi-gtk.csproj -- --replay-trained-phrase seated_handshake
- Replay enforces seated baseline before motion and attempts seated recovery after replay.
Simulation-assisted authoring CLI:
- Import a CoppeliaSim-authored JSON session into
TrainingSequencestorage:dotnet run --project joi-gtk/joi-gtk.csproj -- --import-sim-training path/to/session.json seated_handshake
- Export the same JSON session to a
.jvfjoint-vector log:dotnet run --project joi-gtk/joi-gtk.csproj -- --export-sim-jvf path/to/session.json sim/seated-handshake.jvf
- Session JSON template:
docs/templates/coppeliasim-session.template.json
- Local Arthur scene assets:
scene/arthur.tttscene/sim_scene.simscene.xml
- Current process note:
docs/process/coppeliasim-integration.md
joi-gtk/: Linux GTK application and CLI entrypoint.cartheur-animals-robot/: motor control, safety, motion primitives, persistence helpers.docs/: process/epic/task/session documentation.images/: reference visuals for robot mapping/training.
joi-gtk/Program.csstarts GTK app or handles CLI commands.MainWindowprovides system control, monitoring, and access toAnimationTrainingWindow.RobotControlServiceowns bus I/O, safety gates, baseline enforcement, and fail-safe torque-off behavior.AnimationTrainingServicerecords/replays per-frame motor dictionaries and persists sessions.
AnimationTrainingWindow behavior is now explicitly safety-first and non-blocking:
- On window open:
- robot initializes (if needed) in background;
- same-day
Stable Sitting Positionbaseline is verified; - seated alignment enforcement runs automatically;
Start Trainingremains disabled until baseline reconciliation succeeds.
- Start path:
- runs off the GTK UI thread;
- enforces seated baseline, selects arm scope, disables torque on training arm motors, captures first frame;
- starts timer-based capture loop.
- Capture loop:
- runs frame capture in background to avoid UI freeze;
- avoids overlapping capture/save operations;
- throttles UI/log churn (bounded log buffer + periodic frame detail logging).
- Stop path:
- always queues/executes deterministically;
- if a capture step is in-flight, stop waits for that step then saves;
- after save, training state resets and completion tone plays.
- Replay path:
- enforced baseline before replay;
- deterministic seated recovery attempt after replay (including failure paths).
- Voice path:
- optional only (
Voice ON (Optional)/Voice OFF); - training does not auto-start from window open.
- optional only (
- Stable seated baseline:
db/positions.db(pose_snapshot,pose_snapshot_value). - Training sessions:
db/trainings.db(TrainingSequencerows by session/sequence/motor/position). - SQLite provider is
Microsoft.Data.Sqliteacross active training/storage paths.
dotnet build joi-gtk/joi-gtk.csprojdotnet build Cartheur.Animation.Joi.sln