libstp.hal

Python bindings for libstp-hal

Classes

AnalogSensor

DigitalSensor

IMU

Motor

Servo

Module Contents

class libstp.hal.AnalogSensor(port: int)
port: int
read() int
class libstp.hal.DigitalSensor(port: int)
port: int
read() bool
class libstp.hal.IMU
calibrate() None

Calibrate the IMU sensor

get_heading() float

Get firmware-computed heading in radians

get_linear_acceleration() tuple[float, float, float]

Get gravity-compensated linear acceleration as (x, y, z) in m/s²

get_integrated_velocity() tuple[float, float, float]

Get firmware-integrated velocity as (x, y, z) in m/s

reset_integrated_velocity() None

Reset the firmware-integrated velocity accumulator

read() tuple

Read acceleration, gyroscope, and magnetometer data

class libstp.hal.Motor(port: int, inverted: bool = False, calibration: libstp.foundation.MotorCalibration = ...)
static disable_all() None
brake() None
off() None

Disable motor completely (no power, no brake — free-spinning)

get_calibration() libstp.foundation.MotorCalibration
get_position() int
is_done() bool
move_relative(velocity: int, delta_position: int) None
move_to_position(velocity: int, goal_position: int) None
set_speed(percent: int) None
set_velocity(velocity: int) None
property inverted: bool
property port: int
class libstp.hal.Servo(port: int)
port: int
static fully_disable_all() None
disable() None
enable() None
get_position() int
set_position(position: int) None