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

Uploaded CPython 3.13Windows x86-64

raccoon_library-1.0.0-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.0-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.0-cp312-cp312-win_amd64.whl (5.6 MB view details)

Uploaded CPython 3.12Windows x86-64

raccoon_library-1.0.0-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.0-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.0-cp311-cp311-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.11Windows x86-64

raccoon_library-1.0.0-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.0-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.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 93e22269e3cded2dbbb78aaf8386e65c9b639a7cf7a9b43ad9f4debb0638c3e2
MD5 58a7e0eab66d766292eb3c775f819a1f
BLAKE2b-256 cf4a76c735c66c76eaf750205c80c96ffae328bc0f919e09909a9ece2aec344f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raccoon_library-1.0.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fbc88e6ed6cbc10d247067bd5669524cca05adfe861ef4130af0c863d46a73ec
MD5 3bb5e6c66801c5d56744e0ab98d277ef
BLAKE2b-256 63b765418f2588b580639e69a55667d153d36e27ecdf88c6ce0c3799b6d81df4

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.0-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.0-cp313-cp313-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.0-cp313-cp313-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 3133d3a6478a50a406c8e6276edd5ab29d414ba9f050de651c6c8e51cc1edd8c
MD5 430b325cc55ead5322674784114167da
BLAKE2b-256 4c953af23ab72f141116083b8c30684825f319865f64e33df524eb37563cfb70

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.0-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.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 914febc58ce7a953c6809dfa21a40fda55ec4f732f45f3d47b8c189bd2749d81
MD5 361c13f05678062969beb55e1a57e215
BLAKE2b-256 92b910a02d3ff82327657dce7b88cca8eb91720baaf936c1703db2db659a04a7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raccoon_library-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c7645f7eecacf86608a7788bf48c508433209b179ed691c49de25843f14256bc
MD5 1851dadf5578a25a3be6dc2cacfe6342
BLAKE2b-256 aa609f4256a26b2ee209c5a2f7fe20412eb1e9f5022a72b0b45caba23894e140

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.0-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.0-cp312-cp312-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.0-cp312-cp312-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 e87feacde63117e17187b40e25ac67fbff2de2db9c308e8b53453326b807098e
MD5 32eb1dce4ae8a2337b83ea3cd6dee458
BLAKE2b-256 9a57bde25da660f407aab54ac276142ae65513ac0f153939857dc69780fe1e5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.0-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.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c0f60247645fde92abe3140e1cb0ee6760162150e61ab0b2d75514da5138c58b
MD5 e7a9e75392db7ec82c1a0375e4f02145
BLAKE2b-256 172e65a23da2b975d961dc4fb523dd2c06c94981f41042dcdc2a27a98fbfcfee

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.0-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.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ef50d432d118366062064278f7a536766485b3874c2fdebbdebbcbf9cf9adf50
MD5 85e85942fe2868f32cb7dea87850b3b8
BLAKE2b-256 0978d5362a51ec35e7432d93fc60e7142e69ba56147ef7f50cca3e51628b44ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.0-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.0-cp311-cp311-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.0-cp311-cp311-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 4f7c2992c42d0d5bbdcc7b510212d079c41cf2209e8383b2c10ca7e10a083e03
MD5 65f01ca723cc175f0394f19596b2a363
BLAKE2b-256 adb854054730536aa846b3feb2523c7bb3764c5d4e79dd8da5b5a66b398cf7b9

See more details on using hashes here.

Provenance

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