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
| Page | What You’ll Learn |
|---|---|
| Architecture Overview | The full layer stack, how pieces connect |
| Your First Robot Program | Hands-on tutorial: drive, servos, sensors, first mission |
| Project Structure | Files, folders, and configuration |
| Robot Definition | Declaring hardware, kinematics, and drive |
| Missions | Writing and sequencing missions |
| Steps DSL | The motion/action building blocks |
| Stop Conditions | Combining conditions with OR, AND, THEN |
| Custom Steps | Writing your own reusable steps |
| Sensors | IR, analog, digital, and camera sensors |
| Drive System | Kinematics, velocity control, PID tuning |
| Odometry | Position tracking and heading reference |
| Servos | Servo control and presets |
| Calibration | Motor and sensor calibration workflow |
| UI Steps & Screens | Touchscreen UI, widgets, custom screens |
| Advanced Topics | Async, timing, transport, debugging |
Deep Dives
| Page | What It Does |
|---|---|
| Line Following | PID-based edge tracking with profiled and directional variants |
| Lineup | Single-pass geometric line alignment |
| IR Sensor Calibration (K-Means) | Clustering-based threshold detection for IR sensors |
| Wait for Light | Kalman-filtered start lamp detection with test/arm workflow |