Skip to content

This repository holds the code and configuration for the autonomous swarm robotics project in the CMU-MAIL lab

Notifications You must be signed in to change notification settings

gravesreid/autonomous-bittle

Repository files navigation

autonomous-bittle

This repository holds the code and configuration for the autonomous swarm robotics project in the CMU-MAIL lab

Set up raspberry pi

  1. Flash image using raspberry pi imager:
    • raspberry pi OS (Legacy) Lite Bullseye
  2. On first Power up:
    • Select Keyboard layout
    • set pi as username, select password
    • Log in
  3. Set up wifi:
    sudo raspi-config
    • Localisation Options
    • Set Timezone and WLAN Country
    • go to Advanced Options, set network config to use NetworkManager
    • go to system settings, enter wifi ssid and password
  4. Set auto login:
      1. S5 Boot / Auto Login
  5. Set up interface options
    • 3 Interface Options
    • Enable Legacy Camera support
    • Enable SSHago
    • I6 Serial port: Disable Login Shell, Enable Serial port hardware
    • Ensure one wire communication disabled
    • Enable remote GPIO pins
  6. Reboot
  7. Fix locale issues:
   sudo nano /etc/locale.gen

In file, uncomment line #en_US.UTF-8

sudo locale-gen

Set locale:

sudo update-locale LANG=en_US.UTF-8

Reboot

  1. Install necessary packages:
sudo apt-get update
sudo apt-get install git
git clone https://github.com/PetoiCamp/OpenCat.git
git clone https://github.com/gravesreid/autonomous-bittle.git
sudo apt-get install python3-opencv -y
sudo apt-get install pip
sudo apt-get install python3-tk
sudo apt install python3-serial
  1. Edit bash path:
sudo apt-get install vim -y
vim ~/.bashrc

at the end of the file add: export PATH=$PATH:/home/pi/.local/bin

If you have issues with accessing port ttyS0 (this disables bluetooth):

 sudo vim /boot/config.txt
  1. add: dtoverlay=disable-bt
  2. Enter to terminal:
sudo systemctl stop hciuart
sudo systemctl disable hciuart
sudo reboot

Set up virtual environment for python:

sudo apt-get install python3-virtualenv
mkdir project
cd project
python3 -m virtualenv env
source env/bin/activate

Connect to raspberry pi through ssh

  1. Hook the pi up to a monitor and type:
ifconfig
  1. note the ip address for the pi
  2. On your desktop terminal type:
ssh pi@[pi_ip_address]
  1. You will be prompted for the password for the pi. You can now disconnect the monitor from the pi

If you get error: WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

ssh-keygen -f "/home/[your_username]/.ssh/known_hosts" -R [ip.address]

Send commands to bittle through ardserial.py via ssh

cd ~/Opencat/serialMaster
python3 ardserial.py

Now you can enter commands through the terminal

Start video streaming from raspberry pi to desktop

  1. run ifconfig on your desktop terminal bash ifconfig
  2. enter the desktop ip address in both the sender.py and receiver.py scripts
  3. On the desktop, run
python3 receiver.py
  1. on the pi, run
python3 sender.py

Send files from one machine to another (1st part is file being copied)

scp /path/to/local/file username@remotehost:/path/to/remote/directory

Send entire directory from one machine to another

scp -r /path/to/local/directory username@remotehost:/path/to/remote/directory

Operate bittle to receive commands based on object recognition

  1. Set up two terminals with ssh to pi
  2. Open one terminal in bittle python environment on desktop
  3. On first bittle terminal run
   python3 ardSocket.py
  1. On desktop terminal run
python3 receiver.py
  1. On second bittle terminal run
python3 sender.py

About

This repository holds the code and configuration for the autonomous swarm robotics project in the CMU-MAIL lab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published