Documentation ¶
Overview ¶
Package gpsnmea implements an NMEA serial gps.
Package gpsnmea implements an NMEA serial gps.
Index ¶
- type AttrConfig
- type I2CAttrConfig
- type NmeaMovementSensor
- type PmtkI2CNMEAMovementSensor
- func (g *PmtkI2CNMEAMovementSensor) Accuracy(ctx context.Context, extra map[string]interface{}) (map[string]float32, error)
- func (g *PmtkI2CNMEAMovementSensor) AngularVelocity(ctx context.Context, extra map[string]interface{}) (spatialmath.AngularVelocity, error)
- func (g *PmtkI2CNMEAMovementSensor) Close() error
- func (g *PmtkI2CNMEAMovementSensor) CompassHeading(ctx context.Context, extra map[string]interface{}) (float64, error)
- func (g *PmtkI2CNMEAMovementSensor) GetBusAddr() (board.I2C, byte)
- func (g *PmtkI2CNMEAMovementSensor) LinearVelocity(ctx context.Context, extra map[string]interface{}) (r3.Vector, error)
- func (g *PmtkI2CNMEAMovementSensor) Orientation(ctx context.Context, extra map[string]interface{}) (spatialmath.Orientation, error)
- func (g *PmtkI2CNMEAMovementSensor) Position(ctx context.Context, extra map[string]interface{}) (*geo.Point, float64, error)
- func (g *PmtkI2CNMEAMovementSensor) Properties(ctx context.Context, extra map[string]interface{}) (*movementsensor.Properties, error)
- func (g *PmtkI2CNMEAMovementSensor) ReadFix(ctx context.Context) (int, error)
- func (g *PmtkI2CNMEAMovementSensor) Readings(ctx context.Context, extra map[string]interface{}) (map[string]interface{}, error)
- func (g *PmtkI2CNMEAMovementSensor) Start(ctx context.Context) error
- type SerialAttrConfig
- type SerialNMEAMovementSensor
- func (g *SerialNMEAMovementSensor) Accuracy(ctx context.Context, extra map[string]interface{}) (map[string]float32, error)
- func (g *SerialNMEAMovementSensor) AngularVelocity(ctx context.Context, extra map[string]interface{}) (spatialmath.AngularVelocity, error)
- func (g *SerialNMEAMovementSensor) Close() error
- func (g *SerialNMEAMovementSensor) CompassHeading(ctx context.Context, extra map[string]interface{}) (float64, error)
- func (g *SerialNMEAMovementSensor) GetCorrectionInfo() (string, uint)
- func (g *SerialNMEAMovementSensor) LinearVelocity(ctx context.Context, extra map[string]interface{}) (r3.Vector, error)
- func (g *SerialNMEAMovementSensor) Orientation(ctx context.Context, extra map[string]interface{}) (spatialmath.Orientation, error)
- func (g *SerialNMEAMovementSensor) Position(ctx context.Context, extra map[string]interface{}) (*geo.Point, float64, error)
- func (g *SerialNMEAMovementSensor) Properties(ctx context.Context, extra map[string]interface{}) (*movementsensor.Properties, error)
- func (g *SerialNMEAMovementSensor) ReadFix(ctx context.Context) (int, error)
- func (g *SerialNMEAMovementSensor) Readings(ctx context.Context, extra map[string]interface{}) (map[string]interface{}, error)
- func (g *SerialNMEAMovementSensor) Start(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttrConfig ¶
type AttrConfig struct { ConnectionType string `json:"connection_type"` Board string `json:"board,omitempty"` DisableNMEA bool `json:"disable_nmea,omitempty"` *SerialAttrConfig `json:"serial_attributes,omitempty"` *I2CAttrConfig `json:"i2c_attributes,omitempty"` }
AttrConfig is used for converting NMEA Movement Sensor attibutes.
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 Serial NMEA MovementSensor config attributes.
func (*I2CAttrConfig) ValidateI2C ¶
func (cfg *I2CAttrConfig) ValidateI2C(path string) error
ValidateI2C ensures all parts of the config are valid.
type NmeaMovementSensor ¶
type NmeaMovementSensor interface { movementsensor.MovementSensor Start(ctx context.Context) error // Initialize and run MovementSensor Close() error // Close MovementSensor ReadFix(ctx context.Context) (int, error) // Returns the fix quality of the current MovementSensor measurements }
NmeaMovementSensor implements a gps that sends nmea messages for movement data.
func NewPmtkI2CGPSNMEA ¶
func NewPmtkI2CGPSNMEA( ctx context.Context, deps registry.Dependencies, attr *AttrConfig, logger golog.Logger, ) (NmeaMovementSensor, error)
NewPmtkI2CGPSNMEA implements a gps that communicates over i2c.
func NewSerialGPSNMEA ¶
func NewSerialGPSNMEA(ctx context.Context, attr *AttrConfig, logger golog.Logger) (NmeaMovementSensor, error)
NewSerialGPSNMEA gps that communicates over serial.
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) Accuracy ¶
func (g *PmtkI2CNMEAMovementSensor) Accuracy(ctx context.Context, extra map[string]interface{}) (map[string]float32, error)
Accuracy returns the accuracy, hDOP and vDOP.
func (*PmtkI2CNMEAMovementSensor) AngularVelocity ¶
func (g *PmtkI2CNMEAMovementSensor) AngularVelocity( ctx context.Context, extra map[string]interface{}, ) (spatialmath.AngularVelocity, error)
AngularVelocity not supported.
func (*PmtkI2CNMEAMovementSensor) Close ¶
func (g *PmtkI2CNMEAMovementSensor) Close() error
Close shuts down the SerialNMEAMOVEMENTSENSOR.
func (*PmtkI2CNMEAMovementSensor) CompassHeading ¶
func (g *PmtkI2CNMEAMovementSensor) CompassHeading(ctx context.Context, extra map[string]interface{}) (float64, error)
CompassHeading 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) LinearVelocity ¶
func (g *PmtkI2CNMEAMovementSensor) LinearVelocity(ctx context.Context, extra map[string]interface{}) (r3.Vector, error)
LinearVelocity returns the current speed of the MovementSensor.
func (*PmtkI2CNMEAMovementSensor) Orientation ¶
func (g *PmtkI2CNMEAMovementSensor) Orientation(ctx context.Context, extra map[string]interface{}) (spatialmath.Orientation, error)
Orientation not supporter.
func (*PmtkI2CNMEAMovementSensor) Position ¶
func (g *PmtkI2CNMEAMovementSensor) Position(ctx context.Context, extra map[string]interface{}) (*geo.Point, float64, error)
Position returns the current geographic location of the MovementSensor.
func (*PmtkI2CNMEAMovementSensor) Properties ¶
func (g *PmtkI2CNMEAMovementSensor) Properties(ctx context.Context, extra map[string]interface{}) (*movementsensor.Properties, error)
Properties what can I do!
func (*PmtkI2CNMEAMovementSensor) ReadFix ¶
func (g *PmtkI2CNMEAMovementSensor) ReadFix(ctx context.Context) (int, error)
ReadFix returns quality.
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 Serial NMEA MovementSensor config attributes.
func (*SerialAttrConfig) ValidateSerial ¶
func (cfg *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) Accuracy ¶
func (g *SerialNMEAMovementSensor) Accuracy(ctx context.Context, extra map[string]interface{}) (map[string]float32, error)
Accuracy returns the accuracy, hDOP and vDOP.
func (*SerialNMEAMovementSensor) AngularVelocity ¶
func (g *SerialNMEAMovementSensor) AngularVelocity(ctx context.Context, extra map[string]interface{}) (spatialmath.AngularVelocity, error)
AngularVelocity angularvelocity.
func (*SerialNMEAMovementSensor) Close ¶
func (g *SerialNMEAMovementSensor) Close() error
Close shuts down the SerialNMEAMovementSensor.
func (*SerialNMEAMovementSensor) CompassHeading ¶
func (g *SerialNMEAMovementSensor) CompassHeading(ctx context.Context, extra map[string]interface{}) (float64, error)
CompassHeading 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) LinearVelocity ¶
func (g *SerialNMEAMovementSensor) LinearVelocity(ctx context.Context, extra map[string]interface{}) (r3.Vector, error)
LinearVelocity linear velocity.
func (*SerialNMEAMovementSensor) Orientation ¶
func (g *SerialNMEAMovementSensor) Orientation(ctx context.Context, extra map[string]interface{}) (spatialmath.Orientation, error)
Orientation orientation.
func (*SerialNMEAMovementSensor) Position ¶
func (g *SerialNMEAMovementSensor) Position(ctx context.Context, extra map[string]interface{}) (*geo.Point, float64, error)
Position position, altitide.
func (*SerialNMEAMovementSensor) Properties ¶
func (g *SerialNMEAMovementSensor) Properties(ctx context.Context, extra map[string]interface{}) (*movementsensor.Properties, error)
Properties what do I do!
func (*SerialNMEAMovementSensor) ReadFix ¶
func (g *SerialNMEAMovementSensor) ReadFix(ctx context.Context) (int, error)
ReadFix returns Fix quality of MovementSensor measurements.