Skip to main content
raccoon-lib

raccoon-lib

The core robotics library powering RaccoonOS for Botball.

PID motion control · Kinematics · Odometry · Step-based missions · Python bindings

License: GPL v3 C++20 Python Raspberry Pi CI Latest Release

📖 Full documentation at raccoon-docs.pages.dev


raccoon-lib is the heart of RaccoonOS — a full robotics platform built for Botball competition. It gives your robot a solid foundation: reliable motion, clean sensor abstractions, and a step-based mission system that makes autonomous code readable and maintainable.

Built from years of competition experience at HTL St. Pölten, it's designed so that new teams don't have to start from zero.


What's Inside

Module What it does
Motion Control PID-controlled drive_forward, turn_right, strafe_left with feedforward compensation
Calibration Auto-tune feedforward (kS, kV, kA) and PID via relay-feedback — no guessing
Kinematics Differential and mecanum drivetrains — forward & inverse
Odometry Real-time position and heading from wheel encoders + IMU fusion
Step Framework seq(), parallel(), .until() — write missions like a readable recipe
Sensors & Actuators IR sensors, buttons, servos — clean, consistent API
Python Bindings Full Python API via pybind11 — same power, less boilerplate

Getting Started

raccoon-lib runs on the KIPR Wombat controller (Raspberry Pi, ARM64). Local installs without a mock platform are not supported — deploy directly to the Pi.

1. Clone

git clone https://github.com/htl-stp-ecer/raccoon-lib.git --recurse-submodules
cd raccoon-lib

2. Build & deploy to your Pi

python3 build.py                      # cross compiles for ARM64 in Docker -> builds/
python3 deploy.py --host <your-pi-ip> # installs the wheels on your Pi over SSH

No local toolchain setup needed, only Docker. build.py writes builds/raccoon_sim-0.0-…-linux_aarch64.whl (compiled runtime + simulator) and builds/raccoon_library-0.0-py3-none-any.whl (type stubs) with the same version. --version N sets the version (CI does this), --test also runs the C++ tests with qemu-user. deploy.py is for local builds and marks raccoon-lib as dev in the Pi's bundle file; releases are installed by raccoon update.

Starting a new robot project? Run the setup script of raccoon-template, see Getting Started. raccoon-cli's raccoon codegen then generates the hardware code from your project config.

Installing from PyPI

raccoon-lib ships as two coordinated distributions:

Command What you get Use it for
pip install raccoon-library Platform-independent Python/.pyi headers (py3-none-any). No compilation, no native code. IDE type hints, type-checking, and the raccoon-cli toolchain codegen. Does not run the robot on its own.
pip install "raccoon-library[sim]" The above plus the compiled raccoon-sim bindings + simulator + mock/wombat runtime bundle. Actually running missions in the simulator, or on the Pi/Wombat.

The [sim] extra pulls in raccoon-sim, pinned to the exact same version, so the headers and the native bindings can never drift apart. import raccoon requires [sim] (or a locally deployed raccoon-sim wheel — see deploy.py above).


How It Works

You write missions. raccoon-lib handles the math.

Missions are Python classes with a sequence() method — describe what the robot does step by step:

from raccoon import *

class M01NavigateToZone(Mission):
    def sequence(self) -> Sequential:
        return seq([
            mark_heading_reference(),       # lock current heading as 0°

            parallel(
                drive_forward(cm=40),       # drive while lowering arm
                seq([
                    wait_until_distance(7),
                    servo(Defs.arm_servo, 90),
                ]),
            ),

            turn_right(degrees=90),

            # drive until both IR sensors see black tape
            drive_forward().until(
                on_black(Defs.front.left) & on_black(Defs.front.right)
            ),

            drive_backward(cm=3),
        ])

The robot hardware config (motors, sensors, PID gains) lives in the project's raccoon.project.yml, and raccoon-cli generates Defs and the robot class from it.


Architecture

raccoon-lib Architecture

Requirements

  • CMake >= 3.15
  • C++20 compatible compiler
  • Python >= 3.11
  • Docker (for ARM64 cross-compilation)

C++ dependencies: Eigen3 3.4.0 · spdlog 1.14.1 · pybind11 2.13.6 · raccoon-transport Python dependencies: pyyaml · aiosqlite · numpy · raccoon-transport


Testing

# C++ tests
cmake -B build -DBUILD_TESTING=ON
cmake --build build
ctest --test-dir build

# Python tests
pytest tests/

Contributing

See CONTRIBUTING.md for how to add modules, steps, run tests, and follow code style.


License

Copyright (C) 2026 Tobias Madlberger Licensed under the GNU General Public License v3.0 — see LICENSE for details.

Metadata

Release files for raccoon-sim 162

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for raccoon-sim 162
File Actions
raccoon_sim-162-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for raccoon_sim-162-cp313-cp313-win_amd64.whl
raccoon_sim-162-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for raccoon_sim-162-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
raccoon_sim-162-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 Details for raccoon_sim-162-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
raccoon_sim-162-cp313-cp313-macosx_14_0_universal2.whl CPython 3.13 CPython 3.13 macOS 14.0+ universal2 (ARM64, x86-64) Details for raccoon_sim-162-cp313-cp313-macosx_14_0_universal2.whl

Total release size: 28.4 MB

Release files / raccoon_sim-162-cp313-cp313-win_amd64.whl

Download URL raccoon_sim-162-cp313-cp313-win_amd64.whl
Size 5.8 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
f4417f80fd8cba328beab6935c2c7cc212d63301d6e68dcd47131b26ad025625
BLAKE2b-256 checksum
How to use checksums
59043467080eae6bd32ee5110e6550e8a2595e55f2a1f8c3f1c90046470d32ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / raccoon_sim-162-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL raccoon_sim-162-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 7.0 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
bfd01077133bb67713ca63aa19cc70867ed8c984ffab1a28f6e413eefa874244
BLAKE2b-256 checksum
How to use checksums
09a4881908f18657767f7a9e532609d8d419a637352d7e2cd1600a5ba50c31df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / raccoon_sim-162-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL raccoon_sim-162-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 6.6 MB
Tags CPython 3.13 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
e541b04876f016f745dfb1bb554c2e9f5c1fc8b4ee35f3fd08c93518ce94d36f
BLAKE2b-256 checksum
How to use checksums
d2f8aa364856b9192ce8c75a4666c67d7e822c3ac93dd3e85b0f09f18f74a3ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / raccoon_sim-162-cp313-cp313-macosx_14_0_universal2.whl

Download URL raccoon_sim-162-cp313-cp313-macosx_14_0_universal2.whl
Size 9.0 MB
Tags CPython 3.13 macOS 14.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
34f00f5ae485fb21a38b252cf770a206c10cb885fb22e5deb2f6ee3bd8486e91
BLAKE2b-256 checksum
How to use checksums
c7e7542ebdf84f99e98b97ca659a4aab55fcb8e8240fbf1e4b24d26ebe3a2c3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for raccoon-sim 162

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for raccoon_sim-162-cp313-cp313-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page