pilot

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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RAISED alarm
	RAISED = true
	// UNRAISED alarm
	UNRAISED = false
)
View Source
const (
	NoFix   = 0
	Fix     = 1
	DGpsFix = 2
)

Values for FixStatus

View Source
const (
	// INVALID course
	INVALID = false
	// VALID course
	VALID = true
)

Variables

This section is empty.

Functions

func ComputeHeadingError

func ComputeHeadingError(heading float64, gpsHeading float64, headingOffset float64) float64

ComputeHeadingError determines the error to be passed to the Controller.

Types

type Alarm

type Alarm bool

Alarm is true when the alarm is raised. You can use RAISED and UNRAISED const.

type Controller

type Controller interface {
	Set(sp float64)
	Update(value float64) float64
	OutputLimits() (float64, float64)
}

Controller provides the correction for a given setpoint and error value as provided to Update

type FixStatus

type FixStatus byte

FixStatus is the status of the GPS fix

type GPSFeedBackAction

type GPSFeedBackAction struct {
	Heading   float64
	Validity  bool
	Speed     float64
	Latitude  nmea.LatLong
	Longitude nmea.LatLong
	Date      string
	Time      string
}

GPSFeedBackAction is the message provided by the GPS component

type Info

type Info struct {
	Course        float64
	SetPoint      float64
	HeadingOffset float64
	Speed         float64
	Enabled       bool
}

Info contains the Pilot state information as used by the Webserver for example

type InputStatus

type InputStatus bool

InputStatus is the course status

type Led

type Led string

Led is the type of a particular error/warning

type Leds

type Leds map[Led]bool

Leds is the state of all the LED (errors/warnings)

type Pilot

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

Pilot is the main type for the component that decide what correction to apply depending on the provided course and setpoint and various other configuration parameters

func New

func New(controller Controller, bound float64) *Pilot

New creates a new Pilot from a particular controller.

func (*Pilot) Disable

func (p *Pilot) Disable() error

Disable the autopilot

func (*Pilot) Enable

func (p *Pilot) Enable() error

Enable the autopilot

func (*Pilot) GetInfoAction

func (p *Pilot) GetInfoAction() Info

GetInfoAction returns the current Info

func (*Pilot) SetAlarmChan

func (p *Pilot) SetAlarmChan(c chan interface{})

SetAlarmChan sets the channel where the pilot send the alarm state updates

func (*Pilot) SetDashboardChan

func (p *Pilot) SetDashboardChan(c chan interface{})

SetDashboardChan sets the channel to reach teh dashboard

func (*Pilot) SetInputChan

func (p *Pilot) SetInputChan(c chan interface{})

SetInputChan sets the channel where the gps course has to be sent

func (*Pilot) SetOffset

func (p *Pilot) SetOffset(headingOffset float64) error

SetOffset changes the heading offset

func (*Pilot) SetPanicChan

func (p *Pilot) SetPanicChan(c chan interface{})

SetPanicChan sets the channel where the panic message have to be sent

func (*Pilot) SetSteeringChan

func (p *Pilot) SetSteeringChan(c chan interface{})

SetSteeringChan sets the channel where the pilot send the steering corrections

func (Pilot) Shutdown

func (p Pilot) Shutdown()

Shutdown the event loop of the Pilot

func (Pilot) Start

func (p Pilot) Start()

Start the event loop of the Pilot component

Jump to

Keyboard shortcuts

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