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 ¶
const SubtypeName = "gripper"
SubtypeName is a constant that identifies the component resource API string.
Variables ¶
var API = resource.APINamespaceRDK.WithComponentType(SubtypeName)
API is a variable that identifies the component resource API.
var ErrGeometriesNil = func(gripperName string) error {
return fmt.Errorf("gripper component %v Geometries should not return nil geometries", gripperName)
}
ErrGeometriesNil is the returned error if gripper geometries are nil.
Functions ¶
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)
For more information, see the Open method docs.
Grab example:
myGripper, err := gripper.FromRobot(machine, "my_gripper")
// Grab with the gripper.
grabbed, err := myGripper.Grab(context.Background(), nil)
For more information, see the Grab method docs.
func FromDependencies ¶ added in v0.61.0
func FromDependencies(deps resource.Dependencies, name string) (Gripper, error)
FromDependencies is a helper for getting the named gripper from a collection of dependencies.
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.