Skip to content

This is a project to create a micro mouse using a Raspberry Pi 5 and an omni wheel and compete in a micro mouse competition.

License

Notifications You must be signed in to change notification settings

horie-t/omni-mouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OmniMouse

This is a project to create a micro mouse using a Raspberry Pi 5 and an omni wheel and compete in a micro mouse competition.

Raspberry Pi 5とオムニホイールを使ったマイクロマウスを制作し、マイクロマウス大会(クラシックサイズ競技)に出場するプロジェクトです。

文書

  1. Raspberry Pi 5をヘッドレスでセットアップ

ハードウェア制作

ハードウェアの設計はFreeCADで行っています。設計データはhardware ディレクトリの .FCStd ファイルです。

3Dプリンタで hardware ディレクトリの .stl ファイルを使って3Dプリンティングしてください。

電装系

こちら のように各種部品を接続してください。回路図はFritzingを使用して書いています。

Raspberry Pi 5 セットアップ

OSのインストール

Raspberry Pi 5をヘッドレスでセットアップを参照してください。

EEPROMの設定変更

起動後に以下の警告が表示されます。

This power supply is not capable of supplying 5A

Power to peripherals will be restricted

以下のコマンドを実行して、電源の電流供給能力が5Aあるとみなすようにさせます。

sudo rpi-eeprom-config -e

コマンドの編集画面で以下の行を追加します。

PSU_MAX_CURRENT=5000

SPI1デバイスの有効化

/boot/firmware/config.txt ファイルを編集します。

sudo vi /boot/firmware/config.txt

dtparam=spi=on をアンコメントして、SPI1の定義を追加します。

# 前略
# 以下をアンコメントします。
dtparam=spi=on
# 中略
# 最後を以下のようにします。
[all]
dtoverlay=spi1-3cs,cs1_pin=27

Picamera2をシステムのPython環境に依存せずに使うための準備

Pythonのパッケージをシステムにインストールしているが、目的はPythonのパッケージが依存しているdebパッケージをインストールする事である。

sudo apt install -y python3-libcamera python3-kms++ libcap-dev
sudo apt install -y python3-prctl libatlas-base-dev ffmpeg python3-pip
sudo apt install -y python3-pyqt5 python3-opengl

sudo apt install -y libcap-dev libatlas-base-dev libopenjp2-7
sudo apt install -y libkms++-dev libfmt-dev libdrm-dev
sudo apt install -y libcamera-dev

ソフトウェア実行環境構築

  1. Raspberry Pi上で、このリポジトリを git clone してください。
    [email protected]:horie-t/omni-mouse.git
    cd omni-mouse
  2. uvをインストールしてください。
    curl -LsSf https://astral.sh/uv/install.sh | sh
  3. パッケージをインストールしてください。
    uv sync
  4. 仮想環境をアクティベートしてください。
    source .venv/bin/activate

実行

まだ、Rayのサンプルプログラムが起動するだけです。

uv rum -m omni-mouse

実験的実装

キーボードの入力テスト

uv run python src/omni_mouse/experiment/keyinput.py

ディレクトリ構成

主なディレクトリ

.
├── docs                # 説明用の文書
├── electrical_system   # 電装系設計データ
├── hardware            # ハードウェア設計データ
└── src                 # ソースコード

About

This is a project to create a micro mouse using a Raspberry Pi 5 and an omni wheel and compete in a micro mouse competition.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages