The Creature is born.

2026-11-30来源 dev.toEnglish
The Creature is born.

The Creature is born.
Building a Local AI Humanoid Creature Simulator: Architecture, Physical Constraints, Spatial Memory & Real-World Testing

Following the major and highly rewarding sessions with the AI office agent (workstation/Clients), the creature is finally born; I have been building and debugging a local AI humanoid creature simulator powered by open-source models running locally via Ollama, synchronized with Google Drive, and controlled step-by-step through a PyQt6 desktop interface where I act as the physical actuator in the real world.

Rather than relying on cloud APIs or a fully autonomous black box, the goal has been to design a grounded, inspectable perception → reasoning → actuator feedback loop capable of exploring a real apartment, tracking rooms and objects, respecting physical body constraints, and recovering gracefully when vision or reasoning hits edge cases.

Here is a complete overview of what we have built and achieved so far.

  1. System Architecture & Local AI Stack

The simulator runs locally on a desktop workstation (Intel Core i3-10100F, 32 GB RAM, NVIDIA RTX 3060 with 12 GB VRAM), separating vision, long-horizon reasoning, state/memory persistence, file synchronization, and human-in-the-loop execution:

Vision Language Model ("Eyes") — qwen2.5vl:7b via Ollama: Analyzes each newly captured photo and returns structured JSON describing the estimated room, confidence score, room probability distribution, lighting quality, visible objects, doorways/passages, door state (porta_gia_aperta), handle certainty (certezza_maniglia), immediate obstacles, and target visibility/distance.

Cognitive Orchestrator ("Brain") — qwen2.5:14b via Ollama: Uses a Reflect-style long-horizon reasoning loop (ragiona_e_scegli_azione) that breaks complex multi-step missions into ordered sub-goals, generates explicit internal self-questioning (domanda_interna and risposta_interna), consults spatial and collision memory, and outputs a single atomic action.

Google Drive Bridge & Local Archiver (vision_watcher.py): Watches the synced Google Drive folder for incoming photos from the phone, waits until file writes stabilize (avoiding partial/in-flight files), and archives images locally with step numbers and timestamps (step_001_...).

State & Persistent Session Log (stato_modello.py): Maintains the humanoid's internal state, room map, short-term memory, recent observations, collision records, and step-by-step history saved to disk (sessione_umanoide_log.json).

PyQt6 Control GUI (sim_gui.py & humanoid_loop.py): Coordinates the state machine (IN_ATTESA_MISSIONE, IN_ATTESA_FOTO, IN_ANALISI, IN_ATTESA_ESEGUITO, MISSIONE_COMPLETATA, FERMATA), warms up both models (SONO CALDO) before unlocking mission start, displays live chronometers and the latest captured frame, and gives me direct actuator controls (ESEGUITO and HO SBATTUTO).

  1. Physical Body Constraints & Atomic Action Catalog

To keep decisions grounded in realistic embodiment rather than wishful thinking, the system enforces explicit physical limits:

Eye Height: 1.20 m from the floor.

Arm Grasping Envelope: 0.40 m to 0.60 m (40–60 cm), with a 0.40 m minimum operational manipulation distance—encouraging the creature to approach distant targets or step back/reposition if too close before grasping.

Rotation Bounds: Capped between 15° and 45° per rotation step.

Head Pitch Bounds (GUARDA_SU_GIU): Bounded between -45° (looking down) and +45° (looking up), with 0° level.

Atomic Actions: RUOTA_DESTRA, RUOTA_SINISTRA, AVANZA_PASSI, GUARDA_SU_GIU, APRI_PORTA, CHIUDI_PORTA, PRENDI_OGGETTO, POSA_OGGETTO, and COMPLETA_MISSIONE.

  1. Reliability, Memory & Anti-Error Upgrades

Live multi-step testing—such as navigating from a room/study area toward a kitchen to find a box of rice, pick it up, carry it to a bedroom, and place it on a bed—exposed several subtle failure modes that we systematically addressed:

Resilient Google Drive File Copying: Added block-level binary copying (_copia_binaria_sicura) and multi-attempt retry handling to prevent file-locking or metadata errors ([WinError 1]) when copying images from a Drive-synced folder.

Room Probability Distributions & Live GUI Badge: Upgraded VLM room estimation (stima_percentuale_stanze, normalized to 100%) and updated the GUI status badge to display live room percentage breakdowns alongside the primary room estimate, plus prompt rules preventing contradictory 100% room assignments when target room cues aren't actually visible.

Persistent Room Map & Collision Memory (HO SBATTUTO): Added mappa_ambienti (tracking visited rooms, seen objects, passages, obstacles, descriptions, and visit counts), probabilita_stanze_correnti, and urti_recenti triggered by the HO SBATTUTO button (registra_urto / segnala_urto).

Door & Handle Safety Guardrails: Prevented APRI_PORTA on already-open doors (porta_gia_aperta == True) or low-confidence handles (certezza_maniglia < 0.75), automatically steering toward AVANZA_PASSI (2 steps) to inspect the passage properly instead of forcing a bad door action.

Anti-Oscillation & Rotational Inertia: Added probabilistic directional inertia (PROBABILITA_CONTINUA_ROTAZIONE = 0.80), recent-action tracking (ultime_azioni), and post-normalization checks to stop back-and-forth 45° left/right ping-pong loops when no obstacle or target justifies reversing.

VLM JSON Retry & Failure Transparency: Increased num_predict token budgets (700 for the VLM, 650 for the Reasoner), added an automatic VLM retry on the exact same image (temperature: 0.0, num_predict: 700) if the first JSON parse fails, and added rule 3d so a VLM errore_vlm doesn't cause the Reasoner to hallucinate "poor lighting" as the root cause.

  1. What's Next

Now that the perception guardrails, room probability display, collision logging, and VLM retry logic are in place, the next focus is running longer end-to-end apartment tests, tuning inference speed and prompt conciseness on the RTX 3060, and refining multi-room navigation once an object is picked up and carried to its destination.

If you're following this local AI & embodied simulation journey—or want to support more experiments and build logs—thanks for reading and supporting on Ko-fi!

原文:https://www.a8q9.cn/en/article/the-creature-is-born-c94239.html

相关文章