Documentation ¶
Overview ¶
Package servo contains a gRPC bases servo client
Package servo contains a gRPC based servo service server
Index ¶
- Constants
- Variables
- func CreateStatus(ctx context.Context, resource interface{}) (*pb.Status, error)
- func Named(name string) resource.Name
- func NamesFromRobot(r robot.Robot) []string
- func NewServer(service subtype.Service) pb.ServoServiceServer
- func NewUnimplementedInterfaceError(actual interface{}) error
- func NewUnimplementedLocalInterfaceError(actual interface{}) error
- func WrapWithReconfigurable(r interface{}) (resource.Reconfigurable, error)
- type LocalServo
- type Position
- type Servo
Constants ¶
const SubtypeName = resource.SubtypeName("servo")
SubtypeName is a constant that identifies the component resource subtype string "servo".
Variables ¶
var Subtype = resource.NewSubtype( resource.ResourceNamespaceRDK, resource.ResourceTypeComponent, SubtypeName, )
Subtype is a constant that identifies the component resource subtype.
Functions ¶
func CreateStatus ¶
CreateStatus creates a status from the servo.
func NamesFromRobot ¶
NamesFromRobot is a helper for getting all servo names from the given Robot.
func NewServer ¶
func NewServer(service subtype.Service) pb.ServoServiceServer
NewServer constructs a servo gRPC service server.
func NewUnimplementedInterfaceError ¶
func NewUnimplementedInterfaceError(actual interface{}) error
NewUnimplementedInterfaceError is used when there is a failed interface check.
func NewUnimplementedLocalInterfaceError ¶
func NewUnimplementedLocalInterfaceError(actual interface{}) error
NewUnimplementedLocalInterfaceError is used when there is a failed interface check.
func WrapWithReconfigurable ¶
func WrapWithReconfigurable(r interface{}) (resource.Reconfigurable, error)
WrapWithReconfigurable converts a regular Servo implementation to a reconfigurableServo. If servo is already a reconfigurableServo, then nothing is done.
Types ¶
type LocalServo ¶
type LocalServo interface { Servo resource.MovingCheckable }
A LocalServo represents a Servo that can report whether it is moving or not.
type Position ¶ added in v0.1.2
type Position struct {
Position uint8
}
Position wraps the returned set angle (degrees) value.
type Servo ¶
type Servo interface { // Move moves the servo to the given angle (0-180 degrees) // This will block until done or a new operation cancels this one Move(ctx context.Context, angleDeg uint8) error // Position returns the current set angle (degrees) of the servo. Position(ctx context.Context) (uint8, error) // Stop stops the servo. It is assumed the servo stops immediately. Stop(ctx context.Context) error generic.Generic }
A Servo represents a physical servo connected to a board.
func NewClientFromConn ¶
func NewClientFromConn(ctx context.Context, conn rpc.ClientConn, name string, logger golog.Logger) Servo
NewClientFromConn constructs a new Client from connection passed in.