Referencemakiina.robot
makiina.robot
Every method of the Robot object and its namespaces, for an arm on your PC and a robot anywhere.
from makiina.robot import Robot, RobotError, namesOne class, Robot, for the hardware on your PC and for robots anywhere. The guides show these calls in use; this page lists them all.
Open a session
Robot.connect_local(*, adapters=None, identity=None, side=None, port=8770, timeout_s=30.0, action_rate_hz=90.0, on_status=None, server_output=None)
Starts a robot server on this PC, on its USB CAN adapters, and returns once joint state flows. robot.local is True; disconnect() stops the server.
| Argument | Meaning |
|---|---|
adapters | [{"interface": "candle", "channel": "<serial>:0"}, ...] to use only these adapters; default every adapter |
identity | a folder name under robot-calibrations/ or a path; default this PC's own folder, created the first time |
side | "left" or "right" for an arm whose boards do not say which side they are (old firmware) |
port | loopback port of the server; a second session on the same PC needs its own |
timeout_s | how long to wait for the server to start and report the first state |
action_rate_hz | how often commands are sent |
on_status | a function that receives progress messages |
server_output | path of the server log; default logs/<identity>-server.log |
Robot.connect(robot=None, *, cloud=None, email=None, password=None, base_url=None, receive_cameras=True, timeout_s=60.0, action_rate_hz=90.0, allow_relay=True, force_relay=False, on_status=None)
Signs in to MAKIINA Cloud, offers a session to a robot of your account and returns when it is live.
| Argument | Meaning |
|---|---|
robot | robot name or id; None picks the only robot of the account |
cloud | an already signed-in makiina.cloud.CloudClient |
email, password | credentials; default MAKIINA_EMAIL and MAKIINA_PASSWORD, then the saved CLI login |
base_url | another cloud endpoint; default MAKIINA_CLOUD_URL or the built-in one |
receive_cameras | False for a session without video |
timeout_s | how long to wait for the robot to answer and report its first state |
action_rate_hz | how often commands are sent |
allow_relay, force_relay | use the cloud relay when no direct path works, or always |
on_status | a function that receives progress messages |
Robot.connect_direct(listen_port=8766, *, timeout_s=120.0, action_rate_hz=90.0, on_status=None)
Waits for a robot on your LAN that you started by hand, pointed at this PC, with no cloud involved. Control and state only; no camera frames.
makiina.arm.Arm.connect(config=None, *, interface=None, channel=None, port=..., ...)
The older entry point for an arm on this PC. Same object as connect_local(); config is a folder name under robot-calibrations/.
The session
| Member | What it is |
|---|---|
disconnect() | ends the session; stops the local server; safe to call twice |
local | True when the server runs on this PC |
parts | ["right_arm"], ["left_arm", "right_arm", "head"]; empty until the first state |
capabilities | what the robot offers: grippers, streams, features |
status | link state and network path |
ping_ms | round trip, measured on the robot's echo of your clock |
state_timestamp | the robot clock time of the newest state, in seconds |
boot_phase | the robot's boot progress; None once it is up |
console_tail() | the robot server's recent log lines |
sensors
Everything measured. Reads return at once.
| Call | Returns |
|---|---|
get_joints(by="wire") | joint positions in rad; by="part" for part names |
get_joints_timed() | {joint: (rad, time measured)}, robot clock |
get_velocities() | rad/s per joint |
get_currents() | A per joint |
get_grippers() | gripper finger joints |
get_ee_poses() | {arm: 4x4} gripper poses in metres, from the measured joints |
get_ee_triggers() | the last trigger sent per gripper |
get_head(), get_head_velocity(), get_head_current() | the head's yaw (rad), velocity and current |
get_gaze() | the fovea centres you last asked for |
camera_names() | the streams this robot offers |
get_camera_frames() | {stream: HxWx3 RGB array}, newest frame of each |
get_camera_frame_metas() | per stream: the crop the robot applied, the head pose |
model
The kinematic twin. Nothing here moves the robot.
| Call | Returns |
|---|---|
joint_names() | joint names in the robot's order |
ee_names() | ["right_arm", "left_arm"] |
get_joint_limits() | the limits of each joint, rad |
named_poses() | {"zero": {...}, "neutral": {...}} |
compute_ee_poses(joints) | gripper poses of any joint configuration |
solve_ik(poses, seed_joints=None, iterations=100) | the joints that reach {arm: 4x4}; out of reach gives the closest reachable configuration |
urdf_xml(), urdf_dir() | the robot's model and the folder of its meshes |
control
The first motion call arms the session.
| Call | Does |
|---|---|
set_joints_absolute(joints) | targets in rad; joints you do not name keep theirs |
set_joints_relative(deltas) | adds to the current targets, rad |
set_ee_poses_absolute(poses, iterations=100) | gripper poses {arm: 4x4}, solved into joint targets |
set_ee_poses_relative(deltas, iterations=100) | new = delta @ current, in the world frame |
set_ee_triggers(triggers) | gripper closure, 0 open to 1 closed, by gripper name |
set_head(yaw) | head yaw in rad, positive to the right |
set_gaze([rx, ry, lx, ly]) | fovea centres in 0 to 1; works while disarmed |
set_gaze_method(method) | "HeadsetOrientation" (640 px foveas) or "EyeTrackingCombined" (320 px) |
get_commanded_joints() | the targets being sent |
set_actuator_parameters(params) | live drive settings; "key" for every joint, "<joint>/key" for one |
get_actuator_parameters(timeout=3.0, keys=None) | the settings every drive runs, read from the boards |
set_video_bitrates(context=None, fovea=None) | stream bitrates in kbit/s, kept by the robot |
set_camera_params(params) | ae_enable, exposure_time (us), analogue_gain, sharpness; the streams restart |
set_console_stream(enabled, hz=2.0) | stream the robot server's log into console_tail() |
stop() | disarm: hold the pose, pause motion until the next command |
safety
Enforced on the robot's side.
| Call | Does |
|---|---|
set_torque_fraction(fraction) | caps every joint's current at a fraction (0 to 1) of its limit |
set_max_joint_velocity(rad_s) | caps every joint's speed, rad/s at the joint |
torque_on() | energise the motors; they hold where they are |
torque_off() | release the motors; the arm sags |
reboot_robot() | restart the robot's computer; the motors lose power |
actuation
| Call | Does |
|---|---|
get_frequency() | the rate commands are sent at, Hz |
set_frequency(hz) | change it |
recording
Flags for a session recorder; the robot itself records nothing.
| Call | Does |
|---|---|
start(subtask=None) | recording on, both arms engaged |
stop() | recording off |
mark_demo() | start the next demonstration |
set_subtask(n) | the task label from now on |
set_trackings([right, left]) | per-arm engagement; a span with both off splits episodes |
names
| Call | Returns |
|---|---|
names.part_name("J01-R") | "right_J1" |
names.wire_name("right_J1") | "J01-R" |
names.is_part_name(s) | whether s is a part name |
Errors
RobotError for an unknown joint name (the message lists the valid ones), a call before the session is up, a twin that is not available, or a robot that does not answer. makiina.cloud.CloudError for sign-in and session set-up problems.