reachymini

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 18 Imported by: 0

README

reachy-mini-sdk-go

A Go SDK for piloting a Reachy Mini robot without writing any Python.

Pollen Robotics' official SDK is Python-only, but the robot runs a background daemon (a FastAPI service, pre-installed and auto-started) that exposes the entire control surface over plain HTTP REST + WebSocket JSON, plus a separate embedded WebRTC signalling server for the camera feed. This package is a from-scratch Go client for that daemon API, reverse-engineered from the daemon's live OpenAPI schema and, for the camera, the upstream GStreamer webrtcsink signalling protocol.

Install

go get github.com/nlm/reachy-mini-sdk-go

Requirements

  • Go 1.25+

  • ffmpeg on PATH (only needed for StreamCameraFrames — it's used to decode the camera's H.264/VP8 video, since there's no production-quality pure-Go decoder for either)

  • Network access to the robot's daemon, typically via an SSH tunnel:

    ssh -L 9000:localhost:9000 -L 8443:localhost:8443 <user>@<robot-host>
    

    Port 9000 is the REST/WebSocket API; 8443 is the WebRTC signalling server used only for the camera feed.

Usage

import reachymini "github.com/nlm/reachy-mini-sdk-go"

client := reachymini.New("http://localhost:9000")

ctx := context.Background()
if err := client.EnsureMotorMode(ctx, reachymini.MotorModeEnabled); err != nil {
	log.Fatal(err)
}
if err := client.WakeUp(ctx); err != nil {
	log.Fatal(err)
}

See github.com/nlm/reachy-mini-sdk-go on pkg.go.dev for the full API, and github.com/nlm/reachy-mini-demos for runnable example programs built on this SDK.

SDK coverage

File Covers
state.go Robot state: full state, present head pose / body yaw / antenna positions, direction-of-arrival, plus StreamFullState for the live WebSocket feed
move.go Movement: Goto (interpolated), SetTarget/StreamSetTarget (direct, low-latency), WakeUp/GotoSleep (canned animations), Stop, recorded move datasets
motors.go Motor control mode (enabled / disabled / gravity_compensation), plus EnsureMotorMode
media.go Sound playback: play/stop/list/upload/delete, clear incoming audio
audio.go Speaker/mic volume, low-level audio mixer parameters, test sound
daemon.go Daemon status and restart
apps.go The Hugging Face Spaces app store: list/install/remove/update/start/stop apps, check for updates
camera.go Camera specs (resolutions, intrinsics/distortion)
camera_stream.go + webrtc_signalling.go StreamCameraFrames — live decoded video frames over WebRTC
kinematics.go Kinematics info, URDF, STL mesh downloads
ws.go Shared WebSocket helper for the streaming state/target endpoints

All request/response types were derived from the daemon's live /openapi.json and cross-checked against a real robot and Pollen's own desktop simulator — see "Verified vs. inferred" below for the exceptions.

Known issues / caveats

  • gravity_compensation motor mode returns HTTP 500 on daemon v1.8.1 (confirmed against real hardware). Prefer disabled, which works reliably.
  • Motor control mode does not survive a daemon restart. On real hardware it always came back disabled; the desktop simulator has come back either way. Nothing enforces this — any program that moves the robot should call EnsureMotorMode(ctx, MotorModeEnabled) first rather than assuming it's already enabled. It's also been observed to reset to disabled on its own between sessions, with no restart involved, so "check before you move" is the safe default, not just "check after a restart."
  • Movement commands don't validate hardware state. Goto, SetTarget, WakeUp, etc. all return 200 OK and a UUID even when motor control is disabled — they're silently no-ops. There's no error to catch; the only sign is that nothing physically moves.
  • A daemon restart puts motors in compliant/free-spinning mode for its duration. Anything resting on the antennas/head (or gravity) can leave them far from where they started. Re-enabling control doesn't re-home position.
  • Pose's AnyPose union (XYZRPYPose vs Matrix4x4Pose) is distinguished in UnmarshalJSON by the presence of an "m" field, since the daemon's Pydantic model doesn't use an explicit discriminator tag. Verified against live data using XYZRPYPose; Matrix4x4Pose round-tripping hasn't been separately exercised.
Camera / WebRTC
  • Verified live end-to-end against Pollen's desktop simulator: signalling handshake, WebRTC/ICE negotiation, VP8 depacketization, IVF muxing, and ffmpeg decode all confirmed producing real, correctly-decoded frames.
  • The simulator negotiates VP8. Real hardware has been observed in the daemon's own source to use hardware H.264 on Raspberry Pi instead. Both codecs are handled in camera_stream.go (decoder choice is deferred until the negotiated codec is known), but only the VP8 path has actually been exercised against a live producer — H.264 is implemented from the same protocol understanding but unverified against real hardware.
  • TestFFmpegH264DecodePipeline and TestFFmpegVP8DecodePipeline (camera_stream_test.go) test the ffmpeg decode pipeline in isolation with synthetic streams, independent of the robot — run with go test ./....

Verified vs. inferred

Most of the SDK has been exercised against either real Reachy Mini hardware or Pollen's desktop simulator (state reads, movement, sounds, motors, daemon restart, volume, apps listing, kinematics, camera). A few corners haven't been:

  • InstallApp / RemoveApp / UpdateApp / StartApp / StopCurrentApp / ResetAppsCache — not run live, since they mutate persistent app installation state
  • GetKinematicsSTL — needs a real filename from GetURDF's content, not just guessed
  • ReadAudioParameter / ApplyAudioConfig — parameter names are undocumented and backend-specific
  • H.264 camera decoding (see above)

These are implemented against the daemon's documented schema and follow the same patterns as the verified parts of the SDK, but treat them as a starting point to debug against real traffic rather than a guaranteed-working path.

Documentation

Overview

Package reachymini is a Go client for the Reachy Mini daemon's REST/WebSocket API (the same interface used by Pollen Robotics' own TypeScript SDK and desktop app), so the robot can be piloted without writing any Python.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	StatusCode int
	Body       string
}

APIError is returned when the daemon responds with a non-2xx status.

func (*APIError) Error

func (e *APIError) Error() string

type AppInfo

type AppInfo struct {
	Name        string         `json:"name"`
	SourceKind  SourceKind     `json:"source_kind"`
	Description string         `json:"description,omitempty"`
	URL         *string        `json:"url,omitempty"`
	Extra       map[string]any `json:"extra,omitempty"`
}

AppInfo describes an app available from the robot's app store or already installed.

type AppState

type AppState string

AppState is the runtime status of an app.

const (
	AppStateStarting AppState = "starting"
	AppStateRunning  AppState = "running"
	AppStateDone     AppState = "done"
	AppStateStopping AppState = "stopping"
	AppStateError    AppState = "error"
)

type AppStatus

type AppStatus struct {
	Info  AppInfo  `json:"info"`
	State AppState `json:"state"`
	Error *string  `json:"error,omitempty"`
}

AppStatus is the status of a running (or just-started/stopped) app.

type AppUpdateStatus

type AppUpdateStatus struct {
	AppName         string  `json:"app_name"`
	SpaceID         string  `json:"space_id"`
	InstalledSHA    string  `json:"installed_sha"`
	LatestSHA       string  `json:"latest_sha"`
	UpdateAvailable bool    `json:"update_available"`
	LastModified    *string `json:"last_modified,omitempty"`
}

AppUpdateStatus is the result of checking one installed app for updates.

type AppUpdatesResponse

type AppUpdatesResponse struct {
	AppsWithUpdates []AppUpdateStatus `json:"apps_with_updates"`
	AppsChecked     int               `json:"apps_checked"`
	AppsSkipped     int               `json:"apps_skipped"`
}

AppUpdatesResponse is the response of GET /api/apps/check-updates.

type AudioParamPair

type AudioParamPair struct {
	Name   string    `json:"name"`
	Values []float64 `json:"values"`
}

AudioParamPair is one (parameter name, values) pair in an audio config payload, as used by ApplyAudioConfig.

type BackendStatus

type BackendStatus struct {
	Ready            bool              `json:"ready"`
	MotorControlMode MotorControlMode  `json:"motor_control_mode"`
	LastAlive        any               `json:"last_alive"`
	ControlLoopStats *ControlLoopStats `json:"control_loop_stats"`
	Error            any               `json:"error"`
}

BackendStatus reports the motor/hardware backend's health. Ready has been observed false even during normal operation, so don't gate on it; State on the enclosing DaemonStatus is the more reliable liveness signal.

type CameraSpecs

type CameraSpecs struct {
	Name                 string           `json:"name"`
	AvailableResolutions []ResolutionInfo `json:"available_resolutions"`
	DefaultResolution    ResolutionInfo   `json:"default_resolution"`
	K                    [][]float64      `json:"K"`
	D                    []float64        `json:"D"`
}

CameraSpecs is the response of GET /api/camera/specs: full camera specifications as detected by the daemon, including the intrinsic matrix K and distortion coefficients D (standard OpenCV pinhole camera model).

type CameraStreamOptions

type CameraStreamOptions struct {
	// SignallingURL is the WebRTC signalling server's WebSocket URL, e.g.
	// "ws://localhost:8443". This is a *separate* connection from the
	// daemon's REST API -- see webrtc_signalling.go. Defaults to Client's
	// BaseURL host on port 8443 if empty.
	SignallingURL string

	// ProducerName optionally selects a specific producer by its
	// advertised meta name, if the signalling server lists more than one.
	// If empty, the first available producer is used.
	ProducerName string

	// FFmpegPath overrides the ffmpeg binary used to decode video to raw
	// RGB frames. Defaults to "ffmpeg" (resolved via PATH). This is a
	// runtime dependency of the calling machine, not a Go dependency --
	// there is no production-quality pure-Go decoder for either codec the
	// daemon may negotiate (see below).
	FFmpegPath string
}

CameraStreamOptions configures StreamCameraFrames.

type Client

type Client struct {
	BaseURL    string
	HTTPClient *http.Client
}

Client talks to a Reachy Mini daemon reachable at BaseURL (e.g. "http://localhost:8000" when tunneled over SSH with `ssh -L 8000:localhost:8000 <user>@<robot-host>`).

func New

func New(baseURL string) *Client

New returns a Client pointed at baseURL, e.g. "http://localhost:8000".

func (*Client) ApplyAudioConfig

func (c *Client) ApplyAudioConfig(ctx context.Context, config []AudioParamPair, verify bool) (bool, error)

ApplyAudioConfig applies low-level audio mixer parameters. If verify is true (the daemon's own default), it reads each parameter back after writing to confirm it took effect.

func (*Client) CheckAppUpdates

func (c *Client) CheckAppUpdates(ctx context.Context, force bool) (AppUpdatesResponse, error)

CheckAppUpdates checks installed apps for available updates. Set force to bypass any cached result.

func (*Client) ClearIncomingAudio

func (c *Client) ClearIncomingAudio(ctx context.Context) (map[string]string, error)

ClearIncomingAudio discards any buffered incoming audio (e.g. from the microphone/direction-of-arrival pipeline).

func (*Client) DeleteSound

func (c *Client) DeleteSound(ctx context.Context, filename string) error

DeleteSound removes a sound file from the robot.

func (*Client) EnsureMotorMode

func (c *Client) EnsureMotorMode(ctx context.Context, mode MotorControlMode) (changed bool, err error)

EnsureMotorMode sets the robot's motor control mode to mode if it isn't already there, and reports whether a change was made. Movement commands (Goto, SetTarget, WakeUp, GotoSleep, ...) are accepted by the daemon and silently no-op if the robot isn't actually in MotorModeEnabled, so this is meant to be called at the top of anything that's about to move the robot.

func (*Client) GetCameraSpecs

func (c *Client) GetCameraSpecs(ctx context.Context) (CameraSpecs, error)

GetCameraSpecs returns the robot's camera specifications.

func (*Client) GetCurrentAppStatus

func (c *Client) GetCurrentAppStatus(ctx context.Context) (*AppStatus, error)

GetCurrentAppStatus returns the currently running app's status, or nil if no app is running.

func (*Client) GetDaemonStatus

func (c *Client) GetDaemonStatus(ctx context.Context) (DaemonStatus, error)

GetDaemonStatus returns the daemon's current status, including hardware backend health and motor control mode.

func (*Client) GetDoA

func (c *Client) GetDoA(ctx context.Context) (DoAInfo, error)

GetDoA returns the current direction-of-arrival (sound source) estimate.

func (*Client) GetFullState

func (c *Client) GetFullState(ctx context.Context) (FullState, error)

GetFullState returns the robot's complete current state.

func (*Client) GetJobStatus

func (c *Client) GetJobStatus(ctx context.Context, jobID string) (JobInfo, error)

GetJobStatus returns the status of an install/update job started by InstallApp, InstallPrivateSpace, or UpdateApp.

func (*Client) GetKinematicsInfo

func (c *Client) GetKinematicsInfo(ctx context.Context) (map[string]any, error)

GetKinematicsInfo returns the daemon's kinematics configuration as a free-form map -- the daemon's OpenAPI spec declares this endpoint's response as an open object with no fixed schema.

func (*Client) GetKinematicsSTL

func (c *Client) GetKinematicsSTL(ctx context.Context, filename string) ([]byte, error)

GetKinematicsSTL downloads the raw STL mesh file named filename (as referenced by GetURDF/GetKinematicsInfo) and returns its bytes.

func (*Client) GetMicrophoneVolume

func (c *Client) GetMicrophoneVolume(ctx context.Context) (VolumeInfo, error)

GetMicrophoneVolume returns the current microphone volume.

func (*Client) GetMotorStatus

func (c *Client) GetMotorStatus(ctx context.Context) (MotorStatus, error)

GetMotorStatus returns the robot's current motor control mode.

func (*Client) GetPresentAntennaPositions

func (c *Client) GetPresentAntennaPositions(ctx context.Context) ([2]float64, error)

GetPresentAntennaPositions returns the [left, right] antenna joint positions.

func (*Client) GetPresentBodyYaw

func (c *Client) GetPresentBodyYaw(ctx context.Context) (float64, error)

GetPresentBodyYaw returns the body's current yaw.

func (*Client) GetPresentHeadPose

func (c *Client) GetPresentHeadPose(ctx context.Context) (Pose, error)

GetPresentHeadPose returns the head's current pose.

func (*Client) GetURDF

func (c *Client) GetURDF(ctx context.Context) (map[string]string, error)

GetURDF returns the robot's URDF description as a set of named file contents (e.g. a "urdf" key holding the XML).

func (*Client) GetVolume

func (c *Client) GetVolume(ctx context.Context) (VolumeInfo, error)

GetVolume returns the current speaker volume.

func (*Client) Goto

func (c *Client) Goto(ctx context.Context, req GotoRequest) (MoveUUID, error)

Goto smoothly interpolates to the given target pose(s) over req.Duration.

func (*Client) GotoSleep

func (c *Client) GotoSleep(ctx context.Context) (MoveUUID, error)

GotoSleep plays the robot's built-in sleep move.

func (*Client) InstallApp

func (c *Client) InstallApp(ctx context.Context, app AppInfo) (map[string]string, error)

InstallApp installs app and returns the daemon's raw install job response (the daemon's OpenAPI spec declares no fixed schema for it beyond string-to-string). Poll GetJobStatus to track progress.

func (*Client) InstallPrivateSpace

func (c *Client) InstallPrivateSpace(ctx context.Context, spaceID string) (map[string]string, error)

InstallPrivateSpace installs a private Hugging Face Space by ID.

func (*Client) ListAvailableApps

func (c *Client) ListAvailableApps(ctx context.Context) ([]AppInfo, error)

ListAvailableApps lists all apps available to install, across all sources.

func (*Client) ListAvailableAppsBySource

func (c *Client) ListAvailableAppsBySource(ctx context.Context, source SourceKind) ([]AppInfo, error)

ListAvailableAppsBySource lists apps available from a single source.

func (*Client) ListRecordedMoveDatasets

func (c *Client) ListRecordedMoveDatasets(ctx context.Context, datasetName string) ([]string, error)

ListRecordedMoveDatasets lists the recorded moves available in datasetName.

func (*Client) ListRunningMoves

func (c *Client) ListRunningMoves(ctx context.Context) ([]MoveUUID, error)

ListRunningMoves returns the UUIDs of moves currently in progress.

func (*Client) ListSounds

func (c *Client) ListSounds(ctx context.Context) ([]string, error)

ListSounds lists the sound files available on the robot.

func (*Client) PlayRecordedMoveDataset

func (c *Client) PlayRecordedMoveDataset(ctx context.Context, datasetName, moveName string) (MoveUUID, error)

PlayRecordedMoveDataset plays moveName from datasetName.

func (*Client) PlaySound

func (c *Client) PlaySound(ctx context.Context, file string) error

PlaySound plays a sound file already stored on the robot (see ListSounds).

func (*Client) ReadAudioParameter

func (c *Client) ReadAudioParameter(ctx context.Context, name string) (ReadAudioParameterResponse, error)

ReadAudioParameter reads a single low-level audio mixer parameter by name. Valid names are specific to the daemon's audio backend and aren't enumerated anywhere in the API itself.

func (*Client) RemoveApp

func (c *Client) RemoveApp(ctx context.Context, appName string) (map[string]string, error)

RemoveApp uninstalls appName.

func (*Client) ResetAppsCache

func (c *Client) ResetAppsCache(ctx context.Context) (map[string]string, error)

ResetAppsCache clears the daemon's cached app store listing. Note this endpoint is mounted at /cache/reset-apps, not under /api like everything else -- that's how the daemon itself exposes it.

func (*Client) RestartCurrentApp

func (c *Client) RestartCurrentApp(ctx context.Context) (AppStatus, error)

RestartCurrentApp restarts whichever app is currently running.

func (*Client) RestartDaemon

func (c *Client) RestartDaemon(ctx context.Context) (string, error)

RestartDaemon restarts the daemon process, which re-initializes its connection to the motor/hardware backend. Useful when a joint has silently dropped off the control loop (no error reported, motor mode still "enabled", but it stops responding to position commands) -- cycling motor mode alone does not fix that, but a daemon restart does. Returns the daemon's internal job ID for the restart operation; the restart is asynchronous and briefly interrupts connectivity, so poll GetDaemonStatus afterward rather than assuming it's done when this returns.

func (*Client) SetMicrophoneVolume

func (c *Client) SetMicrophoneVolume(ctx context.Context, volume int) (VolumeInfo, error)

SetMicrophoneVolume sets the microphone volume (0-100).

func (*Client) SetMotorMode

func (c *Client) SetMotorMode(ctx context.Context, mode MotorControlMode) error

SetMotorMode changes the robot's motor control mode (e.g. enabling/disabling torque).

func (*Client) SetTarget

func (c *Client) SetTarget(ctx context.Context, target FullBodyTarget) error

SetTarget directly commands a target pose with no interpolation (lower latency than Goto, useful for teleop). For continuous streaming control, use StreamSetTarget instead.

func (*Client) SetVolume

func (c *Client) SetVolume(ctx context.Context, volume int) (VolumeInfo, error)

SetVolume sets the speaker volume (0-100).

func (*Client) StartApp

func (c *Client) StartApp(ctx context.Context, appName string) (AppStatus, error)

StartApp starts appName (stopping any currently running app first).

func (*Client) Stop

func (c *Client) Stop(ctx context.Context, uuid MoveUUID) error

Stop halts the move identified by uuid (as returned by Goto, WakeUp, GotoSleep, or PlayRecordedMoveDataset; see also ListRunningMoves).

func (*Client) StopCurrentApp

func (c *Client) StopCurrentApp(ctx context.Context) error

StopCurrentApp stops whichever app is currently running.

func (*Client) StopSound

func (c *Client) StopSound(ctx context.Context) error

StopSound stops whatever sound is currently playing.

func (*Client) StreamCameraFrames

func (c *Client) StreamCameraFrames(ctx context.Context, opts CameraStreamOptions) (<-chan Frame, <-chan error, error)

StreamCameraFrames connects to the daemon's WebRTC camera feed and decodes it to raw RGB frames, delivered on the returned channel until ctx is cancelled. Requires an `ffmpeg` binary on PATH (or set opts.FFmpegPath).

The negotiated video codec isn't known until after WebRTC negotiation completes, so the decoder is started lazily from the OnTrack callback. Verified live end-to-end against Pollen's desktop simulator (signalling, WebRTC negotiation, VP8 depacketization, IVF muxing, and ffmpeg decode all confirmed producing real, correctly-decoded frames). Real hardware has been observed (in the daemon's own source) to use hardware H.264 on Raspberry Pi instead -- both codecs are handled here, but only the VP8 path has actually been exercised against a live producer so far.

func (*Client) StreamFullState

func (c *Client) StreamFullState(ctx context.Context) (<-chan FullState, <-chan error, error)

StreamFullState streams FullState frames from WS /api/state/ws/full until ctx is cancelled. The returned channels are closed when the stream ends; drain errs (buffered, size 1) to see why.

func (*Client) StreamSetTarget

func (c *Client) StreamSetTarget(ctx context.Context) (chan<- FullBodyTarget, <-chan error, error)

StreamSetTarget opens WS /api/move/ws/set_target and forwards every FullBodyTarget sent on the returned channel to the robot, until ctx is cancelled or the channel is closed. Useful for continuous/teleop control (e.g. driving the head from a joystick loop) where the lower per-call latency of a persistent connection matters; for one-off commands use SetTarget instead.

func (*Client) TestSound

func (c *Client) TestSound(ctx context.Context) (TestSoundResult, error)

TestSound plays a short sound at the current volume -- useful for letting a user confirm audio is working after changing the volume.

func (*Client) UpdateApp

func (c *Client) UpdateApp(ctx context.Context, appName string) (map[string]string, error)

UpdateApp updates appName to its latest available version.

func (*Client) UploadSound

func (c *Client) UploadSound(ctx context.Context, localPath string) error

UploadSound uploads the local file at localPath to the robot's sound library.

func (*Client) WakeUp

func (c *Client) WakeUp(ctx context.Context) (MoveUUID, error)

WakeUp plays the robot's built-in wake-up move.

type ControlLoopStats

type ControlLoopStats struct {
	MeanControlLoopFrequency float64 `json:"mean_control_loop_frequency"`
	MaxControlLoopInterval   float64 `json:"max_control_loop_interval"`
	NbError                  int     `json:"nb_error"`
	MotorController          string  `json:"motor_controller"`
}

ControlLoopStats reports low-level motor control loop timing/health.

type DaemonStatus

type DaemonStatus struct {
	Type              string        `json:"type"`
	RobotName         string        `json:"robot_name"`
	State             string        `json:"state"`
	WirelessVersion   bool          `json:"wireless_version"`
	DesktopAppDaemon  bool          `json:"desktop_app_daemon"`
	SimulationEnabled bool          `json:"simulation_enabled"`
	MockupSimEnabled  bool          `json:"mockup_sim_enabled"`
	NoMedia           bool          `json:"no_media"`
	MediaReleased     bool          `json:"media_released"`
	CameraSpecsName   string        `json:"camera_specs_name"`
	BackendStatus     BackendStatus `json:"backend_status"`
	Error             any           `json:"error"`
	WlanIP            string        `json:"wlan_ip"`
	Version           string        `json:"version"`
	HardwareID        string        `json:"hardware_id"`
}

DaemonStatus is the response of GET /api/daemon/status.

type DoAInfo

type DoAInfo struct {
	Angle          float64 `json:"angle"`
	SpeechDetected bool    `json:"speech_detected"`
}

DoAInfo is the robot's direction-of-arrival (sound source) estimate.

type Frame

type Frame struct {
	Width, Height int
	RGB           []byte
	Timestamp     time.Time
}

Frame is one decoded video frame from StreamCameraFrames: 8-bit RGB, row-major, Width*Height*3 bytes.

type FullBodyTarget

type FullBodyTarget struct {
	TargetHeadPose *Pose       `json:"target_head_pose,omitempty"`
	TargetAntennas *[2]float64 `json:"target_antennas,omitempty"`
	TargetBodyYaw  *float64    `json:"target_body_yaw,omitempty"`
	Timestamp      *time.Time  `json:"timestamp,omitempty"`
}

FullBodyTarget is the body of POST /api/move/set_target and each frame of WS /api/move/ws/set_target.

type FullState

type FullState struct {
	ControlMode      *MotorControlMode `json:"control_mode,omitempty"`
	HeadPose         *Pose             `json:"head_pose,omitempty"`
	HeadJoints       []float64         `json:"head_joints,omitempty"`
	BodyYaw          *float64          `json:"body_yaw,omitempty"`
	AntennasPosition []float64         `json:"antennas_position,omitempty"`
	PassiveJoints    []float64         `json:"passive_joints,omitempty"`
	DoA              *DoAInfo          `json:"doa,omitempty"`
	Timestamp        *time.Time        `json:"timestamp,omitempty"`
}

FullState is the response of GET /api/state/full and each frame of WS /api/state/ws/full.

type GotoRequest

type GotoRequest struct {
	HeadPose      *Pose                  `json:"head_pose,omitempty"`
	Antennas      *[2]float64            `json:"antennas,omitempty"`
	BodyYaw       *float64               `json:"body_yaw,omitempty"`
	Duration      float64                `json:"duration"`
	Interpolation InterpolationTechnique `json:"interpolation"`
}

GotoRequest is the body of POST /api/move/goto.

type InterpolationTechnique

type InterpolationTechnique string

InterpolationTechnique selects how `Goto` blends between the current and target pose. Verified against a live daemon's /openapi.json.

const (
	InterpolationLinear    InterpolationTechnique = "linear"
	InterpolationMinJerk   InterpolationTechnique = "minjerk"
	InterpolationEaseInOut InterpolationTechnique = "ease_in_out"
	InterpolationCartoon   InterpolationTechnique = "cartoon"
)

type JobInfo

type JobInfo struct {
	Command string    `json:"command"`
	Status  JobStatus `json:"status"`
	Logs    []string  `json:"logs"`
}

JobInfo is the status of an async app install/update job (see InstallApp, InstallPrivateSpace, UpdateApp).

type JobStatus

type JobStatus string

JobStatus is the status of an async install/update job.

const (
	JobStatusPending    JobStatus = "pending"
	JobStatusInProgress JobStatus = "in_progress"
	JobStatusDone       JobStatus = "done"
	JobStatusFailed     JobStatus = "failed"
)

type Matrix4x4Pose

type Matrix4x4Pose struct {
	M [16]float64 `json:"m"`
}

Matrix4x4Pose is a raw row-major 4x4 homogeneous transform.

type MotorControlMode

type MotorControlMode string

MotorControlMode selects the robot's motor control mode. Verified against a live daemon's /openapi.json.

const (
	MotorModeEnabled             MotorControlMode = "enabled"
	MotorModeDisabled            MotorControlMode = "disabled"
	MotorModeGravityCompensation MotorControlMode = "gravity_compensation"
)

type MotorStatus

type MotorStatus struct {
	Mode MotorControlMode `json:"mode"`
}

MotorStatus is the response of GET /api/motors/status.

type MoveUUID

type MoveUUID struct {
	UUID string `json:"uuid"`
}

MoveUUID identifies a move started via Goto, WakeUp, GotoSleep, or PlayRecordedMoveDataset, for use with Stop/ws/updates.

type Pose

type Pose struct {
	XYZRPY *XYZRPYPose
	Matrix *Matrix4x4Pose
}

Pose mirrors the daemon's `AnyPose = XYZRPYPose | Matrix4x4Pose` union. Exactly one of XYZRPY or Matrix should be set.

func NewMatrixPose

func NewMatrixPose(m [16]float64) *Pose

NewMatrixPose builds a Pose from a raw 4x4 transform.

func NewXYZRPYPose

func NewXYZRPYPose(x, y, z, roll, pitch, yaw float64) *Pose

NewXYZRPYPose builds a Pose from Cartesian position and roll/pitch/yaw.

func (Pose) MarshalJSON

func (p Pose) MarshalJSON() ([]byte, error)

MarshalJSON emits whichever variant is set. The daemon's Pydantic model distinguishes the union by field shape rather than an explicit tag, so we match on the presence of the "m" field (verified against a live daemon's /openapi.json: XYZRPYPose has no "m" field, Matrix4x4Pose requires one).

func (*Pose) UnmarshalJSON

func (p *Pose) UnmarshalJSON(data []byte) error

type ReadAudioParameterResponse

type ReadAudioParameterResponse struct {
	Name   string    `json:"name"`
	Values []float64 `json:"values"`
}

ReadAudioParameterResponse is the response of GET /api/audio/config/parameter/{name}.

type ResolutionInfo

type ResolutionInfo struct {
	Name       string  `json:"name"`
	Width      int     `json:"width"`
	Height     int     `json:"height"`
	FPS        int     `json:"fps"`
	CropFactor float64 `json:"crop_factor"`
}

ResolutionInfo is a single camera resolution entry.

type SourceKind

type SourceKind string

SourceKind is where an app comes from.

const (
	SourceKindHFSpace            SourceKind = "hf_space"
	SourceKindDashboardSelection SourceKind = "dashboard_selection"
	SourceKindLocal              SourceKind = "local"
	SourceKindInstalled          SourceKind = "installed"
)

type TestSoundResult

type TestSoundResult struct {
	Status  string `json:"status"`
	Message string `json:"message"`
}

TestSoundResult is the response of POST /api/volume/test-sound.

type VolumeInfo

type VolumeInfo struct {
	Volume   int    `json:"volume"`
	Platform string `json:"platform"`
	Device   string `json:"device"`
}

VolumeInfo reports the current volume level for a device.

type XYZRPYPose

type XYZRPYPose struct {
	X     float64 `json:"x"`
	Y     float64 `json:"y"`
	Z     float64 `json:"z"`
	Roll  float64 `json:"roll"`
	Pitch float64 `json:"pitch"`
	Yaw   float64 `json:"yaw"`
}

XYZRPYPose is a Cartesian position plus roll/pitch/yaw orientation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL