nmea

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

Package nmea implements an NMEA serial gps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type I2CAttrConfig

type I2CAttrConfig struct {
	// I2C
	Board   string `json:"board"`
	Bus     string `json:"bus"`
	I2cAddr int    `json:"i2c_addr"`
}

I2CAttrConfig is used for converting Serial NMEA MovementSensor config attributes.

func (*I2CAttrConfig) ValidateI2C

func (config *I2CAttrConfig) ValidateI2C(path string) error

ValidateI2C ensures all parts of the config are valid.

type NtripInfo added in v0.0.7

type NtripInfo struct {
	URL                string
	Username           string
	Password           string
	MountPoint         string
	Client             *ntrip.Client
	Stream             io.ReadCloser
	MaxConnectAttempts int
}

NtripInfo contains the information necessary to connect to a mountpoint.

func NewNtripInfo added in v0.0.7

func NewNtripInfo(ctx context.Context, config config.Component, logger golog.Logger) (*NtripInfo, error)

NewNtripInfo creates a new NtripInfo object given ntrip information in the configuration.

type PmtkI2CNMEAMovementSensor

type PmtkI2CNMEAMovementSensor struct {
	generic.Unimplemented
	// contains filtered or unexported fields
}

PmtkI2CNMEAMovementSensor allows the use of any MovementSensor chip that communicates over I2C using the PMTK protocol.

func (*PmtkI2CNMEAMovementSensor) Close

func (g *PmtkI2CNMEAMovementSensor) Close() error

Close shuts down the SerialNMEAMOVEMENTSENSOR.

func (*PmtkI2CNMEAMovementSensor) GetAccuracy

func (g *PmtkI2CNMEAMovementSensor) GetAccuracy(ctx context.Context) (map[string]float32, error)

GetAccuracy returns the accuracy, hDOP and vDOP.

func (*PmtkI2CNMEAMovementSensor) GetAngularVelocity

GetAngularVelocity not supported.

func (*PmtkI2CNMEAMovementSensor) GetBusAddr

func (g *PmtkI2CNMEAMovementSensor) GetBusAddr() (board.I2C, byte)

GetBusAddr returns the bus and address that takes in rtcm corrections.

func (*PmtkI2CNMEAMovementSensor) GetCompassHeading

func (g *PmtkI2CNMEAMovementSensor) GetCompassHeading(ctx context.Context) (float64, error)

GetCompassHeading not supported.

func (*PmtkI2CNMEAMovementSensor) GetLinearVelocity

func (g *PmtkI2CNMEAMovementSensor) GetLinearVelocity(ctx context.Context) (r3.Vector, error)

GetLinearVelocity returns the current speed of the MovementSensor.

func (*PmtkI2CNMEAMovementSensor) GetOrientation

GetOrientation not supporter.

func (*PmtkI2CNMEAMovementSensor) GetPosition

func (g *PmtkI2CNMEAMovementSensor) GetPosition(ctx context.Context) (*geo.Point, float64, error)

GetPosition returns the current geographic location of the MovementSensor.

func (*PmtkI2CNMEAMovementSensor) GetProperties

GetProperties what can I do!

func (*PmtkI2CNMEAMovementSensor) GetReadings

func (g *PmtkI2CNMEAMovementSensor) GetReadings(ctx context.Context) ([]interface{}, error)

GetReadings will use return all of the MovementSensor Readings.

func (*PmtkI2CNMEAMovementSensor) ReadFix

func (g *PmtkI2CNMEAMovementSensor) ReadFix(ctx context.Context) (int, error)

ReadFix returns quality.

func (*PmtkI2CNMEAMovementSensor) Start

Start begins reading nmea messages from module and updates gps data.

type RTKAttrConfig

type RTKAttrConfig struct {
	// Serial
	SerialPath     string `json:"path"`
	CorrectionPath string `json:"correction_path"`

	// I2C
	Board   string `json:"board"`
	Bus     string `json:"bus"`
	I2cAddr int    `json:"i2c_addr"`

	// Ntrip
	NtripAddr            string `json:"ntrip_addr"`
	NtripConnectAttempts int    `json:"ntrip_connect_attempts,omitempty"`
	NtripMountpoint      string `json:"ntrip_mountpoint,omitempty"`
	NtripPass            string `json:"ntrip_password,omitempty"`
	NtripUser            string `json:"ntrip_username,omitempty"`
	NtripPath            string `json:"ntrip_path,omitempty"`
	NtripBaud            string `json:"ntrip_baud,omitempty"`
	NtripInputProtocol   string `json:"ntrip_input_protocol,omitempty"`
}

RTKAttrConfig is used for converting Serial NMEA MovementSensor config attributes.

func (*RTKAttrConfig) ValidateRTK

func (config *RTKAttrConfig) ValidateRTK(path string) error

ValidateRTK ensures all parts of the config are valid.

type RTKMovementSensor

type RTKMovementSensor struct {
	generic.Unimplemented
	// contains filtered or unexported fields
}

A RTKMovementSensor is an NMEA MovementSensor model that can intake RTK correction data.

func (*RTKMovementSensor) Close

func (g *RTKMovementSensor) Close() error

Close shuts down the RTKMOVEMENTSENSOR.

func (*RTKMovementSensor) Connect

func (g *RTKMovementSensor) Connect(casterAddr string, user string, pwd string, maxAttempts int) error

Connect attempts to connect to ntrip client until successful connection or timeout.

func (*RTKMovementSensor) GetAccuracy

func (g *RTKMovementSensor) GetAccuracy(ctx context.Context) (map[string]float32, error)

GetAccuracy passthrough.

func (*RTKMovementSensor) GetAngularVelocity

func (g *RTKMovementSensor) GetAngularVelocity(ctx context.Context) (spatialmath.AngularVelocity, error)

GetAngularVelocity passthrough.

func (*RTKMovementSensor) GetCompassHeading

func (g *RTKMovementSensor) GetCompassHeading(ctx context.Context) (float64, error)

GetCompassHeading passthrough.

func (*RTKMovementSensor) GetLinearVelocity

func (g *RTKMovementSensor) GetLinearVelocity(ctx context.Context) (r3.Vector, error)

GetLinearVelocity passthrough.

func (*RTKMovementSensor) GetOrientation

func (g *RTKMovementSensor) GetOrientation(ctx context.Context) (spatialmath.Orientation, error)

GetOrientation passthrough.

func (*RTKMovementSensor) GetPosition

func (g *RTKMovementSensor) GetPosition(ctx context.Context) (*geo.Point, float64, error)

GetPosition returns the current geographic location of the MOVEMENTSENSOR.

func (*RTKMovementSensor) GetProperties

func (g *RTKMovementSensor) GetProperties(ctx context.Context) (*movementsensor.Properties, error)

GetProperties passthrough.

func (*RTKMovementSensor) GetReadings

func (g *RTKMovementSensor) GetReadings(ctx context.Context) ([]interface{}, error)

GetReadings will use the default MovementSensor GetReadings if not provided.

func (*RTKMovementSensor) GetStream

func (g *RTKMovementSensor) GetStream(mountPoint string, maxAttempts int) error

GetStream attempts to connect to ntrip streak until successful connection or timeout.

func (*RTKMovementSensor) NtripStatus

func (g *RTKMovementSensor) NtripStatus() (bool, error)

NtripStatus returns true if connection to NTRIP stream is OK, false if not.

func (*RTKMovementSensor) ReadFix

func (g *RTKMovementSensor) ReadFix(ctx context.Context) (int, error)

ReadFix passthrough.

func (*RTKMovementSensor) ReceiveAndWriteI2C

func (g *RTKMovementSensor) ReceiveAndWriteI2C(ctx context.Context)

ReceiveAndWriteI2C connects to NTRIP receiver and sends correction stream to the MovementSensor through I2C protocol.

func (*RTKMovementSensor) ReceiveAndWriteSerial

func (g *RTKMovementSensor) ReceiveAndWriteSerial()

ReceiveAndWriteSerial connects to NTRIP receiver and sends correction stream to the MovementSensor through serial.

func (*RTKMovementSensor) Start

func (g *RTKMovementSensor) Start(ctx context.Context)

Start begins NTRIP receiver with specified protocol and begins reading/updating MovementSensor measurements.

type SerialAttrConfig

type SerialAttrConfig struct {
	// Serial
	SerialPath     string `json:"path"`
	CorrectionPath string `json:"correction_path"`
}

SerialAttrConfig is used for converting Serial NMEA MovementSensor config attributes.

func (*SerialAttrConfig) ValidateSerial

func (config *SerialAttrConfig) ValidateSerial(path string) error

ValidateSerial ensures all parts of the config are valid.

type SerialNMEAMovementSensor

type SerialNMEAMovementSensor struct {
	generic.Unimplemented
	// contains filtered or unexported fields
}

SerialNMEAMovementSensor allows the use of any MovementSensor chip that communicates over serial.

func (*SerialNMEAMovementSensor) Close

func (g *SerialNMEAMovementSensor) Close() error

Close shuts down the SerialNMEAMovementSensor.

func (*SerialNMEAMovementSensor) GetAccuracy

func (g *SerialNMEAMovementSensor) GetAccuracy(ctx context.Context) (map[string]float32, error)

GetAccuracy returns the accuracy, hDOP and vDOP.

func (*SerialNMEAMovementSensor) GetAngularVelocity

GetAngularVelocity angularvelocity.

func (*SerialNMEAMovementSensor) GetCompassHeading

func (g *SerialNMEAMovementSensor) GetCompassHeading(ctx context.Context) (float64, error)

GetCompassHeading 0->360.

func (*SerialNMEAMovementSensor) GetCorrectionInfo

func (g *SerialNMEAMovementSensor) GetCorrectionInfo() (string, uint)

GetCorrectionInfo returns the serial path that takes in rtcm corrections and baudrate for reading.

func (*SerialNMEAMovementSensor) GetLinearVelocity

func (g *SerialNMEAMovementSensor) GetLinearVelocity(ctx context.Context) (r3.Vector, error)

GetLinearVelocity linear velocity.

func (*SerialNMEAMovementSensor) GetOrientation

GetOrientation orientation.

func (*SerialNMEAMovementSensor) GetPosition

func (g *SerialNMEAMovementSensor) GetPosition(ctx context.Context) (*geo.Point, float64, error)

GetPosition position, altitide.

func (*SerialNMEAMovementSensor) GetProperties

GetProperties what do I do!

func (*SerialNMEAMovementSensor) GetReadings

func (g *SerialNMEAMovementSensor) GetReadings(ctx context.Context) ([]interface{}, error)

GetReadings will use return all of the MovementSensor Readings.

func (*SerialNMEAMovementSensor) ReadFix

func (g *SerialNMEAMovementSensor) ReadFix(ctx context.Context) (int, error)

ReadFix returns Fix quality of MovementSensor measurements.

func (*SerialNMEAMovementSensor) Start

Start begins reading nmea messages from module and updates gps data.

Jump to

Keyboard shortcuts

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