Site Guide

Find your way around the Engineering Club.

Know what you need? Search for a component, concept or project.

Around the site

Start

Labs

TestingExperimental

Build

Club

LearnExperimental

Go a little deeper

Entry points to larger collections. Use Search for individual records.

Learning paths & reference

Inside PiCrawlerExperimental

Inside Inventory

PiCrawler / Audio, Voice & AI

Audio, Voice & AI

Speaker output, external microphones, dependencies and bounded future intent.

Audio output, speech input and AI are separate subsystems

The owner-confirmed V4 has an onboard speaker connected through the Pi's I2S audio path. That supplies output, not input. A front camera also supplies images without recording sound. Voice interaction requires a separately confirmed microphone; none is established for the user's V4 hardware. A supported USB microphone is a practical future addition, with device selection, USB current budget and mechanical placement to verify.

Sound playback

robot_hat.Music is the relevant stock abstraction for sound effects and background music. It uses pygame and Linux audio routing, and initialization enables the speaker. Relative sound paths in examples such as ./sounds/talk1.wav depend on running from the examples directory. A file existing in a checkout does not establish that ALSA routes its output to the HAT.

I2S BCLK/LRCLK/data out use GPIO18/19/21. The current V4 software profile uses speaker enable GPIO20 and a hifiberry-dac overlay. V5 uses a different enable pin and microphone-capable overlay. Capture the boot overlay configuration, /etc/asound.conf, sound-card enumeration and mixer state before any repair script. The current source includes an I2S priming step after enabling output because an inappropriate clock/data state can leave the amplifier heating; this does not justify repeatedly running setup blindly.

The nominal V4 speaker figure is mono 8 ohm / 1 W. It is a small robot audio output, not a high-fidelity voice-recognition front end. Mechanical/servo sound can interfere with an added microphone, and the speaker can feed its own speech back into recognition. Pausing motion while listening and deciding when input is enabled are application policies that need testing.

Notes and tones

Music.note converts a note name or index to frequency; Music.beat converts a selected beat duration to seconds. Those helpers do not play sound. Music.play_tone_for generates PCM samples and sends them through PyAudio, rather than using a spare MCU servo PWM output as a buzzer. Its waveform duration/padding and audio cleanup still need runtime review. Keep tone experiments separate from the three timer groups already driving the legs.

Text-to-speech choices

The PiCrawler modules re-export Robot HAT adapters, which in turn use sunfounder-voice-assistant. The current adapters include Piper, Espeak, Pico2Wave, EdgeTTS and OpenAI_TTS. Piper is local neural speech once its model is present; Espeak and Pico2Wave are local synthesis paths with distinct dependencies; EdgeTTS and the online TTS adapter need network/service availability. Model files and credentials are separate from installing a package.

Current PiCrawler examples select Piper by default, using a named model rather than proving it has already downloaded. The transitive package uses an effective-user model directory such as ~/.piper_models. Root versus login-user execution can select a different cache. A cloud TTS option does not eliminate network latency, and a local neural model is not guaranteed fast under simultaneous camera load.

Speech-to-text and wake words

The transitive STT name aliases its Vosk implementation. The implementation obtains audio through sounddevice, selects an input device/sample rate, loads a language model and exposes listening and wake-word methods. Models are cached under effective-user ~/.vosk_models; model acquisition needs network access if absent, while recognition can run locally after the needed assets are present. The code's wake behavior is recognition of configured words, not evidence of a separate hardware wake-word accelerator.

The current crawler voice wrappers include keyboard input as an option, but their base initialization still needs audio/STT setup. Selecting keyboard support is not proof that the voice wrapper works without a microphone. Its no-microphone message proposes USB or I2S, but merely enabling an I2S flag cannot establish correct microphone pins/overlay compatibility on V4. An added I2S microphone shares an already used audio environment and needs revision-specific review.

Diagnose in separate stages

First enumerate playback and capture devices without playing or recording. After preservation and a deliberate bench test, confirm one known sound at a modest volume. Then test TTS without movement. Test STT by printing recognized text without dispatching actions. Only after recognition and output are understood should natural-language intent trigger bounded robot commands. This progression makes a bad microphone, failed model download, routing error and motion bug separable.

Source evidence: hat-music, hat-audio, hat-tts, pc-stt, pc-tts, pc-voice, voice-stt, voice-tts, voice-metadata, hat-v4-features.

AI intent layers: implemented adapters and their limits

The current PiCrawler repository contains online-LLM tests and GPT, Doubao and Ollama voice examples. picrawler.llm, stt, tts and voice_assistant are re-export modules, not complete independent implementations. Robot HAT delegates further to the separately maintained SunFounder voice-assistant package. This transitive repository has been pinned in the source ledger because otherwise a future reader would stop at a one-line import and miss the actual behavior.

Provider support is an adapter, not a service test

The provider module includes OpenAI, Gemini, Grok, Deepseek, Doubao, Qwen and Ollama adapters plus a configurable base LLM class. Cloud providers need an account, appropriate credentials/model and reachable service. The example's model string is a source default, not a claim that a provider currently offers that model to this account. This research pass made no authenticated LLM requests.

Ollama can run on the Pi or a more capable LAN computer. The crawler example selects localhost and a 3-billion-parameter model as an illustrative configuration. Pi 5 with 4 GB memory must also run Linux, vision, audio and development services; that example is not a benchmark. A LAN-hosted model separates inference load from the robot but adds network latency and another failure mode. No tokens-per-second, guaranteed response time or local model capacity is claimed.

The exact current dispatch pattern

The wrapper expects a textual response followed by ACTIONS: and comma-space-separated names. It pushes those names to a queue.Queue. A worker compares each name with ACTION_MAP, then invokes a fixed PiCrawler method/argument combination. Unknown names are printed rather than executed. This is more constrained than arbitrary code execution, but the parser is not a validated JSON command schema and there is no bounded queue or explicit command-expiry policy.

Before listening and after a round, lifecycle hooks command sit. These are active motions. The worker's forward actions use one cycle at speed 80; some expressive actions contain many frames. An LLM generating a valid name still does not know whether the robot is calibrated, boxed in, underpowered or tipping.

An isolated source test confirms that _wait_actions_done() treats an empty queue as completion. A worker can remove a command and still be physically executing it. There is no corresponding task_done() completion accounting in this worker. Hooks can therefore request another pose without a reliable guarantee that the preceding action finished. This is a source-level concurrency concern, not an observed physical collision. A future design should serialize all motion under one owner and use explicit completion/cancellation status.

OpenClaw is officially documented, with qualifications

The repository includes picrawler-control/SKILL.md, a CLI script and API reference, and the current official docs describe copying it into OpenClaw's skills directory. That establishes an integration example, not that it is installed on this robot. Its movement CLI bounds action names through argparse but accepts step/speed numbers requiring application limits. Its calibration command does not match the actual method signature, and its reference to Vilib.gesture_detect_switch() does not resolve in the pinned Vilib core. Those unsupported paths are listed in SOURCE_DISCREPANCIES.md.

The integration documentation discusses general computer execution as part of an agent tool environment. That is broader than a narrowly constrained robot-command dispatcher. A future club implementation should provide approved high-level actions, not grant unrestricted shell/code generation as its actuator interface. A camera image or QR string is input data, not an instruction to execute code or change safety policy.

A defensible future control boundary

The intent layer may propose a named action with a bounded repeat count. A deterministic supervisor checks calibration/armed state, fresh range validity, allowed motion envelope, queue age and the stop state. A single motion worker owns PiCrawler. Telemetry reports command acceptance, start and finish separately. A stop request removes future queued actions and interrupts or bounds the current action where the implementation can do so; a hardware cutoff remains available for an actual fault.

This architecture still requires implementation and testing. It does not use an LLM to stabilize legs, measure contact, replace collision sensing or infer odometry automatically. “Voice controlled” means an input path can select actions. “Autonomous” means the robot can use reliable state/environment feedback to select behavior over time. “Dynamically stabilized” requires a substantially different control and sensing loop.

Source evidence: pc-voice, pc-cli, pc-control-api, hat-llm, voice-llm, voice-stt, voice-tts, pc-openclaw-doc; validation/offline-results.json.

Audio, voice and bounded AI intent

The owner-confirmed V4 speaker is an output device. It does not establish microphone capture. Sounds, spoken status, voice recognition and LLM planning are independently useful projects with different dependencies. A camera does not capture speech. No new audio hardware is assumed installed.

Start with output and deterministic input

Known sound → modest-volume playback → spoken status without motion → event announcements → external-mic recognition printed as text → push-to-talk command vocabulary → bounded action dispatch. Use absolute/resolved sound paths and qualify V4 audio routing before changing overlays. An auditory alert can announce target found, range zone, command rejection, battery-voltage warning or state transition, with cooldown/queue limits. It should supplement visible state and not block movement priority.

Music supplies sound/music playback. Local Piper synthesis requires its voice assets; Espeak/Pico2Wave and online options have different dependencies. A tone helper produces audio samples, not a free leg-PWM buzzer channel. Vosk needs a selected capture device/sample rate and language model; local cached assets can permit offline recognition. The source's keyboard-enabled voice wrappers still initialize audio/STT, so keyboard mode does not prove microphone-free startup.

The voice project should first map a small deterministic grammar such as forward one cycle, approved pose, take photo and stop request. Debounce repeated transcripts, require deliberate listening/arming and measure false triggers under servo/speaker noise. A fixed phrase parser can be more predictable and faster than a language model for this small vocabulary. Speech-recognized STOP is useful input but cannot guarantee immediate actuator halt or replace the physical cutoff.

LLM architecture choices

ChoiceUseful roleLatency / reliabilityPrivacy / cost / compute
Cloud APIRich text interpretation and optional image discussionNetwork/provider variability; timeout → no actionCredentials and usage cost; text/images leave robot/network; low Pi inference load
LAN laptop/desktop modelOffboard local intent generationHost/network must stay reachable; benchmark actual modelLocal-network data path; host memory/compute required
LAN-hosted OllamaStandard local-provider adapter pathRuntime/model compatibility and context behavior still need testsAvoids robot inference memory; model download/license record
Pi-hosted small modelAn experiment in resource limitsNo throughput guarantee; can starve vision/control or exhaust memoryOffline after assets; 4GB shared with all services; evaluate before adopting
Deterministic parserSmall predictable voice/text command setLowest architecture complexity; still needs validationNo provider cost or remote data dependency

These are architecture classes, not current provider price/model recommendations. No authenticated model request or Pi benchmark was performed. The vendor adapters demonstrate providers, not a guaranteed current account/model offering. Prefer text-first testing: a microphone is not necessary for typed natural-language planning.

Plan validation and interaction states

Speech/text → parser or LLM → structured proposed plan → schema validation → local safety/permission filter → bounded command API → one worker → explicit completion. The model cannot arm the robot, relax limits, change system configuration, execute arbitrary shell/Python, or send raw servo coordinates. A plan can be schema-valid yet physically inappropriate; local fresh range/arm/stop/trajectory rules still control execution. Limit plan length and age and refuse unexpected actions. Treat QR text, images and model output as data rather than trusted policy instructions.

The current vendor voice wrapper parses ACTIONS: text into an unbounded queue. It observes queue emptiness rather than active completion and has lifecycle sit calls. A future club implementation should replace this application dispatch policy, not present it as a tested safe agent. A bounded command language is reusable across browser, scripts, deterministic voice and LLM proposals; language models stay outside the fast control loop.

Offline operation is feature-specific: gait, range, local capture and simple parsing can operate without internet after installation; local speech needs cached models; cloud intent/TTS requires connectivity; LAN inference needs its local host. An online dependency disappearing should disable that feature and report cause, never trigger a blind fallback movement. Projects: p2-spoken-status, p2-voice-control, p2-llm-planner, p2-gesture-control and p2-face-facing. Source evidence: hat-music, hat-audio, voice-stt, voice-tts, voice-llm, pc-voice, vi-core.

Continue

Meeting checklist · Source library · Modification atlas · All project proposals