gpsnmea

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package gpsnmea implements an NMEA gps.

Package gpsnmea implements an NMEA serial gps.

Package gpsnmea implements a GPS NMEA component.

Package gpsnmea implements an NMEA gps.

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 {
	ConnectionType string `json:"connection_type"`

	*gpsutils.SerialConfig `json:"serial_attributes,omitempty"`
	*gpsutils.I2CConfig    `json:"i2c_attributes,omitempty"`
}

Config is used for converting NMEA Movement Sensor attibutes.

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 NMEAMovementSensor added in v0.21.0

type NMEAMovementSensor struct {
	resource.Named
	resource.AlwaysRebuild
	// contains filtered or unexported fields
}

NMEAMovementSensor allows the use of any MovementSensor chip via a DataReader.

func (*NMEAMovementSensor) Accuracy added in v0.21.0

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

Accuracy returns the accuracy map, hDOP, vDOP, Fixquality and compass heading error.

func (*NMEAMovementSensor) AngularVelocity added in v0.21.0

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

AngularVelocity returns the sensor's angular velocity.

func (*NMEAMovementSensor) Close added in v0.21.0

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

Close shuts down the NMEAMovementSensor.

func (*NMEAMovementSensor) CompassHeading added in v0.21.0

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

CompassHeading returns the heading, from the range 0->360.

func (*NMEAMovementSensor) LinearAcceleration added in v0.21.0

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

LinearAcceleration returns the sensor's linear acceleration.

func (*NMEAMovementSensor) LinearVelocity added in v0.21.0

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

LinearVelocity returns the sensor's linear velocity. It requires having a compass heading, so we know which direction our speed is in. We assume all of this speed is horizontal, and not in gaining/losing altitude.

func (*NMEAMovementSensor) Orientation added in v0.21.0

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

Orientation returns the sensor's orientation.

func (*NMEAMovementSensor) Position added in v0.21.0

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

Position returns the position and altitide of the sensor, or an error.

func (*NMEAMovementSensor) Properties added in v0.21.0

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

Properties returns what movement sensor capabilities we have.

func (*NMEAMovementSensor) ReadFix added in v0.21.0

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

ReadFix returns Fix quality of MovementSensor measurements.

func (*NMEAMovementSensor) ReadSatsInView added in v0.21.0

func (g *NMEAMovementSensor) ReadSatsInView(ctx context.Context) (int, error)

ReadSatsInView returns the number of satellites in view.

func (*NMEAMovementSensor) Readings added in v0.21.0

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

Readings will use return all of the MovementSensor Readings.

type NmeaMovementSensor

type NmeaMovementSensor interface {
	movementsensor.MovementSensor
	Close(ctx context.Context) error                 // Close MovementSensor
	ReadFix(ctx context.Context) (int, error)        // Returns the fix quality of the current MovementSensor measurements
	ReadSatsInView(ctx context.Context) (int, error) // Returns the number of satellites in view
}

NmeaMovementSensor implements a gps that sends nmea messages for movement data.

func MakePmtkI2cGpsNmea added in v0.15.0

func MakePmtkI2cGpsNmea(
	ctx context.Context,
	deps resource.Dependencies,
	name resource.Name,
	conf *Config,
	logger logging.Logger,
	i2cBus buses.I2C,
) (NmeaMovementSensor, error)

MakePmtkI2cGpsNmea is only split out for ease of testing: you can pass in your own mock I2C bus, or pass in nil to have it create a real one. It is public so it can also be called from within the gpsrtkpmtk package.

func NewPmtkI2CGPSNMEA

func NewPmtkI2CGPSNMEA(
	ctx context.Context,
	deps resource.Dependencies,
	name resource.Name,
	conf *Config,
	logger logging.Logger,
) (NmeaMovementSensor, error)

NewPmtkI2CGPSNMEA implements a gps that communicates over i2c.

func NewSerialGPSNMEA

func NewSerialGPSNMEA(ctx context.Context, name resource.Name, conf *Config, logger logging.Logger) (NmeaMovementSensor, error)

NewSerialGPSNMEA creates a component that communicates over a serial port.

Jump to

Keyboard shortcuts

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