#real-time #middleware #copper #raspberry-pi

app cu-rp-balancebot

This is a full robot example for the Copper project. It runs on the Raspberry Pi with the balance bot hat to balance a rod.

6 releases

new 0.5.2 Dec 9, 2024
0.5.1 Dec 5, 2024
0.4.1 Nov 15, 2024
0.4.0 Oct 29, 2024
0.3.1 Oct 12, 2024

#267 in Robotics

Download history 206/week @ 2024-10-10 14/week @ 2024-10-17 123/week @ 2024-10-24 39/week @ 2024-10-31 13/week @ 2024-11-07 119/week @ 2024-11-14 12/week @ 2024-11-21 142/week @ 2024-11-28 296/week @ 2024-12-05

570 downloads per month

Apache-2.0 and maybe GPL-3.0-only

3.5MB
6K SLoC

BalanceBot: this is a full Copper demo robot

with:

  • a physical robot implementation
  • a simulation implementation
  • a resimulation demoing the deterministic replay
  • a log export

To run the simulation

$ cd examples/cu_rp_balancebot
$ cargo run --release 

See the UI help for the navigation.

To debug the game engine side you can add a perf overlay with:

$ cargo run --release --features perf-ui

To run the resimulation

(you need at least a log in logs for example from a simulation run).

$ cd examples/cu_rp_balancebot
$ cargo run --bin balancebot_resim --release

It will recreate the logs from only the inputs of the previous run in logs/balancebot_resim*.copper.

To run on the real robot

You will need to cross compile for Arm:

cargo build --target armv7-unknown-linux-musleabihf --release --no-default-features

Be sure you save your log string index:

cp -rv ../../target/armv7-unknown-linux-musleabihf/release/cu29_log_index .  # or anywhere you want

Deploy on the target:

scp ../../target/armv7-unknown-linux-musleabihf/release/balancebot copperconfig.ron copper7:copper/  # change to match your target

To export logs

$ cd examples/cu_rp_balancebot
$ cargo run --bin balancebot-logreader --release

Dependencies

~28–80MB
~1.5M SLoC