robot

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: AGPL-3.0 Imports: 11 Imported by: 3

Documentation

Overview

Package robot defines the robot which is the root of all robotic parts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllResourcesByName

func AllResourcesByName(r Robot, name string) []interface{}

AllResourcesByName returns an array of all resources that have this simple name.

func NamesBySubtype

func NamesBySubtype(r Robot, subtype resource.Subtype) []string

NamesBySubtype is a helper for getting all names from the given Robot given the subtype.

Types

type LocalRobot

type LocalRobot interface {
	Robot

	// Config returns the local config used to construct the robot.
	// This is allowed to be partial or empty.
	Config(ctx context.Context) (*config.Config, error)

	// Reconfigure instructs the robot to safely reconfigure itself based
	// on the given new config.
	Reconfigure(ctx context.Context, newConfig *config.Config)

	// StartWeb starts the web server, will return an error if server is already up.
	StartWeb(ctx context.Context, o weboptions.Options) error

	// StopWeb stops the web server, will be a noop if server is not up.
	StopWeb() error
}

A LocalRobot is a Robot that can have its parts modified.

type Refresher

type Refresher interface {
	// Refresh instructs the Robot to manually refresh the contents of itself.
	Refresh(ctx context.Context) error
}

A Refresher can refresh the contents of a robot.

type RemoteRobot

type RemoteRobot interface {
	Robot

	// Connected returns whether the remote is connected or not.
	Connected() bool
}

A RemoteRobot is a Robot that was created through a connection.

type Robot

type Robot interface {
	// DiscoverComponents returns discovered component configurations.
	DiscoverComponents(ctx context.Context, qs []discovery.Query) ([]discovery.Discovery, error)

	// RemoteByName returns a remote robot by name.
	RemoteByName(name string) (Robot, bool)

	// ResourceByName returns a resource by name
	ResourceByName(name resource.Name) (interface{}, error)

	// RemoteNames returns the name of all known remote robots.
	RemoteNames() []string

	// ResourceNames returns a list of all known resource names.
	ResourceNames() []resource.Name

	// ResourceRPCSubtypes returns a list of all known resource RPC subtypes.
	ResourceRPCSubtypes() []resource.RPCSubtype

	// ProcessManager returns the process manager for the robot.
	ProcessManager() pexec.ProcessManager

	// OperationManager returns the operation manager the robot is using.
	OperationManager() *operation.Manager

	// Logger returns the logger the robot is using.
	Logger() golog.Logger

	// FrameSystemConfig returns the individual parts that make up a robot's frame system
	FrameSystemConfig(ctx context.Context, additionalTransforms []*commonpb.Transform) (framesystemparts.Parts, error)

	// TransformPose will transform the pose of the requested poseInFrame to the desired frame in the robot's frame system.
	TransformPose(
		ctx context.Context,
		pose *referenceframe.PoseInFrame,
		dst string,
		additionalTransforms []*commonpb.Transform,
	) (*referenceframe.PoseInFrame, error)

	// GetStatus takes a list of resource names and returns their corresponding statuses. If no names are passed in, return all statuses.
	GetStatus(ctx context.Context, resourceNames []resource.Name) ([]Status, error)

	// Close attempts to cleanly close down all constituent parts of the robot.
	Close(ctx context.Context) error

	// StopAll cancels all current and outstanding operations for the robot and stops all actuators and movement
	StopAll(ctx context.Context, extra map[resource.Name]map[string]interface{}) error
}

A Robot encompasses all functionality of some robot comprised of parts, local and remote.

type Status

type Status struct {
	Name   resource.Name
	Status interface{}
}

Status holds a resource name and its corresponding status. Status is expected to be comprised of string keys and values comprised of primitives, list of primitives, maps with string keys (or at least can be decomposed into one), or lists of the forementioned type of maps. Results with other types of data are not guaranteed.

Directories

Path Synopsis
Package framesystem defines and implements the concept of a frame system.
Package framesystem defines and implements the concept of a frame system.
parts
Package framesystemparts provides functionality around a list of framesystem parts
Package framesystemparts provides functionality around a list of framesystem parts
Package robotimpl defines implementations of robot.Robot and robot.LocalRobot.
Package robotimpl defines implementations of robot.Robot and robot.LocalRobot.
web
Package web provides gRPC/REST/GUI APIs to control and monitor a robot.
Package web provides gRPC/REST/GUI APIs to control and monitor a robot.
options
Package weboptions provides Options for configuring a web server
Package weboptions provides Options for configuring a web server
stream
Package webstream provides controls for streaming from the web server.
Package webstream provides controls for streaming from the web server.

Jump to

Keyboard shortcuts

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