# \[ANN\] PetoiBittle.jl: control a Petoi Bittle robot dog from Julia

**URL:** <https://discourse.julialang.org/t/ann-petoibittle-jl-control-a-petoi-bittle-robot-dog-from-julia/137544>\
**Category:** Package Announcements\
**Created:** [June 10, 2026, 2:34pm UTC](https://discourse.julialang.org/t/ann-petoibittle-jl-control-a-petoi-bittle-robot-dog-from-julia/137544 "2026-06-10T14:34:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bvdmitri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bvdmitri/32/22935_2.png) [@bvdmitri](https://discourse.julialang.org/u/bvdmitri)\
**Post date:** [June 10, 2026, 2:34pm UTC](https://discourse.julialang.org/t/ann-petoibittle-jl-control-a-petoi-bittle-robot-dog-from-julia/137544/1 "2026-06-10T14:34:04Z")

</div>

Hi all,

I’d like to share a hobby project: **PetoiBittle.jl** , which connects to and controls a Petoi Bittle / OpenCat robot dog over a serial port. As far as I know it’s the first Julia-native library for this hardware.

The design goal was to get the speed of talking to the hardware directly together with a readable, beginner-friendly API:

- High-level verbs for the built-in skills (`walk_forward`, `trot_left`, `sit`, `stretch`, `greet`, `back_flip`, and more).
- Broad coverage: gaits, postures, behaviors, joint control, sound, and control/state commands (calibrate, gyro toggle, IMU readout).
- A low-level escape hatch (`RawCommand` / `RawQuery`) so any firmware token stays reachable.
- Zero allocation on the hot path; the verbs compile to the same code as the explicit commands.
- A transport seam so the whole test suite runs without hardware, checked with Aqua.jl and JET.jl.

A quick taste:

```julia-auto
using PetoiBittle

connection = PetoiBittle.connect(PetoiBittle.find_bittle_port())

PetoiBittle.stretch(connection)
PetoiBittle.walk_forward(connection)
PetoiBittle.trot_left(connection)

```

One example I’m especially happy with: a live GLMakie dashboard that runs real-time Bayesian inference of the IMU state with RxInfer.jl. It learns the per-axis sensor bias and noise during a calibration phase, then runs a calibrated and an uncalibrated pipeline side by side over the same live stream, so you can see the value of calibration directly. There’s a `--simulate` mode if you want to try it without the robot.

I’ll also be presenting this at **JuliaCon 2026** (“Embedding Julia on Petoi Bittle and Raspberry Pi,” Aug 14), showing an adaptive Kalman filter running autonomously on a Raspberry Pi.

Repo: [GitHub - bvdmitri/PetoiBittle.jl: A simple library to connect and control Robot Dog Bittle by Petoi · GitHub](https://github.com/bvdmitri/PetoiBittle.jl)  
Talk: [Embedding Julia on Petoi Bittle and Raspberry PI :: JuliaCon 2026 :: pretalx](https://pretalx.com/juliacon-2026/talk/ZJ3D8Q/)

Feedback and testing on real hardware very welcome. Thanks!
