Kenate

API Reference

Standard Library

Pre-built logic modules for the stuff you shouldn't have to write yourself. Import them from kenate.lib and save yourself a week of debugging.

kenate.lib.Motion

High-level movement commands that handle ramp-up and ramp-down internally, because physics exists and instant acceleration destroys gearboxes.

move_smooth(distance, speed)

Moves a set distance with s-curve acceleration.

rotate_fixed(angle, speed)

Rotates the robot on its axis using IMU feedback.

WaitState

WaitState(duration)

Provides precision timed pauses without blocking the control loop.

SequenceState

SequenceState([states])

Chains multiple behaviors into a single autonomous flow.

PIDState

PIDState(p, i, d, t)

Industry-standard math for smooth, precise motor positioning.

WatchdogState

WatchdogState(timeout)

A background safety guardian that monitors system health.

BlackBoxLogger

BlackBoxLogger()

Captures high-frequency (1000Hz) telemetry data for post-mission analysis.

TerminalVisualizer

TerminalVisualizer(id)

A live-updating console dashboard for real-time mission monitoring.

Advanced Pattern: Observer Watchdog

Don't write safety logic inside every single state; you'll forget one and melt a battery. Instantiate a WatchdogState in the background. It perfectly separates your Mission Goal from "Please don't explode."

The Pattern

from kenate.lib import Motion, Safety

class PatrolState(kenate.BaseState):
    def on_update(self):
        # Use lib instead of raw motor math
        Motion.move_smooth(1.0, 0.5)