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

Uploaded CPython 3.13Windows x86-64

raccoon_library-1.0.93-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (7.6 MB view details)

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

raccoon_library-1.0.93-cp313-cp313-macosx_14_0_universal2.whl (8.3 MB view details)

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

raccoon_library-1.0.93-cp312-cp312-win_amd64.whl (5.3 MB view details)

Uploaded CPython 3.12Windows x86-64

raccoon_library-1.0.93-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (7.6 MB view details)

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

raccoon_library-1.0.93-cp312-cp312-macosx_14_0_universal2.whl (8.3 MB view details)

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

raccoon_library-1.0.93-cp311-cp311-win_amd64.whl (5.3 MB view details)

Uploaded CPython 3.11Windows x86-64

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

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

raccoon_library-1.0.93-cp311-cp311-macosx_14_0_universal2.whl (8.3 MB view details)

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

File details

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

File metadata

File hashes

Hashes for raccoon_library-1.0.93-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4acc449c0e790b35bf4ef626d91725451a90a24342db741a5737a8394de54de6
MD5 2ec543b56ee3d9443d066a1399e07eec
BLAKE2b-256 6f0d77c4b11865776385f9e544ac266e484f2403a381d7dde3de5439b5fd3f15

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raccoon_library-1.0.93-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 efd0b2c6772021253d531e4e9f329426876971f56a1d461a2a9636d034631031
MD5 d6f9c5b33f90b1da6f77261f3e5202c8
BLAKE2b-256 3ebf95732585086045e90a489b06a76b356592b2cd821e64785890e279287eb3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raccoon_library-1.0.93-cp313-cp313-macosx_14_0_universal2.whl
Algorithm Hash digest
SHA256 4831e857cf17afcb217d4d29d4eada43f87bb15fb1f7bb2c2d6e45d25064ce61
MD5 3d656b0dabf949bda0a030ac0c3f3389
BLAKE2b-256 f69dbf396441aeee354bb9014b5e48ca75924aab9900200ebe202b16c8b86791

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raccoon_library-1.0.93-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 caf91393753ef77a1fe3820e5befc22e4da45039ddfb5bc3e038a8ef83a70ca1
MD5 c21284d20079b1869e8b33d6eb283277
BLAKE2b-256 fd179cc0f3a12a7f0eab63988d81df97d051c1434ad67e455abea03a692c1af9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raccoon_library-1.0.93-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c572347e2c2d3cd64269195977c14dc59250f72ed30736338becf744f014caa5
MD5 c02a1909014cd8ea8adbdb9d83ba11cc
BLAKE2b-256 1dd3e283b905f41132e7747f87a2a5ef218de1b80254e81874b7d75d55872676

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raccoon_library-1.0.93-cp312-cp312-macosx_14_0_universal2.whl
Algorithm Hash digest
SHA256 646ce7d993c71a9da25257b8ae507a9293acc71074ecdbaffd9f1413bb01e9f5
MD5 5ac633438be3310461383293328599c8
BLAKE2b-256 48c1cdd4c293a71534684aa5a3dfb079988664e65945d25b0d6fc9c5e9943bff

See more details on using hashes here.

Provenance

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

File details

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

File metadata

File hashes

Hashes for raccoon_library-1.0.93-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ccd79ae6ff5b0072f2d9ec5589ed9ae0ff83d059a5fd8b0954be1f8e416192cb
MD5 8f814a886758de60bff43c09d361c752
BLAKE2b-256 3ee4db424ba02bcc969428e88975f5341e231b3d5417edef08ada93e3ed887d5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for raccoon_library-1.0.93-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 57a92bc229d6004017325f026255d2d660ce42984e994447552f2b85d66e04e5
MD5 de7e16183f5b4e3bdf9fe8578a45fd52
BLAKE2b-256 b63701a783ad1fac6a488caf519bb767e991603e74b3dda7a3c1291e2b7151c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for raccoon_library-1.0.93-cp311-cp311-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.93-cp311-cp311-macosx_14_0_universal2.whl.

File metadata

File hashes

Hashes for raccoon_library-1.0.93-cp311-cp311-macosx_14_0_universal2.whl
Algorithm Hash digest
SHA256 277bb412d3dfe072ba134a3b05d3beac20f5afcba1e429e0a3a21e5a0e0cf094
MD5 4b340d7608143bea82ab2daf13f93978
BLAKE2b-256 ac2678fd3e388aa987d22e4db025946649cb7fea5bb8b248b19214d81a4e234e

See more details on using hashes here.

Provenance

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