stepper

package
v0.0.0-...-76dc376 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNDEFINED = iota
	ARMED     = iota
	GO        = iota
	PREPARING = iota
	RUNNING   = iota
	DONE      = iota
	ABORTED   = iota
)

state value

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	Duration types.JSONDuration
	Heading  float64
	Step     float64
}

Input is the definition of a step

type Point

type Point struct {
	Timestamp     types.JSONTime
	FixTime       string
	FixDate       string
	Course        float64
	Speed         float64
	DeltaSteering float64
	Latitude      nmea.LatLong
	Longitude     nmea.LatLong
	Validity      bool
}

Point is the structure collected when a step is RUNNING

type State

type State int

State of a step

func (State) MarshalJSON

func (d State) MarshalJSON() ([]byte, error)

MarshalJSON does the JSON serialization of a State

type Stepper

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

Stepper is a component that execute steering plans and collect the position as it runs

func New

func New() *Stepper

New creates a new Stepper component

func (*Stepper) CalibrationEndpoint

func (s *Stepper) CalibrationEndpoint(w http.ResponseWriter, r *http.Request)

CalibrationEndpoint is a rest endpoint to get the current status of a plan

func (*Stepper) Disable

func (s *Stepper) Disable() error

Disable the autopilot

func (*Stepper) Enable

func (s *Stepper) Enable() error

Enable the autopilot

func (Stepper) NewStep

func (s Stepper) NewStep(step float64, duration time.Duration, description string)

NewStep creates a new step

func (*Stepper) SetInputChan

func (s *Stepper) SetInputChan(c chan interface{})

SetInputChan sets the channel where the Stepper will be getting new step messages from

func (*Stepper) SetPanicChan

func (s *Stepper) SetPanicChan(c chan interface{})

SetPanicChan sets the channel where panics are sent

func (*Stepper) SetSteeringChan

func (s *Stepper) SetSteeringChan(c chan interface{})

SetSteeringChan sets the channel where the Stepper will send steering order to

func (*Stepper) Shutdown

func (s *Stepper) Shutdown()

Shutdown sets all the state to down and notify the handlers

func (*Stepper) Start

func (s *Stepper) Start()

Start the event loop of the Stepper component

Jump to

Keyboard shortcuts

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