New Behaviors and AI for Pidog

Something I’ve been working on in my spare time. Much bug testing and adjusting of default settings left to be done, but I thought I’d share it in case anyone has an interest in tinkering with it.

Some hightlights:

Two complementary runtimes: CanineCore (modular behaviors) and PackMind (standalone AI)

Intelligent scanning + obstacle avoidance with stuck detection and safety fallbacks

Voice control with wake word; configurable mic, VAD sensitivity, language, and volumes

Advanced AI services: Face Recognition (with personality adaptation), Dynamic Balance, Enhanced Audio processing

Optional SLAM mapping, A* pathfinding, and sensor‑fusion localization

Config‑first design with presets; fresh, canonical config guides for both systems

Safety‑first: watchdog heartbeat/timeout, emergency stop/power‑down; health monitor that auto‑throttles under load

Clean architecture: DI container, service-oriented runtime loops, logging/telemetry hooks

Runs on PiDog; desktop-friendly development with safe hardware no‑ops; examples included

Open source (MIT), actively maintained docs: Quick Start, Programming Guide, API reference

Any trouble installing or setting up, or any pidog or python questions? Reply to this thread or message me on GitHub. The more complex the project gets, the more a larger pool of bug testers is called for, and testing is by far the most time-consuming portion of creating this thing.

Feedback is HUGELY appreciated, and I’m also happy to hear suggestions for new features/modules.

1 Like

Hi!

I’m following you on GitHub; I find your project very interesting. I haven’t finished setting up Pidog version 2 yet.

I can’t wait to start testing your project!

1 Like

Hi, thanks for your commitment! I am currently setting it up (standard dog with rpi 3b) … i will report back how far i got.

I already needed to additionally apt install cmake . Should i add this to the documentation and do a pull request?

Update: I was sadly not succesful with compiling dlib on the 3B .. tried two times, the second time without GUI and that one did not even present me with an error after giving it two hours. I suppose the old 3B might not be powerful enough :frowning:

1 Like

Hello, first of all, thank you so much for diving in. Feedback helps and you immediately noticed a problem that I wouldn’t have noticed for quite a while. I haven’t tested facial recognition very much at all, and have been mostly focusing on opencv. Also yes, PRs are always welcome (even tiny doc tweaks like adding “cmake” help a ton)!

I’ve updated docs to explain your issue, but in a nutshell, on a pi3 you should probably stick with opencv, dlib is pretty heavy duty.

face_recognition depends on dlib; on a Pi 3B there’s usually no prebuilt wheel, so pip tries to compile dlib, which is slow and can appear to hang. Missing cmake triggers extra pain.
Quick fixes on a Pi 3B:

Easiest: disable face recognition (packmind/packmind_config.py → ENABLE_FACE_RECOGNITION = False).
Or install the lightweight set: pip3 install -r requirements-lite.txt (skips dlib/face_recognition).
If you still want it: install build tools, then try again (slow on 3B, Pi 4/5 is much better):

sudo apt install -y cmake build-essential python3-dev libopenblas-dev liblapack-devpip3 install dlib==19.24.0 face_recognition

I’ve updated face_recognition_setup with a more detailed explanation and a method to run dilib anyway, but it will be slow on the pi3.

Good catch btw. I will try to do more testing on the pi3, but some of these modules are much easier to tinker with on the pi4. I might start delineating between what can smoothly run on each platform. Also I intend to streamline the install. My original intent was to not have ANY compiling on the pi itself, but the project has grown fast.

Again, THANK YOU. It would’ve taken me weeks to catch that.

edit: I pushed a lighter version of facial recognition as an option, and added some pi3B presets with realistic defaults. the face_lite module uses OpenCV’s Haar cascades with LBPH. So it’s small (160x160) greyscale images and trains from captured frames to reduce storage use. I’m learning as I go, so not sure how well this works yet.

OH wow, thanks a lot for your work towards 3B compatability!

I got past the requirements install but failed later on. Maybe you could try generating a setup guide for a completely new sd-card install yourself? I find this always to be very helpful to locate possible “small steps” that others have not followed or some minor setings or even one random install or environment-path, that was done for a previous project and is missing for others.

Anyway, please keep up the momentum and thanks for the hard work, I would love to get it running on my pidog!

Here is my “full” testing report.

  1. fresh install of latest raspbian

2. fresh install (and test) of latest pidog from github

3. install requirements-lite.txt (succesfull)

4. (failed) installing voice features:

pip3 install speech_recognition pyaudio results with the following error (that i did NOT try to resolve to first keep on going with the rest):

Defaulting to user installation because normal site-packages is not writeable

ERROR: Could not find a version that satisfies the requirement speech_recognition (from versions: none)

ERROR: No matching distribution found for speech_recognition

5. (failed) testing the various scripts mentioned in readme:

~/HoundMind $ python3 packmind/orchestrator.py

Traceback (most recent call last):

  File "/home/mia/HoundMind/packmind/orchestrator.py", line 32, in <module>

    from packmind.packmind_config import load_config, validate_config

ModuleNotFoundError: No module named 'packmind'

and:




~/HoundMind $ python3 packmind.py

Traceback (most recent call last):

  File "/home/mia/HoundMind/pidog/__init__.py", line 45, in <module>

    Pidog = getattr(_real_mod, "Pidog")  # type: ignore[attr-defined]

AttributeError: module 'pidog' has no attribute 'Pidog' (consider renaming '/home/mia/HoundMind/pidog/__init__.py' if it has the same name as a library you intended to import)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):

  File "/home/mia/HoundMind/packmind.py", line 10, in <module>

    from packmind.orchestrator import main

  File "/home/mia/HoundMind/packmind/__init__.py", line 13, in <module>

    from packmind.orchestrator import Orchestrator

  File "/home/mia/HoundMind/packmind/orchestrator.py", line 38, in <module>

    from pidog import Pidog  # Official hardware library (runs on actual PiDog)

    ^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/mia/HoundMind/pidog/__init__.py", line 47, in <module>

    Pidog = getattr(_real_mod, "PiDog")  # type: ignore[assignment]

AttributeError: module 'pidog' has no attribute 'PiDog' (consider renaming '/home/mia/HoundMind/pidog/__init__.py' if it has the same name as a library you intended to import)

(here i tried debugging a little bit by running a few of the lines in a vanilla python environment outside of the HoundMind folder. when running the lines of the package identifying script one by one, it can sucesfully find the „PiDog“ or even „Pidog“ attribute. but it does not, if i am inside the houndmind parent folder)

I then tryied removing the entire pidog folder (as i am running on the dog itself) and ended up at this error (expected, since i did not proceed installing face_recognition):

~/HoundMind $ python3 packmind.py

WARNING:root:face_recognition not available - face recognition disabled

Traceback (most recent call last):

  File "/home/mia/HoundMind/packmind.py", line 13, in <module>

    raise SystemExit(main())

                     ~~~~^^

  File "/home/mia/HoundMind/packmind/orchestrator.py", line 2695, in main

    ai = Orchestrator(config_preset=preset or "default")

  File "/home/mia/HoundMind/packmind/orchestrator.py", line 429, in __init__

    self.face_recognition_service = FaceRecognitionService(self.config)

                                    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^

  File "/home/mia/HoundMind/packmind/services/face_recognition_service.py", line 100, in __init__

    self.recognition_threshold = self.config.get("FACE_RECOGNITION_THRESHOLD", 0.6)

                                 ^^^^^^^^^^^^^^^

AttributeError: 'PiDogConfig' object has no attribute 'get'

main.py went into simulation, becrying missing pidog library:



~/HoundMind $ python3 main.py

🔧 CanineCore v2025.11.01

==================================================

🎭 Mix and match behaviors | 🧠 Custom AI combinations

🔄 Hot-swap modules | 💾 Learning and memory



🤖 For the standalone AI, run: python packmind/orchestrator.py (or python packmind.py)

==================================================

[WARNING] canine_core: Hardware init failed on this host: Pidog library not available on this host
  1. (failed) after these errors I kept on digging, looking into the canine core folder. at the bottom i found the „quick pi checkup“ scripts and here is the output of the first (the second fails with the same message):
~/HoundMind $ python tools/caninecore_checkup.py --scope import



Environment

===========

OS: Linux

Arch: aarch64

Python: 3.13.5

Pi-like environment: yes



PiDog library

=============

✓ pidog imported



CanineCore module imports

=========================

✗ failed to import canine_core package: No module named 'canine_core'

Traceback (most recent call last):

  File "/home/mia/HoundMind/tools/caninecore_checkup.py", line 73, in import_caninecore_modules

    import canine_core as cc  # noqa: F401

    ^^^^^^^^^^^^^^^^^^^^^^^^

ModuleNotFoundError: No module named 'canine_core'



Summary

-------

Result: FAILURE

To sum up my findings:

on my 3B I have issues with

  • speech_recognition package
  • pidog folder confusing the import scripts
  • canine_core not correctly loading on the real dog
  • potentially missing canine_core package install?

Thank you for all your work on this, a big project!

I ve only tried packmind but got the same errors as S808 on installation of speech_recognition pyaudio and running packmind/orchestrator.py. It can’t find ‘packmind’ when called in the script

I am running a pi4 and had no trouble with *pip3 install face_recognition (*once I had installed CMake:))

Excellent feedback, thanks. This helped me find a bunch of import issues unrelated to your errors. I haven’t had a chance to test any of my fixes yet, but after work tomorrow I’ll start a clean install and write a step by step guide that works. For now, here’s how I addressed the issues you’re having:

  1. speech recognition package confusion

What was wrong

Some docs and messages used the import name (“speech_recognition”) instead of the pip package name (“SpeechRecognition”), causing install errors.

What I changed

Normalized all docs and code messages to use:
pip package: SpeechRecognition
import name: speech_recognition
Updated requirements.txt, README, and voice setup docs accordingly.
Improved the log line in orchestrator.py so it spells out the correct install command.

How to install now (Pi)

# Preferred: build PyAudio from source with headers

sudo apt update && sudo apt install -y portaudio19-dev python3-dev

python3 -m pip install SpeechRecognition pyaudio

# If PyAudio build fails on your Pi OS:

sudo apt install -y python3-pyaudio

python3 -m pip install SpeechRecognition

  1. “pidog” folder confusing imports

What was wrong

Python sometimes shadowed or recursed when resolving pidog on different hosts.
It was unclear how to force a simulator vs use the real hardware lib.

What I changed

Hardened pidog shim:
Avoids self-import recursion and supports class name variants (“Pidog”, “PiDog”, etc.).
Uses the official hardware lib when installed on the Pi; otherwise falls back to the simulator.
Added an explicit simulator alias: pidog_sim
Guaranteed simulator regardless of environment.
Documented the environment switch HOUNDMIND_SIM=1 for forced simulation anywhere.
How to import now

On the robot (hardware): from pidog import Pidog
Force simulator explicitly: from pidog_sim import Pidog
Or force globally for a run:
Bash: HOUNDMIND_SIM=1 python3 -m packmind
PowerShell: $env:HOUNDMIND_SIM = “1”; python -m packmind

  1. canine_core not loading on the real dog

What was wrong

Running tools/scripts from tools changed sys.path so imports like canine_core or packmind failed on the Pi (ModuleNotFoundError).
This looked like “canine_core is missing” even though it’s in the repo.

What I changed

Added a repo-root bootstrap to key scripts so they work when executed directly:
caninecore_checkup.py
packmind_checkup.py
run_telemetry.py
pidog_hardware_check.py
plus other support tools
The bootstrap prepends the repo root to sys.path, making absolute imports (import canine_core / import packmind) resolve correctly from anywhere.

I’m sure I’ll find more issues when I do a clean install. The version of HoundMind currently running on my pidog has some differences to the repo. Testing experimental modules and tweaks. I’ll come up with that install guide and make sure the install and setup process isn’t broken.

Thanks for the feedback, and your patience. :slight_smile:

Quick update. I severely underestimated how difficult it would be to get HoundMind to even install on the pi3. This is further complicated by my pi3 not playing nice with the router at my new place, and my work schedule changing. I’m still working on it, but I have less time to throw at this for the time being.

For now, I’ve pushed an install guide and a guided installer, but have been unable to get either working on the pi3, and haven’t tested it on the pi4. I have some fixes in mind, but it’s involved so many compromises so far that I’m beginning to think the pi3 is unsuitable for this project. I’m also worried that I will break HoundMind for the pi4 if I continue modifying modules for backwards compatibility.

I highly recommend sticking to a pi4 or 5, but if anyone wishes to pursue the pi3, show me logs and I’ll do what I can to fix the install. If you don’t have a pi4, let me know. I might be willing to gift a pi4 board if someone is willing to commit to being the guinea pig.

I also have a ton of pi3 boards if anyone wants to bang their head against that particular wall. I believe a total rebuild of HoundMind for the pi3 will be required, but I’m willing, if someone wants to beta test for me. I just don’t enjoy testing on the pi3. She’s so stubborn.

Hi Seito, thanks for the update. I totally understand and also guess it is the right choice on your part to focus on 4 or 5. I am thinking about upgrading, therefore I appreciate the work you put into the pi3, but I guess it is better to focus on newer models. Please keep up the great work and let us know, when you tested a vanilla pi4/5 install for us to take a new look at. Best!