gpsrtk

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureBaseRTKStation

func ConfigureBaseRTKStation(cfg config.Component) error

ConfigureBaseRTKStation configures an RTK chip to act as a base station and send correction data.

func ConfigureRoverDefault

func ConfigureRoverDefault(cfg config.Component) error

ConfigureRoverDefault sets up an RTK chip to act as a rover and receive correction data.

Types

type AttrConfig

type AttrConfig struct {
	CorrectionSource string `json:"correction_source"`
	Board            string `json:"board,omitempty"`
	ConnectionType   string `json:"connection_type,omitempty"`

	*SerialAttrConfig `json:"serial_attributes,omitempty"`
	*I2CAttrConfig    `json:"i2c_attributes,omitempty"`
	*NtripAttrConfig  `json:"ntrip_attributes,omitempty"`
}

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

func (*AttrConfig) ValidateRTK

func (cfg *AttrConfig) ValidateRTK(path string) error

ValidateRTK ensures all parts of the config are valid.

type I2CAttrConfig

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

I2CAttrConfig is used for converting attributes for a correction source.

func (*I2CAttrConfig) ValidateI2C

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

ValidateI2C ensures all parts of the config are valid.

type NtripAttrConfig

type NtripAttrConfig 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"`
}

NtripAttrConfig is used for converting attributes for a correction source.

func (*NtripAttrConfig) ValidateNtrip

func (cfg *NtripAttrConfig) 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 {
	generic.Unimplemented
	// 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) (map[string]float32, error)

Accuracy passthrough.

func (*RTKMovementSensor) AngularVelocity

AngularVelocity passthrough.

func (*RTKMovementSensor) Close

func (g *RTKMovementSensor) Close() error

Close shuts down the RTKMOVEMENTSENSOR.

func (*RTKMovementSensor) CompassHeading

func (g *RTKMovementSensor) CompassHeading(ctx context.Context) (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) LinearVelocity

func (g *RTKMovementSensor) LinearVelocity(ctx context.Context) (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

Orientation passthrough.

func (*RTKMovementSensor) Position

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

Position returns the current geographic location of the MOVEMENTSENSOR.

func (*RTKMovementSensor) Properties

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) (map[string]interface{}, error)

Readings will use the default MovementSensor Readings if not provided.

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) error

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

type SerialAttrConfig

type SerialAttrConfig 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"`
}

SerialAttrConfig is used for converting attributes for a correction source.

func (*SerialAttrConfig) ValidateSerial

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

ValidateSerial ensures all parts of the config are valid.

type StationConfig

type StationConfig struct {
	CorrectionSource string   `json:"correction_source"`
	Children         []string `json:"children,omitempty"`
	Board            string   `json:"board,omitempty"`

	// non ntrip
	SurveyIn         string  `json:"svin,omitempty"`
	RequiredAccuracy float64 `json:"required_accuracy,omitempty"` // fixed number 1-5, 5 being the highest accuracy
	RequiredTime     int     `json:"required_time_sec,omitempty"`

	*SerialAttrConfig `json:"serial_attributes,omitempty"`
	*I2CAttrConfig    `json:"i2c_attributes,omitempty"`
	*NtripAttrConfig  `json:"ntrip_attributes,omitempty"`
}

StationConfig is used for converting RTK MovementSensor config attributes.

func (*StationConfig) Validate

func (cfg *StationConfig) Validate(path string) error

Validate 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