Documentation ¶
Overview ¶
Package fake implements a fake encoder.
Index ¶
- type AttrConfig
- type Encoder
- func (e *Encoder) Reset(ctx context.Context, offset float64, extra map[string]interface{}) error
- func (e *Encoder) SetPosition(ctx context.Context, position int64) error
- func (e *Encoder) SetSpeed(ctx context.Context, speed float64) error
- func (e *Encoder) Start(cancelCtx context.Context)
- func (e *Encoder) TicksCount(ctx context.Context, extra map[string]interface{}) (float64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttrConfig ¶
type AttrConfig struct {
UpdateRate int64 `json:"update_rate_msec"`
}
AttrConfig describes the configuration of a fake encoder.
func (*AttrConfig) Validate ¶
func (cfg *AttrConfig) Validate(path string) error
Validate ensures all parts of a config is valid.
type Encoder ¶
type Encoder struct { generic.Unimplemented // contains filtered or unexported fields }
Encoder keeps track of a fake motor position.
func (*Encoder) Reset ¶
Reset sets the current position of the motor (adjusted by a given offset) to be its new zero position.
func (*Encoder) SetPosition ¶
SetPosition sets the position of the encoder.
Click to show internal directories.
Click to hide internal directories.