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, s Servo) (*pb.Status, error)
- func Named(name string) resource.Name
- func NamesFromRobot(r robot.Robot) []string
- func NewPositionCollector(resource interface{}, params data.CollectorParams) (data.Collector, error)
- func NewRPCServiceServer(coll resource.APIResourceCollection[Servo]) interface{}
- type Servo
Constants ¶
const SubtypeName = "servo"
SubtypeName is a constant that identifies the component resource API string "servo".
Variables ¶
var API = resource.APINamespaceRDK.WithComponentType(SubtypeName)
API is a variable that identifies the component resource API.
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 NewPositionCollector ¶ added in v0.13.0
func NewPositionCollector(resource interface{}, params data.CollectorParams) (data.Collector, error)
NewPositionCollector returns a collector to register a position method. If one is already registered with the same MethodMetadata it will panic.
func NewRPCServiceServer ¶ added in v0.2.36
func NewRPCServiceServer(coll resource.APIResourceCollection[Servo]) interface{}
NewRPCServiceServer constructs a servo gRPC service server. It is intentionally untyped to prevent use outside of tests.
Types ¶
type Servo ¶
type Servo interface { resource.Resource resource.Actuator // 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 uint32, extra map[string]interface{}) error // Position returns the current set angle (degrees) of the servo. Position(ctx context.Context, extra map[string]interface{}) (uint32, error) }
A Servo represents a physical servo connected to a board.
Directories ¶
Path | Synopsis |
---|---|
Package fake implements a fake servo.
|
Package fake implements a fake servo. |
Package gpio implements a pin based servo
|
Package gpio implements a pin based servo |
Package register registers all relevant servos
|
Package register registers all relevant servos |