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 :
Tip: I configure the rasp to connect to my phone's hotspot, this way I can connect to it from anywhere.
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.
sudo apt update
sudo apt upgrade
sudo apt install git
sudo apt install python3-pip
sudo apt install python3-virtualenvwrapper
(optional) sudo apt install python3-picamzero
Add this to the end of the .bashrc
:
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
sudo raspi-config
-> Interface Options
-> I2C
TODO set 400KHz ?
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"
TODO
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 mini_bdx_runtime/mini_bdx_runtime/xbox_controller.py
Follow this tutorial
For now, don't activate
/dev/zero
when they ask
https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp?view=all
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 .
python3 mini_bdx_runtime/mini_bdx_runtime/raw_imu.py
You can also run python3 scripts/imu_server.py
on the robot and python3 scripts/imu_client.py --ip <robot_ip>
on your computer to check that the frame is oriented correctly.
To find the ip address of the robot, run
ifconfig
on the robot
This will allow you to verify all your motors are connected and configured.
python3 scripts/check_motors.py
Copy example_config.json
in the home directory of your duck and rename it duck_config.json
.
cp example_config.json ~/duck_config.json
In this file, you can configure some stuff, like registering if you installed the expression features, installed the imu upside down or and other stuff. You also write the joints offsets of your duck here
This script will guide you through finding the joints offsets of your robot that you can then write in your duck_config.json
This procedure won't be necessary in the future as we will be flashing the offsets directly in each motor's eeprom.
cd scripts/
python find_soft_offsets.py
Download the latest policy checkpoint and copy it to your duck.
cd scripts/
python v2_rl_walk_mujoco.py --onnx_model_path <path_to>/BEST_WALK_ONNX_2.onnx
- The commands are :
- A to pause/unpause
- X to turn on/off the projector
- B to play a random sound
- Y to turn on/off head control (very experimental, I don't recommend trying that, it can break your duck's head)
- left and right triggers to control the left and right antennas
- LB (new!) press and hold to increase the walking frequency, kind of a sprint mode 🙂