gripper

package
v0.53.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: AGPL-3.0 Imports: 12 Imported by: 2

Documentation

Overview

Package gripper contains a gRPC based gripper client.

Package gripper defines a robotic gripper. For more information, see the gripper component docs.

Package gripper contains a gRPC based gripper service server.

Index

Constants

View Source
const SubtypeName = "gripper"

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

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 Gripper) (*commonpb.ActuatorStatus, error)

CreateStatus creates a status from the gripper.

func Named

func Named(name string) resource.Name

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

func NamesFromRobot

func NamesFromRobot(r robot.Robot) []string

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

func NewRPCServiceServer added in v0.2.36

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

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

Types

type Gripper

type Gripper interface {
	resource.Resource
	resource.Shaped
	resource.Actuator
	referenceframe.ModelFramer

	// Open opens the gripper.
	// This will block until done or a new operation cancels this one.
	Open(ctx context.Context, extra map[string]interface{}) error

	// Grab makes the gripper grab.
	// returns true if we grabbed something.
	// This will block until done or a new operation cancels this one.
	Grab(ctx context.Context, extra map[string]interface{}) (bool, error)
}

A Gripper represents a physical robotic gripper. For more information, see the gripper component docs.

Open example:

myGripper, err := gripper.FromRobot(machine, "my_gripper")

// Open the gripper.
err := myGripper.Open(context.Background(), nil)

Grab example:

myGripper, err := gripper.FromRobot(machine, "my_gripper")

// Grab with the gripper.
grabbed, err := myGripper.Grab(context.Background(), nil)

func FromRobot

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

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

func NewClientFromConn

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

NewClientFromConn constructs a new Client from connection passed in.

Directories

Path Synopsis
Package fake implements a fake gripper.
Package fake implements a fake gripper.
Package register registers all relevant grippers and also API specific functions
Package register registers all relevant grippers and also API specific functions

Jump to

Keyboard shortcuts

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