ros

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package ros is CSF's boundary to the low-level spine controller. The spine is the fast controller that drives hardware; it is external and ROS-side, not part of CSF. CSF reaches it over the network, so the boundary is an ipc capability: a caller is granted an ISpine through its constructor and never interprets a controller program in-process.

The seam is the shared contract proto/candace/brainspine/v1: CSF submits an Action and observes an Observation. No ROS transport ships yet; the DisconnectedSpine answers every call with a NotConnectedError so callers render "no spine connected" instead of failing.

Index

Constants

View Source
const NotConnectedReason = "no_spine_connected"

NotConnectedReason is the machine-facing reason a fallback Action carries when no spine is connected.

View Source
const NotConnectedStatus = "no spine connected"

NotConnectedStatus is the human-facing status a caller renders when no spine is connected. It is a stable string: views and tests match it.

Variables

This section is empty.

Functions

func IsNotConnected

func IsNotConnected(err error) bool

IsNotConnected reports whether err, or any error it wraps, is a NotConnectedError.

func Status

func Status(ctx context.Context, spine ISpine) string

Status is the human-facing problem a view renders for spine, or the empty string when an observation succeeds. A nil spine, or one whose observation reports NotConnectedError, renders NotConnectedStatus; any other observation failure is rendered with its cause rather than hidden.

Types

type DisconnectedSpine

type DisconnectedSpine struct{}

DisconnectedSpine is the spine stub: no transport and no state. Every call returns a NotConnectedError, or the context's error once ctx is done. It is immutable, so one value is safe to share between goroutines.

func NewDisconnectedSpine

func NewDisconnectedSpine() *DisconnectedSpine

NewDisconnectedSpine returns the stub spine a CSF host is granted until a ROS transport is configured.

func (*DisconnectedSpine) Observe

Observe never reaches a controller.

func (*DisconnectedSpine) Submit

func (spine *DisconnectedSpine) Submit(ctx context.Context, action *brainspinev1.Action) error

Submit never reaches a controller.

type ISpine

type ISpine interface {
	// Submit proposes one action to the spine.
	Submit(ctx context.Context, action *brainspinev1.Action) error
	// Observe returns the spine's latest observation.
	Observe(ctx context.Context) (*brainspinev1.Observation, error)
}

ISpine is the low-level controller as CSF sees it. A submitted action is a proposal for the spine to admit; the spine owns admission, actuation and its own fail-safe behavior.

type NotConnectedError

type NotConnectedError struct {
	// Operation is the call that found no spine.
	Operation Operation
}

NotConnectedError reports that no spine is connected for an operation.

func (*NotConnectedError) Error

func (failure *NotConnectedError) Error() string

type Operation

type Operation string

Operation names a call across the spine boundary.

const (
	// OperationSubmit hands the spine one proposed action.
	OperationSubmit Operation = "submit"
	// OperationObserve reads the spine's latest observation.
	OperationObserve Operation = "observe"
)

Jump to

Keyboard shortcuts

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