curves

package
v0.0.0-...-2f3587d Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SpeedCurveMap = map[string]SpeedCurve{}
)

Functions

This section is empty.

Types

type FunctionSpeedCurve

type FunctionSpeedCurve struct {
	Config configuration.CurveConfig `json:"config"`
	Value  int                       `json:"value"`
}

func (*FunctionSpeedCurve) Evaluate

func (c *FunctionSpeedCurve) Evaluate() (value int, err error)

func (*FunctionSpeedCurve) GetId

func (c *FunctionSpeedCurve) GetId() string

type LinearSpeedCurve

type LinearSpeedCurve struct {
	Config configuration.CurveConfig `json:"config"`
	Value  int                       `json:"value"`
}

func (*LinearSpeedCurve) Evaluate

func (c *LinearSpeedCurve) Evaluate() (value int, err error)

func (*LinearSpeedCurve) GetId

func (c *LinearSpeedCurve) GetId() string

type PidSpeedCurve

type PidSpeedCurve struct {
	Config configuration.CurveConfig `json:"config"`
	Value  int                       `json:"value"`
	// contains filtered or unexported fields
}

func (*PidSpeedCurve) Evaluate

func (c *PidSpeedCurve) Evaluate() (value int, err error)

func (*PidSpeedCurve) GetId

func (c *PidSpeedCurve) GetId() string

type SpeedCurve

type SpeedCurve interface {
	GetId() string
	// Evaluate calculates the current value of the given curve,
	// returns a value in [0..255]
	Evaluate() (value int, err error)
}

func NewSpeedCurve

func NewSpeedCurve(config configuration.CurveConfig) (SpeedCurve, error)

Jump to

Keyboard shortcuts

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