Documentation ¶
Overview ¶
Package nmea implements an NMEA gps.
Package nmea implements an NMEA serial gps.
Package nmea implements a GPS NMEA component.
Package nmea implements an NMEA gps.
Index ¶
- Variables
- func MakePmtkI2cGpsNmea(ctx context.Context, deps resource.Dependencies, name resource.Name, ...) (movementsensor.MovementSensor, error)
- func NewPmtkI2CGPSNMEA(ctx context.Context, deps resource.Dependencies, name resource.Name, ...) (movementsensor.MovementSensor, error)
- func NewSerialGPSNMEA(ctx context.Context, name resource.Name, conf *Config, logger logging.Logger) (movementsensor.MovementSensor, error)
- type Config
- type MovementSensor
- func (g *MovementSensor) Accuracy(ctx context.Context, extra map[string]interface{}) (*movementsensor.Accuracy, error)
- func (g *MovementSensor) AngularVelocity(ctx context.Context, extra map[string]interface{}) (spatialmath.AngularVelocity, error)
- func (g *MovementSensor) Close(ctx context.Context) error
- func (g *MovementSensor) CompassHeading(ctx context.Context, extra map[string]interface{}) (float64, error)
- func (g *MovementSensor) LinearAcceleration(ctx context.Context, extra map[string]interface{}) (r3.Vector, error)
- func (g *MovementSensor) LinearVelocity(ctx context.Context, extra map[string]interface{}) (r3.Vector, error)
- func (g *MovementSensor) Orientation(ctx context.Context, extra map[string]interface{}) (spatialmath.Orientation, error)
- func (g *MovementSensor) Position(ctx context.Context, extra map[string]interface{}) (*geo.Point, float64, error)
- func (g *MovementSensor) Properties(ctx context.Context, extra map[string]interface{}) (*movementsensor.Properties, error)
- func (g *MovementSensor) Readings(ctx context.Context, extra map[string]interface{}) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
var Model = resource.NewModel("viam", "gps", "nmea")
Model for viam supported gps nmea movement sensor.
Functions ¶
func MakePmtkI2cGpsNmea ¶
func MakePmtkI2cGpsNmea( ctx context.Context, deps resource.Dependencies, name resource.Name, conf *Config, logger logging.Logger, i2cBus buses.I2C, ) (movementsensor.MovementSensor, 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, ) (movementsensor.MovementSensor, error)
NewPmtkI2CGPSNMEA implements a gps that communicates over i2c.
func NewSerialGPSNMEA ¶
func NewSerialGPSNMEA(ctx context.Context, name resource.Name, conf *Config, logger logging.Logger) (movementsensor.MovementSensor, error)
NewSerialGPSNMEA creates a component that communicates over a serial port.
Types ¶
type Config ¶
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.
type MovementSensor ¶
type MovementSensor struct { resource.Named resource.AlwaysRebuild // contains filtered or unexported fields }
MovementSensor allows the use of any MovementSensor chip via a DataReader.
func (*MovementSensor) Accuracy ¶
func (g *MovementSensor) Accuracy( ctx context.Context, extra map[string]interface{}, ) (*movementsensor.Accuracy, error)
Accuracy returns the accuracy map, hDOP, vDOP, Fixquality and compass heading error.
func (*MovementSensor) AngularVelocity ¶
func (g *MovementSensor) AngularVelocity( ctx context.Context, extra map[string]interface{}, ) (spatialmath.AngularVelocity, error)
AngularVelocity returns the sensor's angular velocity.
func (*MovementSensor) Close ¶
func (g *MovementSensor) Close(ctx context.Context) error
Close shuts down the MovementSensor.
func (*MovementSensor) CompassHeading ¶
func (g *MovementSensor) CompassHeading( ctx context.Context, extra map[string]interface{}, ) (float64, error)
CompassHeading returns the heading, from the range 0->360.
func (*MovementSensor) LinearAcceleration ¶
func (g *MovementSensor) LinearAcceleration( ctx context.Context, extra map[string]interface{}, ) (r3.Vector, error)
LinearAcceleration returns the sensor's linear acceleration.
func (*MovementSensor) LinearVelocity ¶
func (g *MovementSensor) 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 (*MovementSensor) Orientation ¶
func (g *MovementSensor) Orientation( ctx context.Context, extra map[string]interface{}, ) (spatialmath.Orientation, error)
Orientation returns the sensor's orientation.
func (*MovementSensor) Position ¶
func (g *MovementSensor) 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 (*MovementSensor) Properties ¶
func (g *MovementSensor) Properties( ctx context.Context, extra map[string]interface{}, ) (*movementsensor.Properties, error)
Properties returns what movement sensor capabilities we have.