gantry

package
v0.32.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package gantry contains a gRPC based gantry client.

Package gantry contains a gRPC based gantry service server.

Index

Constants

View Source
const SubtypeName = "gantry"

SubtypeName is a constant that identifies the component resource API string "gantry".

Variables

View Source
var API = resource.APINamespaceRDK.WithComponentType(SubtypeName)

API is a variable that identifies the component resource API.

Functions

func CreateStatus

func CreateStatus(ctx context.Context, g Gantry) (*pb.Status, error)

CreateStatus creates a status from the gantry.

func Named

func Named(name string) resource.Name

Named is a helper for getting the named Gantry's typed resource name.

func NamesFromRobot

func NamesFromRobot(r robot.Robot) []string

NamesFromRobot is a helper for getting all gantry names from the given Robot.

func NewRPCServiceServer added in v0.2.36

func NewRPCServiceServer(coll resource.APIResourceCollection[Gantry]) interface{}

NewRPCServiceServer constructs an gantry gRPC service server. It is intentionally untyped to prevent use outside of tests.

Types

type Gantry

type Gantry interface {
	resource.Resource
	resource.Actuator
	referenceframe.ModelFramer
	referenceframe.InputEnabled

	// Position returns the position in meters.
	Position(ctx context.Context, extra map[string]interface{}) ([]float64, error)

	// MoveToPosition is in meters.
	// This will block until done or a new operation cancels this one.
	MoveToPosition(ctx context.Context, positionsMm, speedsMmPerSec []float64, extra map[string]interface{}) error

	// Lengths is the length of gantries in meters.
	Lengths(ctx context.Context, extra map[string]interface{}) ([]float64, error)

	// Home runs the homing sequence of the gantry and returns true once completed.
	Home(ctx context.Context, extra map[string]interface{}) (bool, error)
}

Gantry is used for controlling gantries of N axis.

Position example:

myGantry, err := gantry.FromRobot(machine, "my_gantry")

// Get the current positions of the axes of the gantry in millimeters.
position, err := myGantry.Position(context.Background(), nil)

MoveToPosition example:

myGantry, err := gantry.FromRobot(machine, "my_gantry")

// Create a list of positions for the axes of the gantry to move to.
// Assume in this example that the gantry is multi-axis, with 3 axes.
examplePositions := []float64{1, 2, 3}

exampleSpeeds := []float64{3, 9, 12}

// Move the axes of the gantry to the positions specified.
myGantry.MoveToPosition(context.Background(), examplePositions, exampleSpeeds, nil)

Lengths example:

myGantry, err := gantry.FromRobot(machine, "my_gantry")

// Get the lengths of the axes of the gantry in millimeters.
lengths_mm, err := myGantry.Lengths(context.Background(), nil)

Home example:

myGantry, err := gantry.FromRobot(machine, "my_gantry")

myGantry.Home(context.Background(), nil)

func FromDependencies

func FromDependencies(deps resource.Dependencies, name string) (Gantry, error)

FromDependencies is a helper for getting the named gantry from a collection of dependencies.

func FromRobot

func FromRobot(r robot.Robot, name string) (Gantry, error)

FromRobot is a helper for getting the named gantry from the given Robot.

func NewClientFromConn

func NewClientFromConn(
	ctx context.Context,
	conn rpc.ClientConn,
	remoteName string,
	name resource.Name,
	logger logging.Logger,
) (Gantry, error)

NewClientFromConn constructs a new Client from connection passed in.

Directories

Path Synopsis
Package fake implements a fake gantry.
Package fake implements a fake gantry.
Package multiaxis implements a multi-axis gantry.
Package multiaxis implements a multi-axis gantry.
Package register registers all relevant gantries
Package register registers all relevant gantries
Package singleaxis implements a single-axis gantry.
Package singleaxis implements a single-axis gantry.

Jump to

Keyboard shortcuts

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