Skip to content

Bielousov/robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a PI AI Robot

v1 (historic)

This version has been running on Arduino Nano (C), it use onboard neural network that accepted a pre-trained model to make simple decisions (i.e. blink, wonder eyes).

v2 (depricated)

The v1 has been ported to python and runs on Raspberry/Orange/Banana PI m2 Zero. It also runs the on-board neural network (ported the same C library from v1), but it now checks if a model exists on start, and if not, trains a new model up to a threshold. Then the model accuracy, inactivity on sensors and even CPU temp were used as input paramters for the decision model, that besides making same simple decisions as v1, also occasionally ran another training epoch.

v3 (2025)

Moving away from (a bit useless and fragile) decision making model towards network connected assistant. Now robot connects to a remote ChatGPT 4 model. It will use pvrecorder/pvcobra/pvleopard stack to catch voice commands, process them and generate the voice reposnse with OpenAI API.

The eyes now would only rely on the state to indicate:

  • idle state
  • detecting prompt
  • listening and parsing
  • requesting API model

Dependencies

  1. sudo apt install python3-pip python3-dev
  2. sudo apt install libjpeg-dev zlib1g-dev
  3. sudo apt install rpi.gpio-common
  4. pip install --upgrade pip setuptools
  5. pip install python-dotenv
  6. pip install numpy
  7. pip install spidev
  8. pip install luma.core
  9. pip install luma.led_matrix
  10. pip install OPi.GPIO
  11. pip install openai

SPI and GPIO Permissions

  1. sudo apt install rpi.gpio-common
  2. sudo nano /boot/armbianEnv.txt

    overlays=spi-spidev param_spidev_spi_bus=0

  3. sudo groupadd spi
  4. sudo usermod -aG spi pi
  5. sudo usermod -aG dialout pi
  6. sudo nano /etc/udev/rules.d/99-spi-permissions.rules

    SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"

  7. sudo udevadm control --reload-rules
  8. sudo reboot

Autostart Daemon

  1. sudo cp ./bin/robot.service /etc/systemd/system/robot.service
  2. sudo systemctl daemon-reload
  3. sudo systemctl enable robot.service
  4. sudo systemctl status robot.service
  5. sudo systemctl restart robot.service

Git Performance on board

  • Enable git parallel index preload: git config --global core.preloadindex true
  • Minimize the number of files in .git folder: git config --global gc.auto 256
  • Run git garbage collector: git gc
  • Remove untracked files git clean -xf. Use git clean -xfn for a dry-run to check that everything is ok.

About

RaspberryPI AI Robot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published