Asi kscale-kos

K-Scale KOS Skill

install
source · Clone the upstream repo
git clone https://github.com/plurigrid/asi
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/plurigrid/asi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/kscale-kos" ~/.claude/skills/plurigrid-asi-kscale-kos && rm -rf "$T"
manifest: skills/kscale-kos/SKILL.md
source content

K-Scale KOS Skill

"A general-purpose, configurable framework for robot firmware"

Trigger Conditions

  • User asks about robot operating systems, firmware, or low-level control
  • Questions about actuator control, IMU integration, motor drivers
  • gRPC service interfaces for robot hardware
  • Real-time control loops, servo calibration

Overview

KOS (K-Scale Operating System) is a Rust-based robot firmware framework providing:

  1. Hardware Abstraction: Unified interface for actuators, sensors, IMUs
  2. gRPC Services: Remote procedure calls for robot control
  3. Real-time Control: Low-latency servo loops
  4. Calibration Tools: Servo tuning and parameter management

Architecture

┌─────────────────────────────────────────────────────────────────────────┐
│  KOS Architecture                                                        │
│                                                                          │
│  ┌──────────────┐      gRPC      ┌──────────────┐                       │
│  │   Client     │◀──────────────▶│  KOS Server  │                       │
│  │  (Python)    │                │   (Rust)     │                       │
│  └──────────────┘                └──────┬───────┘                       │
│                                         │                                │
│                    ┌────────────────────┼────────────────────┐          │
│                    ▼                    ▼                    ▼          │
│             ┌──────────┐        ┌──────────┐        ┌──────────┐       │
│             │ Actuator │        │   IMU    │        │  Policy  │       │
│             │ Service  │        │ Service  │        │ Service  │       │
│             └────┬─────┘        └────┬─────┘        └────┬─────┘       │
│                  │                   │                   │              │
│                  ▼                   ▼                   ▼              │
│             ┌──────────────────────────────────────────────┐           │
│             │              Hardware Layer                   │           │
│             │  (CAN bus, SPI, I2C, UART)                   │           │
│             └──────────────────────────────────────────────┘           │
└─────────────────────────────────────────────────────────────────────────┘

Key Services

ServicePurposeMethods
ActuatorService
Motor control
GetState
,
SetPosition
,
Calibrate
IMUService
Orientation sensing
GetQuaternion
,
GetAngularVelocity
PolicyService
RL policy execution
LoadModel
,
Step
,
GetAction
CalibrationService
Servo tuning
GetCalibrationState
,
SetParameters

Language & Stack

  • Primary: Rust (safe, fast, real-time capable)
  • Protocol: gRPC/protobuf for client communication
  • Bindings: Python SDK via
    kos-python

Release History

VersionDateHighlights
0.7.102025-05-26Extended Actuator State Response
0.7.92025-05-14New PolicyService
0.7.82025-05-06GetCalibrationState
0.7.72025-05-04Parameter Dump API

GF(3) Trit Assignment

Trit: -1 (MINUS)
Role: Verification/Validation (firmware = critical path)
Color: #7758D6
URI: skill://kscale-kos#7758D6

Balanced Triads

kscale-kos (-1) ⊗ kscale-ksim (0) ⊗ gym (+1) = 0 ✓
kscale-kos (-1) ⊗ embedded-rust (0) ⊗ robotics-gen (+1) = 0 ✓

Related Skills

  • kscale-ksim
    : Simulation training (policies deploy to KOS)
  • kscale-kinfer
    : Model inference (runs on KOS)
  • rust
    : Systems programming language
  • grpc
    : Remote procedure calls

Example Usage

import kos

# Connect to robot
client = kos.Client("192.168.1.100:50051")

# Get actuator state
state = client.actuator.get_state(joint_ids=[1, 2, 3])
print(f"Positions: {state.positions}")

# Set position command
client.actuator.set_position(
    joint_id=1,
    position=1.57,  # radians
    velocity=0.5    # rad/s limit
)

# Load and run policy
client.policy.load_model("walking_v2.onnx")
while True:
    obs = client.get_observation()
    action = client.policy.step(obs)
    client.actuator.set_positions(action)

ACSet Schema

@present SchKOS(FreeSchema) begin
    # Objects
    Joint::Ob           # Robot joints/actuators
    Sensor::Ob          # IMU, encoders, force sensors
    Service::Ob         # gRPC services
    Command::Ob         # Control commands
    State::Ob           # Hardware state
    
    # Morphisms (control flow)
    actuates::Hom(Command, Joint)         # Command → Joint actuation
    reads::Hom(Sensor, State)             # Sensor → State reading
    serves::Hom(Service, Command)         # Service → Command dispatch
    monitors::Hom(Joint, Sensor)          # Joint → Sensor feedback
    
    # Morphisms (composition)
    chain::Hom(Joint, Joint)              # Kinematic chain
    calibrates::Hom(Service, Joint)       # Calibration service
    
    # Attributes
    Position::AttrType
    Velocity::AttrType  
    Torque::AttrType
    
    pos::Attr(Joint, Position)
    vel::Attr(Joint, Velocity)
    torque::Attr(Joint, Torque)
    
    # Key constraint: closed-loop control
    # reads ∘ monitors = state_feedback (proprioception)
end

References