Skip to content

apirrone/Open_Duck_Mini_Runtime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Duck Mini Runtime

TODO : Write a description

Raspberry Pi zero 2W setup

Install Raspberry Pi OS

Download Raspberry Pi OS Lite (64-bit) from here : https://www.raspberrypi.com/software/operating-systems/

Follow the instructions here to install the OS on the SD card : https://www.raspberrypi.com/documentation/computers/getting-started.html

With the Raspberry Pi Imager, you can pre-configure session, wifi and ssh. Do it like below :

imager_setup

Tip: I configure the rasp to connect to my phone's hotspot, this way I can connect to it from anywhere.

Setup SSH (If not setup during the installation)

When first booting on the rasp, you will need to connect a screen and a keyboard. The first thing you should do is connect to a wifi network and enable SSH.

To do so, you can follow this guide : https://www.raspberrypi.com/documentation/computers/configuration.html#setting-up-wifi

Then, you can connect to your rasp using SSH without having to plug a screen and a keyboard.

Update the system and install necessary stuff

sudo apt update
sudo apt upgrade
sudo apt install git
sudo apt install python3-pip
sudo apt install python3-virtualenvwrapper

Add this to the end of the .bashrc:

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh

Enable I2C

sudo raspi-config -> Interface Options -> I2C

TODO set 400KHz ?

Set the usbserial latency timer

cd  /etc/udev/rules.d/
sudo touch 99-usb-serial.rules
sudo nano 99-usb-serial.rules
# copy the following line in the file
SUBSYSTEM=="usb-serial", DRIVER=="ftdi_sio", ATTR{latency_timer}="1"

Set the udev rules for the motor control board

TODO

Setup xbox one controller over bluetooth

Turn your xbox one controller on and set it in pairing mode by long pressing the sync button on the top of the controller.

Run the following commands on the rasp :

bluetoothctl
scan on

Wait for the controller to appear in the list, then run :

pair <controller_mac_address>
trust <controller_mac_address>
connect <controller_mac_address>

The led on the controller should stop blinking and stay on.

You can test that it's working by running

python3 scripts/test_xbox_controller.py

Install the runtime

Make a virtual environment and activate it

mkvirtualenv -p python3 open-duck-mini-runtime
workon open-duck-mini-runtime

Clone this repository on your rasp, cd into the repo, then :

git clone https://github.com/apirrone/Open_Duck_Mini_Runtime
cd Open_Duck_Mini_Runtime
git checkout v2
pip install -e .

Test the IMU

cd scripts/
python imu_test.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages