libstp.hal ========== .. py:module:: libstp.hal .. autoapi-nested-parse:: Python bindings for libstp-hal Classes ------- .. autoapisummary:: libstp.hal.AnalogSensor libstp.hal.DigitalSensor libstp.hal.IMU libstp.hal.Motor libstp.hal.Servo Module Contents --------------- .. py:class:: AnalogSensor(port: int) .. py:attribute:: port :type: int .. py:method:: read() -> int .. py:class:: DigitalSensor(port: int) .. py:attribute:: port :type: int .. py:method:: read() -> bool .. py:class:: IMU .. py:method:: calibrate() -> None Calibrate the IMU sensor .. py:method:: get_heading() -> float Get firmware-computed heading in radians .. py:method:: get_linear_acceleration() -> tuple[float, float, float] Get gravity-compensated linear acceleration as (x, y, z) in m/s² .. py:method:: get_integrated_velocity() -> tuple[float, float, float] Get firmware-integrated velocity as (x, y, z) in m/s .. py:method:: reset_integrated_velocity() -> None Reset the firmware-integrated velocity accumulator .. py:method:: read() -> tuple Read acceleration, gyroscope, and magnetometer data .. py:class:: Motor(port: int, inverted: bool = False, calibration: libstp.foundation.MotorCalibration = ...) .. py:method:: disable_all() -> None :staticmethod: .. py:method:: brake() -> None .. py:method:: off() -> None Disable motor completely (no power, no brake — free-spinning) .. py:method:: get_calibration() -> libstp.foundation.MotorCalibration .. py:method:: get_position() -> int .. py:method:: is_done() -> bool .. py:method:: move_relative(velocity: int, delta_position: int) -> None .. py:method:: move_to_position(velocity: int, goal_position: int) -> None .. py:method:: set_speed(percent: int) -> None .. py:method:: set_velocity(velocity: int) -> None .. py:property:: inverted :type: bool .. py:property:: port :type: int .. py:class:: Servo(port: int) .. py:attribute:: port :type: int .. py:method:: fully_disable_all() -> None :staticmethod: .. py:method:: disable() -> None .. py:method:: enable() -> None .. py:method:: get_position() -> int .. py:method:: set_position(position: int) -> None