fake

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package fake implements a fake encoder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder struct {
	generic.Unimplemented
	// contains filtered or unexported fields
}

Encoder keeps track of a fake motor position.

func (*Encoder) GetTicksCount

func (e *Encoder) GetTicksCount(ctx context.Context, extra map[string]interface{}) (int64, error)

GetTicksCount returns the current position in terms of ticks.

func (*Encoder) Reset

func (e *Encoder) Reset(ctx context.Context, offset int64, extra map[string]interface{}) error

Reset sets the current position of the motor (adjusted by a given offset) to be its new zero position.

func (*Encoder) SetPosition

func (e *Encoder) SetPosition(ctx context.Context, position int64) error

SetPosition sets the position of the encoder.

func (*Encoder) SetSpeed

func (e *Encoder) SetSpeed(ctx context.Context, speed float64) error

SetSpeed sets the speed of the fake motor the encoder is measuring.

func (*Encoder) Start

func (e *Encoder) Start(cancelCtx context.Context)

Start starts a background thread to run the encoder.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL