Programming Guide

This section covers everything you need to program robots with the LibSTP SDK — from writing your first mission to tuning low-level motor controllers.

LibSTP is a layered robotics framework: you write missions in Python using a high-level DSL, while the control loops, kinematics, and hardware drivers run in optimized C++ underneath. You don’t need to touch C++ to build a competition robot.

graph TD
    A["Your Mission Code (Python)"] --> B["Step DSL"]
    B --> C["Motion Controller"]
    C --> D["Drive + Kinematics"]
    D --> E["HAL (Hardware Abstraction)"]
    E --> F["Wombat Platform Driver"]
    F --> G["Motors / Servos / Sensors"]

    style A fill:#4CAF50,color:#fff
    style B fill:#66BB6A,color:#fff
    style C fill:#42A5F5,color:#fff
    style D fill:#42A5F5,color:#fff
    style E fill:#AB47BC,color:#fff
    style F fill:#AB47BC,color:#fff
    style G fill:#FF7043,color:#fff

Sections

PageWhat You’ll Learn
Architecture OverviewThe full layer stack, how pieces connect
Your First Robot ProgramHands-on tutorial: drive, servos, sensors, first mission
Project StructureFiles, folders, and configuration
Robot DefinitionDeclaring hardware, kinematics, and drive
MissionsWriting and sequencing missions
Steps DSLThe motion/action building blocks
Stop ConditionsCombining conditions with OR, AND, THEN
Custom StepsWriting your own reusable steps
SensorsIR, analog, digital, and camera sensors
Drive SystemKinematics, velocity control, PID tuning
OdometryPosition tracking and heading reference
ServosServo control and presets
CalibrationMotor and sensor calibration workflow
UI Steps & ScreensTouchscreen UI, widgets, custom screens
Advanced TopicsAsync, timing, transport, debugging

Deep Dives

PageWhat It Does
Line FollowingPID-based edge tracking with profiled and directional variants
LineupSingle-pass geometric line alignment
IR Sensor Calibration (K-Means)Clustering-based threshold detection for IR sensors
Wait for LightKalman-filtered start lamp detection with test/arm workflow