control

package
v0.0.0-...-9455d11 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2018 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	RAD_TO_DEG = math.Pi / 180
)

Variables

View Source
var (
	IMUDeltaTime time.Time
)

Functions

func CurrentHeading

func CurrentHeading(M1 float64, M2 float64) (heading float64, headingLabel string, err error)

func InitFilters

func InitFilters()

func InitMowerState

func InitMowerState()

func SetIMUValues

func SetIMUValues(data *drivers.MPUData)

func StartController

func StartController()

func StopController

func StopController()

func UpdateSystemState

func UpdateSystemState()

func WebSocketConnection

func WebSocketConnection(c echo.Context) error

Types

type CommandMessage

type CommandMessage struct {
	Method string `json:"method"`
	Value  string `json:"value"`
}

type MowerControllerStruct

type MowerControllerStruct struct {
	// contains filtered or unexported fields
}
var (
	MowerController *MowerControllerStruct
)

type MowerStateStruct

type MowerStateStruct struct {
	Platform struct {
		Hostname        string `json:"hostname"`
		OperatingSystem string `json:"operating_system"`
		Platform        string `json:"platform"`
		LoadAverage     struct {
			Load1  float64 `json:"load1"`
			Load5  float64 `json:"load5"`
			Load15 float64 `json:"load15"`
		} `json:"load_average"`
		CPULoad struct {
			Count int     `json:"count"`
			Total float64 `json:"total"`
			Core1 float64 `json:"core_1"`
			Core2 float64 `json:"core_2"`
			Core3 float64 `json:"core_3"`
			Core4 float64 `json:"core_4"`
			Core5 float64 `json:"core_5"`
			Core6 float64 `json:"core_6"`
			Core7 float64 `json:"core_7"`
			Core8 float64 `json:"core_8"`
		} `json:"cpu"`
		MemoryUsage struct {
			Total     uint64 `json:"total"`
			Available uint64 `json:"available"`
		} `json:"memory"`
		DiskUsage struct {
			Total uint64 `json:"total"`
			Free  uint64 `json:"free"`
		} `json:"disk"`
	} `json:"platform"`
	Battery struct {
		Status         string  `json:"status"`
		VoltageNominal float64 `json:"voltage_nominal"`
		VoltageWarn    float64 `json:"voltage_warn"`
		Voltage        float64 `json:"voltage"`
		Current        float64 `json:"current"`
	} `json:"battery"`
	Compass struct {
		Status  string `json:"status"`
		Bearing string `json:"bearing"`
	} `json:"compass"`
	GPS struct {
		Status      string `json:"status"`
		Coordinates string `json:"coordinates"`
	} `json:"gps"`
	Drive struct {
		Speed     int    `json:"speed"`
		Direction string `json:"direction"`
	} `json:"drive"`
	Cutter struct {
		Speed int `json:"speed"`
	} `json:"cutter"`
}
var (
	MowerState *MowerStateStruct
)

type StateMessage

type StateMessage struct {
	*MowerStateStruct
	Namespace string `json:"namespace"`
	Mutation  string `json:"mutation"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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