throttle

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.7.0

type Config struct {
	SteeringValues []types.Steering `json:"steering_values"`
	ThrottleSteps  []types.Throttle `json:"throttle_steps"`
}

func NewConfigFromJson added in v0.7.0

func NewConfigFromJson(fileName string) (*Config, error)

func (*Config) ValueOf added in v0.7.0

func (tc *Config) ValueOf(s types.Steering) types.Throttle

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func New

func New(client mqtt.Client, throttleTopic, driveModeTopic, rcThrottleTopic, steeringTopic, throttleFeedbackTopic,
	maxThrottleCtrlTopic, speedZoneTopic string,
	maxValue types.Throttle, publishPilotFrequency int, opts ...Option) *Controller

func (*Controller) Start

func (c *Controller) Start() error

func (*Controller) Stop

func (c *Controller) Stop()

type CustomSteeringProcessor added in v0.7.0

type CustomSteeringProcessor struct {
	// contains filtered or unexported fields
}

func NewCustomSteeringProcessor added in v0.7.0

func NewCustomSteeringProcessor(cfg *Config) *CustomSteeringProcessor

func (*CustomSteeringProcessor) Process added in v0.7.0

func (cp *CustomSteeringProcessor) Process(steering types.Steering) types.Throttle

func (*CustomSteeringProcessor) SetSpeedZone added in v0.7.0

func (cp *CustomSteeringProcessor) SetSpeedZone(_ events.SpeedZone)

type Option

type Option func(c *Controller)

func WithBrakeController

func WithBrakeController(bc brake.Controller) Option

func WithThrottleProcessor added in v0.7.0

func WithThrottleProcessor(p Processor) Option

type Processor added in v0.7.0

type Processor interface {
	// Process compute throttle from steering value
	Process(steering types.Steering) types.Throttle

	SetSpeedZone(sz events.SpeedZone)
}

type SpeedZoneProcessor added in v0.7.0

type SpeedZoneProcessor struct {
	// contains filtered or unexported fields
}

func NewSpeedZoneProcessor added in v0.7.0

func NewSpeedZoneProcessor(slowThrottle, normalThrottle, fastThrottle types.Throttle,
	moderateSteering, fullSteering float64) *SpeedZoneProcessor

func (*SpeedZoneProcessor) Process added in v0.7.0

func (sp *SpeedZoneProcessor) Process(steering types.Steering) types.Throttle

Process compute throttle from steering value

func (*SpeedZoneProcessor) SetSpeedZone added in v0.7.0

func (sp *SpeedZoneProcessor) SetSpeedZone(sz events.SpeedZone)

func (*SpeedZoneProcessor) SpeedZone added in v0.7.0

func (sp *SpeedZoneProcessor) SpeedZone() events.SpeedZone

type SteeringProcessor

type SteeringProcessor struct {
	// contains filtered or unexported fields
}

func NewSteeringProcessor added in v0.7.0

func NewSteeringProcessor(minThrottle, maxThrottle types.Throttle) *SteeringProcessor

func (*SteeringProcessor) Process

func (sp *SteeringProcessor) Process(steering types.Steering) types.Throttle

Process compute throttle from steering value

func (*SteeringProcessor) SetSpeedZone added in v0.7.0

func (sp *SteeringProcessor) SetSpeedZone(_ events.SpeedZone)

Jump to

Keyboard shortcuts

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