Skip to main content

Raccoon robotics library (formerly libstp)

Project description

RaccoonLib

RaccoonLib

The core robotics library powering RaccoonOS for Botball.

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

Build & Release Latest Release License: GPL v3 C++20 Python Raspberry Pi Platform

📖 Full documentation at raccoon-docs.pages.dev


RaccoonLib 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, drive_strafe 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

RaccoonLib 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 in one step

RPI_HOST=<your-pi-ip> bash deploy.sh

This cross-compiles for ARM64 via Docker and installs the wheel on your Pi over SSH. No local toolchain setup needed.

Variable Default Description
RPI_HOST (required) Raspberry Pi IP address
RPI_USER pi SSH username
RPI_DIR /home/pi/python-libs Install directory
BUILD_TYPE Release CMake build type

Starting a new robot project? Use raccoon-cliraccoon create project MyRobot runs a hardware wizard and generates your robot config, project structure, and deploy scripts automatically.


How It Works

You write missions. RaccoonLib handles the math.

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

from libstp 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),
                    Defs.arm_servo.hold(),
                ]),
            ),

            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) is generated by raccoon-cli's hardware wizard — see raccoon-example for a fully commented reference.


Architecture

RaccoonLib Architecture

Requirements

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

C++ dependencies: Eigen3 3.4.0 · LCM 1.5.0 · spdlog 1.14.1 · pybind11 2.13.6
Python dependencies: pyyaml · aiosqlite


Testing

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

# Python tests
pytest tests/

Part of RaccoonOS

RaccoonLib is one piece of the full platform:

Repository What it is
raccoon-cli Dev toolchain — scaffolding, hardware wizard, raccoon run
raccoon-example Reference robot — start here if you're new
raccoon-transport LCM messaging layer (C++, Python, Dart)
documentation Full platform docs

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

raccoon_library-1.0.79-cp313-cp313-win_amd64.whl (5.6 MB view details)

Uploaded CPython 3.13Windows x86-64

raccoon_library-1.0.79-cp313-cp313-manylinux_2_28_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

raccoon_library-1.0.79-cp313-cp313-macosx_11_0_universal2.whl (9.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ universal2 (ARM64, x86-64)

raccoon_library-1.0.79-cp312-cp312-win_amd64.whl (5.6 MB view details)

Uploaded CPython 3.12Windows x86-64

raccoon_library-1.0.79-cp312-cp312-manylinux_2_28_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

raccoon_library-1.0.79-cp312-cp312-macosx_11_0_universal2.whl (9.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ universal2 (ARM64, x86-64)

raccoon_library-1.0.79-cp311-cp311-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.11Windows x86-64

raccoon_library-1.0.79-cp311-cp311-manylinux_2_28_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

raccoon_library-1.0.79-cp311-cp311-macosx_11_0_universal2.whl (9.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file raccoon_library-1.0.79-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.79-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7b514933f1966b28ce8ae73a46ce97d08eaff032934b87d7d49a672b36f60122
MD5 0456ec055f8ad78591a008e8a4de6cd2
BLAKE2b-256 956f515a861544337ebc4079c2c06fba8460268e7deb41bd81b1a8401f023b47

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.79-cp313-cp313-win_amd64.whl:

Publisher: ci.yml on htl-stp-ecer/raccoon-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raccoon_library-1.0.79-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.79-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 da2cc88f24e07931117904b5387cf0e6932694ac3c27e383dd684b151d9f354e
MD5 665d5dd83e020e4bb8b4bd57e216d19e
BLAKE2b-256 2a8e7497a80161d8a035bcf6bdd382323b354a854173e29c16a20938a41147d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.79-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: ci.yml on htl-stp-ecer/raccoon-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raccoon_library-1.0.79-cp313-cp313-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.79-cp313-cp313-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 c085fc5979308dc63824e6a50633df219b00e1b63428282813fefaf53313a2ec
MD5 108a4b2b9f300ea85070386f065182cc
BLAKE2b-256 d420bda356e22d40336c2934375b94d1ea831edf76baa6e364a4d95fa512ebfd

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.79-cp313-cp313-macosx_11_0_universal2.whl:

Publisher: ci.yml on htl-stp-ecer/raccoon-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raccoon_library-1.0.79-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.79-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a3815430964f335f7c4de675ef2f42ab71a1cfcd853829ba15ea3cb97fd8a608
MD5 244b24850634aeba42f16d6af811af91
BLAKE2b-256 73fffcd5b90b12688f74ae35f736c9e2e904e1be44e95b6da35bc91b50310c7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.79-cp312-cp312-win_amd64.whl:

Publisher: ci.yml on htl-stp-ecer/raccoon-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raccoon_library-1.0.79-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.79-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 184a125972814905b5127f911fe0d7b9d0d2dfd72acae72c680d6b3fd634129c
MD5 94c5144ac93c3909498cb13077408971
BLAKE2b-256 b58b73e03248b6fb56c87916e06c380d5fb1090aeab00bf51aca16b8e4355235

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.79-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: ci.yml on htl-stp-ecer/raccoon-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raccoon_library-1.0.79-cp312-cp312-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.79-cp312-cp312-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 1962e923eccd8c87ebf9d01cb791ec0fb1d8a0df5f18630faec216e3f63b5698
MD5 1d8965a81e3592f996ee816efb5b98cb
BLAKE2b-256 609904fbe5709183f7922f488f82a7a01782e2e8de4a5898a519ad44cc460d35

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.79-cp312-cp312-macosx_11_0_universal2.whl:

Publisher: ci.yml on htl-stp-ecer/raccoon-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raccoon_library-1.0.79-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.79-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 64660184dcfa2d2a39d0052ac5ac21419a12e827ff1b0255bef82057bf8e54fe
MD5 9bfebe5cdc0a9a04bce88bda30d26d00
BLAKE2b-256 efc3a977edd09c6a06cb23fab9c02ab7e304bcb297ad8db058834a21f4e15a2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.79-cp311-cp311-win_amd64.whl:

Publisher: ci.yml on htl-stp-ecer/raccoon-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raccoon_library-1.0.79-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.79-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0f3c1d7e7c973120d79ea63777d8c9b77085fd08b42598757d0bbc7241714e75
MD5 0463e504f700e240a3493fc9cfa64726
BLAKE2b-256 8996eb9ecf030cf242bb949aed290327c8f164725c9ee74bec3f729d97624e31

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.79-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: ci.yml on htl-stp-ecer/raccoon-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raccoon_library-1.0.79-cp311-cp311-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.79-cp311-cp311-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 e6a49a15a7d4f867724a76aa34596bfc70e3fc84c54b15880e55e54bcb6be6f2
MD5 d2fe3020a8ebe677572a83454c822a93
BLAKE2b-256 534cc0b1dcaaf129dda0de74c3358b532f392e620c0b8315a39fedb16d4a395a

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.79-cp311-cp311-macosx_11_0_universal2.whl:

Publisher: ci.yml on htl-stp-ecer/raccoon-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page