Python SDK
pip install pykos
kos
exposes a Python SDK for interacting with the robot. This is organized as a Python package]
Example Usage
Here is a small example of how to use the Python SDK to interface with kos
and control a robot.
import pykos
kos = pykos.KOS()
actuator_id = 1
self.kos.actuator.configure_actuator(actuator_id=actuator_id, kp=120, kd=10, torque_enabled=True)
motor_feedback = kos.actuator.get_actuators_state([actuator_id])
kos.actuator.command_actuators({"actuator_id": actuator_id, "position": 0.5})
Protobuf
The default Protobuf version packaged with apt
is quite old, so if you intend to build the SDK from scratch we recommend installing the latest version from here. Here’s an example script for downloading and installing protoc
for a Jetson:
# Create a temporary directory
mkdir -p /tmp/protoc
cd /tmp/protoc
# Download the zip file
wget https://github.com/protocolbuffers/protobuf/releases/download/v29.0/protoc-29.0-linux-aarch_64.zip
# Unzip the contents
unzip protoc-29.0-linux-aarch_64.zip
# Copy the protoc binary to a directory in your PATH
sudo cp bin/protoc /usr/local/bin/
# Copy the protobuf include files
sudo cp -r include/* /usr/local/include/
# Clean up
cd ..
rm -rf /tmp/protoc