gpsrtk

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package gpsrtk defines a gps and an rtk correction source which sends rtcm data to a child gps This is an Experimental package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.2.36

type Config struct {
	CorrectionSource string `json:"correction_source"`
	ConnectionType   string `json:"connection_type,omitempty"`

	*SerialConfig `json:"serial_attributes,omitempty"`
	*I2CConfig    `json:"i2c_attributes,omitempty"`
	*NtripConfig  `json:"ntrip_attributes,omitempty"`
}

Config is used for converting NMEA MovementSensor with RTK capabilities config attributes.

func (*Config) Validate added in v0.2.36

func (cfg *Config) Validate(path string) ([]string, error)

Validate ensures all parts of the config are valid.

type I2CConfig added in v0.2.36

type I2CConfig struct {
	Board       string `json:"board"`
	I2CBus      string `json:"i2c_bus"`
	I2cAddr     int    `json:"i2c_addr"`
	I2CBaudRate int    `json:"i2c_baud_rate,omitempty"`
}

I2CConfig is used for converting attributes for a correction source.

func (*I2CConfig) ValidateI2C added in v0.2.36

func (cfg *I2CConfig) ValidateI2C(path string) error

ValidateI2C ensures all parts of the config are valid.

type NtripConfig added in v0.2.36

type NtripConfig struct {
	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            int    `json:"ntrip_baud,omitempty"`
	NtripInputProtocol   string `json:"ntrip_input_protocol,omitempty"`
}

NtripConfig is used for converting attributes for a correction source.

func (*NtripConfig) ValidateNtrip added in v0.2.36

func (cfg *NtripConfig) ValidateNtrip(path string) error

ValidateNtrip ensures all parts of the config are valid.

type NtripInfo

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.

type RTKMovementSensor

type RTKMovementSensor struct {
	resource.Named
	resource.AlwaysRebuild

	Nmeamovementsensor gpsnmea.NmeaMovementSensor
	InputProtocol      string
	CorrectionWriter   io.ReadWriteCloser

	Bus       board.I2C
	Wbaud     int
	Addr      byte // for i2c only
	Writepath string
	// contains filtered or unexported fields
}

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

func (*RTKMovementSensor) Accuracy

func (g *RTKMovementSensor) Accuracy(ctx context.Context, extra map[string]interface{}) (map[string]float32, error)

Accuracy passthrough.

func (*RTKMovementSensor) AngularVelocity

func (g *RTKMovementSensor) AngularVelocity(ctx context.Context, extra map[string]interface{}) (spatialmath.AngularVelocity, error)

AngularVelocity passthrough.

func (*RTKMovementSensor) Close

func (g *RTKMovementSensor) Close(ctx context.Context) error

Close shuts down the RTKMOVEMENTSENSOR.

func (*RTKMovementSensor) CompassHeading

func (g *RTKMovementSensor) CompassHeading(ctx context.Context, extra map[string]interface{}) (float64, error)

CompassHeading passthrough.

func (*RTKMovementSensor) Connect

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

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

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) LinearAcceleration added in v0.2.11

func (g *RTKMovementSensor) LinearAcceleration(ctx context.Context, extra map[string]interface{}) (r3.Vector, error)

LinearAcceleration passthrough.

func (*RTKMovementSensor) LinearVelocity

func (g *RTKMovementSensor) LinearVelocity(ctx context.Context, extra map[string]interface{}) (r3.Vector, error)

LinearVelocity passthrough.

func (*RTKMovementSensor) NtripStatus

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

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

func (*RTKMovementSensor) Orientation

func (g *RTKMovementSensor) Orientation(ctx context.Context, extra map[string]interface{}) (spatialmath.Orientation, error)

Orientation passthrough.

func (*RTKMovementSensor) Position

func (g *RTKMovementSensor) Position(ctx context.Context, extra map[string]interface{}) (*geo.Point, float64, error)

Position returns the current geographic location of the MOVEMENTSENSOR.

func (*RTKMovementSensor) Properties

func (g *RTKMovementSensor) Properties(ctx context.Context, extra map[string]interface{}) (*movementsensor.Properties, error)

Properties passthrough.

func (*RTKMovementSensor) ReadFix

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

ReadFix passthrough.

func (*RTKMovementSensor) Readings

func (g *RTKMovementSensor) Readings(ctx context.Context, extra map[string]interface{}) (map[string]interface{}, error)

Readings will use the default MovementSensor Readings if not provided.

type SerialConfig added in v0.2.36

type SerialConfig struct {
	SerialPath               string `json:"serial_path"`
	SerialBaudRate           int    `json:"serial_baud_rate,omitempty"`
	SerialCorrectionPath     string `json:"serial_correction_path,omitempty"`
	SerialCorrectionBaudRate int    `json:"serial_correction_baud_rate,omitempty"`

	// TestChan is a fake "serial" path for test use only
	TestChan chan []uint8 `json:"-"`
}

SerialConfig is used for converting attributes for a correction source.

func (*SerialConfig) ValidateSerial added in v0.2.36

func (cfg *SerialConfig) ValidateSerial(path string) error

ValidateSerial ensures all parts of the config are valid.

Jump to

Keyboard shortcuts

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