Skip to content
Open

Main #33

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
8a73ea4
raw imu
apirrone Mar 6, 2025
8faaf11
raw imu
apirrone Mar 6, 2025
75f2f4e
raw imu
apirrone Mar 6, 2025
b587f05
raw imu
apirrone Mar 6, 2025
a59c672
storing and restoring calibration data, using axis remap and using ra…
apirrone Mar 6, 2025
f28830e
yaw range
apirrone Mar 6, 2025
76faa23
standing policy
apirrone Mar 7, 2025
7056639
standing policy
apirrone Mar 7, 2025
4035e67
head
apirrone Mar 7, 2025
ea52d93
fixing stupid head bug
apirrone Mar 7, 2025
5d74325
update
apirrone Mar 7, 2025
9e76883
update
apirrone Mar 7, 2025
a5182f9
removing standing mode
apirrone Mar 7, 2025
403373f
tare_x
apirrone Mar 7, 2025
756c470
update
apirrone Mar 7, 2025
dc73c57
Merge branch 'v2' of github.com:apirrone/Open_Duck_Mini_Runtime into v2
apirrone Mar 7, 2025
04c5ac6
update
apirrone Mar 7, 2025
cc2eb9b
Merge branch 'v2' of github.com:apirrone/Open_Duck_Mini_Runtime into v2
apirrone Mar 7, 2025
8b7ccaa
head control mode in xbox gamepad
apirrone Mar 8, 2025
ba831fc
action filter
apirrone Mar 9, 2025
d530b05
sounds
apirrone Mar 10, 2025
71347b1
sounds
apirrone Mar 10, 2025
2eab085
sounds
apirrone Mar 10, 2025
a3666d8
sounds
apirrone Mar 10, 2025
d2e7bfa
sounds
apirrone Mar 10, 2025
511063e
sounds
apirrone Mar 10, 2025
868e1fe
sounds
apirrone Mar 10, 2025
5e930a2
update
apirrone Mar 10, 2025
1b415c1
update
apirrone Mar 10, 2025
20f8135
sounds
apirrone Mar 11, 2025
0c8c880
fix controller
apirrone Mar 11, 2025
ad35984
new poly coeffs
apirrone Mar 11, 2025
4682eaf
upside down imu option
apirrone Mar 17, 2025
da13a0d
upside down imu option
apirrone Mar 17, 2025
60ecfbd
upside down imu option
apirrone Mar 17, 2025
f8751e2
upside down imu option
apirrone Mar 17, 2025
53ae7e8
upside down imu option
apirrone Mar 17, 2025
1bc8ba2
update
apirrone Mar 17, 2025
cdfb571
cleaning up
apirrone Mar 17, 2025
63e137e
cleaning up
apirrone Mar 17, 2025
c8cdca5
cleaning up
apirrone Mar 17, 2025
47e21b5
cleaning up
apirrone Mar 17, 2025
7f5b875
cleaning up
apirrone Mar 17, 2025
17e2a59
cleaning up
apirrone Mar 17, 2025
032a351
cleaning up
apirrone Mar 17, 2025
2c9e9a4
Merge pull request #1 from apirrone/cleaning_up
apirrone Mar 17, 2025
c0f16e0
new poly
apirrone Mar 17, 2025
e499a95
Merge branch 'v2' of github.com:apirrone/mini_BDX_runtime into v2
apirrone Mar 17, 2025
88864d4
Update README.md
apirrone Mar 17, 2025
61e9427
Update README.md
apirrone Mar 17, 2025
b936eef
test schedule
apirrone Mar 18, 2025
b2440d4
git Merge branch 'v2' of github.com:apirrone/mini_BDX_runtime into v2
apirrone Mar 18, 2025
d803dc7
record data and plot
apirrone Mar 18, 2025
f74f376
update
apirrone Mar 18, 2025
f28a3ad
projector
apirrone Mar 20, 2025
8b35524
record
apirrone Mar 20, 2025
121d0df
Merge branch 'v2' of github.com:apirrone/mini_BDX_runtime into v2
apirrone Mar 20, 2025
adaf09c
record
apirrone Mar 20, 2025
7564c3a
configure_motors.py
apirrone Mar 20, 2025
b568d2d
configure_motors.py
apirrone Mar 20, 2025
106798f
configure_motors.py
apirrone Mar 20, 2025
c757474
configure_motors.py
apirrone Mar 20, 2025
494f12c
Create checklist.md
apirrone Mar 23, 2025
d56c355
Update checklist.md
apirrone Mar 23, 2025
a6bd065
new
apirrone Mar 24, 2025
fb39aac
new
apirrone Mar 24, 2025
a62b92a
working
apirrone Mar 24, 2025
bb506f9
update
apirrone Mar 24, 2025
e36bfcd
trying without ref in obs
apirrone Mar 24, 2025
ba6f6b4
Merge branch 'new' into v2
apirrone Mar 24, 2025
154754d
cleaning up, adding check_voltage again
apirrone Mar 24, 2025
580dc13
cleaning up
apirrone Mar 24, 2025
087bb27
cleaning up
apirrone Mar 24, 2025
cb28c50
Update README.md
apirrone Mar 24, 2025
edeebf4
Fix the configure script.
Clancey Apr 4, 2025
bd69055
Merge pull request #4 from Clancey/v2
apirrone Apr 6, 2025
0bcc715
plot recorded data
apirrone Apr 6, 2025
57752fa
Merge branch 'v2' of github.com:apirrone/mini_BDX_runtime into v2
apirrone Apr 6, 2025
84dd78a
cleaning up, fixing readme, adding infos
apirrone Apr 6, 2025
e556486
handling missing sounds better
apirrone Apr 6, 2025
340fb10
making saving obs (for debug) optional with an argument
apirrone Apr 6, 2025
415b7b1
configure motors
apirrone Apr 6, 2025
0d2a45f
cleaning up
apirrone Apr 6, 2025
a875b7c
cleaning up
apirrone Apr 6, 2025
6faec97
head mix
apirrone Apr 7, 2025
c6b769a
head mix
apirrone Apr 7, 2025
af8d983
head mix
apirrone Apr 7, 2025
c04594b
head mix
apirrone Apr 7, 2025
2817727
head mix
apirrone Apr 7, 2025
785b142
gpt 4o test
apirrone Apr 7, 2025
b22d632
update
apirrone Apr 8, 2025
3f90df0
gpt 4o test
apirrone Apr 8, 2025
571f24c
working !
apirrone Apr 8, 2025
9755c43
offsets
apirrone Apr 8, 2025
cbcaa4a
fun :)
apirrone Apr 8, 2025
2361f2a
readme
apirrone Apr 8, 2025
6b6e726
aze
apirrone Apr 9, 2025
8b97310
better handling button inputs
apirrone Apr 9, 2025
499ff93
readme
apirrone Apr 9, 2025
595cac4
changing default arguments of v2_rl_walk_mujoco.py to be more straigh…
apirrone Apr 9, 2025
0b86d8c
dpad
apirrone Apr 9, 2025
54a5c92
dpad
apirrone Apr 9, 2025
5580ee3
dpad
apirrone Apr 9, 2025
3189db5
head pitch range
apirrone Apr 9, 2025
2bb27f1
low head kp
apirrone Apr 9, 2025
b3cb137
low head kp
apirrone Apr 9, 2025
da28d0b
test
apirrone Apr 9, 2025
054e08b
test
apirrone Apr 9, 2025
2313920
Merge branch 'test' of github.com:apirrone/mini_BDX_runtime into test
apirrone Apr 9, 2025
6e1881b
test
apirrone Apr 9, 2025
8aa4b15
- Added config file support to v2_rl_walk_mujoco.py
Codezombie23 Apr 9, 2025
335387f
- Adding example_config.json
Codezombie23 Apr 9, 2025
135ec39
improving default parameters, adding sound assets
apirrone Apr 19, 2025
6eda674
[WIP] adding a duck_config class and changing a little the structure …
apirrone Apr 19, 2025
08c7867
[WIP] propagating and cleaning stuff
apirrone Apr 19, 2025
64765b6
[WIP] propagating and cleaning stuff
apirrone Apr 19, 2025
ae63802
aaa
apirrone Apr 19, 2025
eea2d14
aaa
apirrone Apr 19, 2025
21b4ce8
readme
apirrone Apr 19, 2025
55abf4f
adding warning and input confirmation for running without a config
apirrone Apr 19, 2025
b129c86
Merge pull request #5 from Codezombie23/v2
apirrone Apr 19, 2025
3291025
stopping antennas when exitting walk script
apirrone Apr 19, 2025
6f101bd
stopping antennas when exitting walk script
apirrone Apr 19, 2025
814be2e
simplifying xbox
apirrone Apr 19, 2025
5249923
simplifying xbox
apirrone Apr 19, 2025
c1876c5
Merge pull request #15 from apirrone/14-integrate-buttons-into-xboxco…
apirrone Apr 19, 2025
f93cad6
Update find_soft_offsets.py
chrisheninger Apr 20, 2025
9f77aef
Add a check_motor.py so you can see what motors are working.
Clancey Apr 24, 2025
2a49734
Update README.md
Clancey Apr 24, 2025
5a0764b
Merge pull request #16 from chrisheninger/patch-1
apirrone Apr 25, 2025
f99abfc
Merge pull request #18 from Clancey/v2
apirrone Apr 25, 2025
5a8b057
antennas test
apirrone May 5, 2025
34c60ef
antennas test
apirrone May 5, 2025
6b6da79
record data
apirrone May 13, 2025
f9af98f
feat: GPIO compatible
mumuhhh May 10, 2025
819a87f
test
apirrone Jun 16, 2025
489da82
add configure_all_motors.py
apirrone Jun 24, 2025
3203734
Merge pull request #23 from mumuhhh/v2_gpio
apirrone Jun 24, 2025
cd64082
Add project files
yitingHH-bit Dec 4, 2025
ffd4936
Update README.md
yitingHH-bit Dec 4, 2025
29e9168
Update README.md
yitingHH-bit Dec 4, 2025
ecced2e
Update README.md
yitingHH-bit Dec 4, 2025
d958745
Update README.md
yitingHH-bit Dec 4, 2025
06ab185
Add files via upload
yitingHH-bit Dec 4, 2025
e24ccb7
Update README.md
yitingHH-bit Dec 5, 2025
6ef759b
Update README.md
yitingHH-bit Dec 5, 2025
e88fce0
Update README.md
yitingHH-bit Dec 5, 2025
7a4b250
Update README.md formatting and content
yitingHH-bit Dec 5, 2025
59c8aca
Update README with project details and features
yitingHH-bit Dec 5, 2025
2cb03d6
Update README.md
yitingHH-bit Dec 5, 2025
95894bc
Update README.md
yitingHH-bit Dec 5, 2025
243edc8
Update README.md
yitingHH-bit Dec 9, 2025
8514a85
Update README.md
yitingHH-bit Dec 17, 2025
d078abe
Update README.md
yitingHH-bit Dec 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
__pycache__/
mini_bdx_runtime.egg-info/
mini_bdx_runtime.egg-info/
build
dist
Empty file added =
Empty file.
Empty file added =1.18.1
Empty file.
Empty file added =2.1,
Empty file.
Empty file added Adding
Empty file.
Binary file added BOM Open Duck Mini V2_improvement.xlsx
Binary file not shown.
Empty file added Current
Empty file.
Binary file added Estimated_screws_inserts.docx
Binary file not shown.
Empty file added Memory
Empty file.
Empty file added Python_
Empty file.
212 changes: 74 additions & 138 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,138 +1,74 @@
# 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](https://github.com/user-attachments/assets/7a4987b2-de83-41dd-ab7f-585259685f16)

> 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

```bash
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`:

```bash
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

```bash
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 :

```bash
bluetoothctl
scan on
```

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

```bash
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

```bash
python3 scripts/test_xbox_controller.py
```

## Speaker wiring and configuration
Follow this tutorial

https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp?view=all


## Install the runtime

### Make a virtual environment and activate it

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

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

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


## Test the IMU

```bash
cd scripts/
python imu_test.py
```

## Find the joints offsets

This script will guide you through finding the joints offsets of your robot, that you can then write in `hwi_feetech_pwm_control.py` in `self.joints_offsets`

> This procedure won't be necessary in the future as we will be flashing the offsets directly in each motor's eeprom.

```bash
cd scripts/
python find_soft_offsets.py
```


# TODO
- [] rustypot python bindings install from wheels (see with Pierre)
# 🦆 Open Duck Mini Runtime

This repository contains the **Open Duck Mini Runtime** — a lightweight and modular runtime environment for small-scale biped/quadruped robot control and reinforcement learning deployment. Currently, the project is about 90% complete and under active development.

---

# 🦆 student project/replica project (studying savonia UAS )

| Role | Name | Responsibility |
|------|------|----------------|

| **Supervisor** | **Markku K. ** | Academic supervision and technical guidance |
| **Group Manager** | **Jiancai H** | System integration, reinforcement learning runtime, documentation |
| **Software Developer** | **Danila M.** | Python runtime logic, controller scripts, communication modules |
| **Hardware Assembler** | **Agozie J O.** | Physical robot setup

## 🎥 Demo Videos

| Preview | Description |
|--------|-------------|
| [▶️ Watch on YouTube](https://youtu.be/HA8A6kagsS8) | Extended walking demo (full video) |

---

## display

<p align="center">
<img src="https://github.com/user-attachments/assets/e5ea921e-6d63-4b25-a0d6-3734242110c2" width="75%" alt="Duck Mini Runtime UI Screenshot"/>
</p>

---

## 🧩 Key Features

- Modular runtime scripts for **Unitree-based robots**
- Cross-platform Python support (Jetson / Raspberry Pi / PC)
- Supports **ONNX** inference for walking controllers
- Easy parameter customization via `duck_config.json`
- Self-test and diagnostic scripts (`mini_bdx_selftest.py`)

## 🧩 the issues we are encountering


blance

---

## hard ware part
<img width="1897" height="880" alt="image" src="https://github.com/user-attachments/assets/86a23cfe-6d99-4a03-88d7-7d5d68d2276a" />
<img width="790" height="495" alt="image" src="https://github.com/user-attachments/assets/1a911248-7f5c-4aba-b3bd-05f14d650cd0" />


## 🚀 Quick Start

```bash
git clone https://github.com/yitingHH-bit/Open_Duck_Mini_Runtime.git
cd Open_Duck_Mini_Runtime
python scripts/v2_rl_walk_mujoco.py


From the DataSheet @ https://www.ti.com/product/TLVM13610?keyMatch=tlvm13610rdfr&tisearch=universal_search and the circuit can be found here https://www.ti.com/lit/ds/symlink/tlvm13610.pdf?ts=1762995465366.













3 changes: 3 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [] Better handle xbox controller
- It's a little bit of a mess right now, how we handle directions and buttons etc
- [] Make the offsets flashing work. This will be in the motor configuration script
15 changes: 15 additions & 0 deletions checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Checklist

To check that all works and is properly configured before running a policy.

TODO (Antoine)
Make a script that goes through all this automatically
- joints positions and offsets
- imu orientation
- feet switches

make optional
- eyes/projector
- antennas
- speaker
- camera
4 changes: 4 additions & 0 deletions constraints-pi-aarch64-py313.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
numpy==2.2.6
scipy==1.15.1
onnxruntime==1.23.2
pygame==2.6.1
29 changes: 29 additions & 0 deletions duck_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"start_paused": false,
"imu_upside_down": true,
"phase_frequency_factor_offset": 0.0,
"expression_features": {
"eyes": false,
"projector": false,
"antennas": false,
"speaker": false,
"microphone": false,
"camera": false
},
"joints_offsets": {
"left_hip_yaw": 1.413,
"left_hip_roll": -1.007,
"left_hip_pitch": -2.833,
"left_knee": -0.703,
"left_ankle": 2.344,
"neck_pitch": -53.03,
"head_pitch": 2.102,
"head_yaw": -0.063,
"head_roll": 1.767,
"right_hip_yaw": 1.281,
"right_hip_roll": -2.381,
"right_hip_pitch": -0.545,
"right_knee": 0.497,
"right_ankle": 4.226
}
}
29 changes: 29 additions & 0 deletions example_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"start_paused": false,
"imu_upside_down": false,
"phase_frequency_factor_offset": 0.0,
"expression_features": {
"eyes": false,
"projector": false,
"antennas": false,
"speaker": false,
"microphone": false,
"camera": false
},
"joints_offsets": {
"left_hip_yaw": 0.0,
"left_hip_roll": 0.0,
"left_hip_pitch": 0.0,
"left_knee": 0.0,
"left_ankle": 0.0,
"neck_pitch": 0.0,
"head_pitch": 0.0,
"head_yaw": 0.0,
"head_roll": 0.00,
"right_hip_yaw": 0.0,
"right_hip_roll": 0.0,
"right_hip_pitch": 0.0,
"right_knee": 0.0,
"right_ankle": 0.0
}
}
Loading