Documentation ¶
Overview ¶
Package incremental implements an incremental encoder
Index ¶
- func NewIncrementalEncoder(ctx context.Context, deps resource.Dependencies, conf resource.Config, ...) (encoder.Encoder, error)
- type Config
- type Encoder
- func (e *Encoder) Close(ctx context.Context) error
- func (e *Encoder) Position(ctx context.Context, positionType encoder.PositionType, ...) (float64, encoder.PositionType, error)
- func (e *Encoder) Properties(ctx context.Context, extra map[string]interface{}) (map[encoder.Feature]bool, error)
- func (e *Encoder) RawPosition() int64
- func (e *Encoder) Reconfigure(ctx context.Context, deps resource.Dependencies, conf resource.Config) error
- func (e *Encoder) ResetPosition(ctx context.Context, extra map[string]interface{}) error
- func (e *Encoder) Start(ctx context.Context)
- type Pins
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Encoder ¶
type Encoder struct { resource.Named A, B board.DigitalInterrupt // TODO(RSDK-2672): This is exposed for tests and should be unexported with // the constructor being used instead. CancelCtx context.Context // contains filtered or unexported fields }
Encoder keeps track of a motor position using a rotary incremental encoder.
func (*Encoder) Position ¶ added in v0.2.50
func (e *Encoder) Position( ctx context.Context, positionType encoder.PositionType, extra map[string]interface{}, ) (float64, encoder.PositionType, error)
Position returns the current position in terms of ticks or degrees, and whether it is a relative or absolute position.
func (*Encoder) Properties ¶ added in v0.2.50
func (e *Encoder) Properties(ctx context.Context, extra map[string]interface{}) (map[encoder.Feature]bool, error)
Properties returns a list of all the position types that are supported by a given encoder.
func (*Encoder) RawPosition ¶
RawPosition returns the raw position of the encoder.
func (*Encoder) Reconfigure ¶ added in v0.2.36
func (e *Encoder) Reconfigure( ctx context.Context, deps resource.Dependencies, conf resource.Config, ) error
Reconfigure atomically reconfigures this encoder in place based on the new config.
func (*Encoder) ResetPosition ¶
ResetPosition sets the current position of the motor (adjusted by a given offset) to be its new zero position.
Click to show internal directories.
Click to hide internal directories.