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.101-cp313-cp313-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.13Windows x86-64

raccoon_library-1.0.101-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

raccoon_library-1.0.101-cp313-cp313-macosx_14_0_universal2.whl (8.5 MB view details)

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

raccoon_library-1.0.101-cp312-cp312-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.12Windows x86-64

raccoon_library-1.0.101-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

raccoon_library-1.0.101-cp312-cp312-macosx_14_0_universal2.whl (8.5 MB view details)

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

File details

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

File metadata

File hashes

Hashes for raccoon_library-1.0.101-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8a9ad2406c550ec3b21d2139970d964696cc7acd51d0547cbdf007bc6c6f6ba2
MD5 920afbe540ea9451a50eab1b569ef1d3
BLAKE2b-256 a0ec538573173ebec4e6560ed72c1129ff12d67c2036d6e8d6ef34b4d2e39387

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.101-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.101-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.101-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bc307ba96908d70af12ab49142b9e94f496f48d0e280007e3e5ff1ecdae2f6f3
MD5 cce80d811d68b9b8dfc1641fd89bf3a1
BLAKE2b-256 555e2d3a8bb7b875b273316f73dbb0dcee07f0b42564eba90d4e689bdd480f52

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.101-cp313-cp313-manylinux_2_27_x86_64.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.101-cp313-cp313-macosx_14_0_universal2.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.101-cp313-cp313-macosx_14_0_universal2.whl
Algorithm Hash digest
SHA256 1538e752dae95864dce826ee6f6636cbed9c6a61445b2925fae5324a17a143e3
MD5 aa880e23a745f32afef44e6f8a3b2ab7
BLAKE2b-256 5236db94963dbf435a31252f611aa5b7bac7576ca0848e98a537c3d9ece4be4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.101-cp313-cp313-macosx_14_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.101-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.101-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 58582e9d19a4c6dae4a9cdcd99f803467b1247a095e4f34615bd67f3b130cd23
MD5 4ea25152d831f4f45abb4920e170fdbb
BLAKE2b-256 657c0d5418d94321f03f18ded8cfbba34b1689059518db06f28b2bfbd02c4db1

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.101-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.101-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.101-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6e19e53e608c44003d517beef0430a408805f7d45ea4f3b55b4e7ad5fe711ca1
MD5 a3deb96de12d3bb68cdcd1916fd2648c
BLAKE2b-256 0ac305758afa29da58e12b222b2823a303221522b2f85e7084b19198cbe7cdc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.101-cp312-cp312-manylinux_2_27_x86_64.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.101-cp312-cp312-macosx_14_0_universal2.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.101-cp312-cp312-macosx_14_0_universal2.whl
Algorithm Hash digest
SHA256 fbe5578c9bf7ce57762a62d47f8dd889febd404531993ac9d065f3b657af3239
MD5 d97c62ced2d7f4d6f3b9d98f6add1b6b
BLAKE2b-256 1d5ce6f617b950a9f2d2cc28ecd7fb285a057aba6fd9ada4d484672afd398f06

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.101-cp312-cp312-macosx_14_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