Coder Social home page Coder Social logo

autonomous-bittle's Introduction

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

autonomous-bittle's People

Contributors

gravesreid avatar

Stargazers

Kai Zhen Mai avatar Ken Chang avatar Akshay Badagabettu avatar Rongzhong Li avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.