Documentation ¶
Overview ¶
Package nmea implements an NMEA serial gps.
Index ¶
- type I2CAttrConfig
- type NtripInfo
- type PmtkI2CNMEAMovementSensor
- func (g *PmtkI2CNMEAMovementSensor) Close() error
- func (g *PmtkI2CNMEAMovementSensor) GetAccuracy(ctx context.Context) (map[string]float32, error)
- func (g *PmtkI2CNMEAMovementSensor) GetAngularVelocity(ctx context.Context) (spatialmath.AngularVelocity, error)
- func (g *PmtkI2CNMEAMovementSensor) GetBusAddr() (board.I2C, byte)
- func (g *PmtkI2CNMEAMovementSensor) GetCompassHeading(ctx context.Context) (float64, error)
- func (g *PmtkI2CNMEAMovementSensor) GetLinearVelocity(ctx context.Context) (r3.Vector, error)
- func (g *PmtkI2CNMEAMovementSensor) GetOrientation(ctx context.Context) (spatialmath.Orientation, error)
- func (g *PmtkI2CNMEAMovementSensor) GetPosition(ctx context.Context) (*geo.Point, float64, error)
- func (g *PmtkI2CNMEAMovementSensor) GetProperties(ctx context.Context) (*movementsensor.Properties, error)
- func (g *PmtkI2CNMEAMovementSensor) GetReadings(ctx context.Context) ([]interface{}, error)
- func (g *PmtkI2CNMEAMovementSensor) ReadFix(ctx context.Context) (int, error)
- func (g *PmtkI2CNMEAMovementSensor) Start(ctx context.Context)
- type RTKAttrConfig
- type RTKMovementSensor
- func (g *RTKMovementSensor) Close() error
- func (g *RTKMovementSensor) Connect(casterAddr string, user string, pwd string, maxAttempts int) error
- func (g *RTKMovementSensor) GetAccuracy(ctx context.Context) (map[string]float32, error)
- func (g *RTKMovementSensor) GetAngularVelocity(ctx context.Context) (spatialmath.AngularVelocity, error)
- func (g *RTKMovementSensor) GetCompassHeading(ctx context.Context) (float64, error)
- func (g *RTKMovementSensor) GetLinearVelocity(ctx context.Context) (r3.Vector, error)
- func (g *RTKMovementSensor) GetOrientation(ctx context.Context) (spatialmath.Orientation, error)
- func (g *RTKMovementSensor) GetPosition(ctx context.Context) (*geo.Point, float64, error)
- func (g *RTKMovementSensor) GetProperties(ctx context.Context) (*movementsensor.Properties, error)
- func (g *RTKMovementSensor) GetReadings(ctx context.Context) ([]interface{}, error)
- func (g *RTKMovementSensor) GetStream(mountPoint string, maxAttempts int) error
- func (g *RTKMovementSensor) NtripStatus() (bool, error)
- func (g *RTKMovementSensor) ReadFix(ctx context.Context) (int, error)
- func (g *RTKMovementSensor) ReceiveAndWriteI2C(ctx context.Context)
- func (g *RTKMovementSensor) ReceiveAndWriteSerial()
- func (g *RTKMovementSensor) Start(ctx context.Context)
- type SerialAttrConfig
- type SerialNMEAMovementSensor
- func (g *SerialNMEAMovementSensor) Close() error
- func (g *SerialNMEAMovementSensor) GetAccuracy(ctx context.Context) (map[string]float32, error)
- func (g *SerialNMEAMovementSensor) GetAngularVelocity(ctx context.Context) (spatialmath.AngularVelocity, error)
- func (g *SerialNMEAMovementSensor) GetCompassHeading(ctx context.Context) (float64, error)
- func (g *SerialNMEAMovementSensor) GetCorrectionInfo() (string, uint)
- func (g *SerialNMEAMovementSensor) GetLinearVelocity(ctx context.Context) (r3.Vector, error)
- func (g *SerialNMEAMovementSensor) GetOrientation(ctx context.Context) (spatialmath.Orientation, error)
- func (g *SerialNMEAMovementSensor) GetPosition(ctx context.Context) (*geo.Point, float64, error)
- func (g *SerialNMEAMovementSensor) GetProperties(ctx context.Context) (*movementsensor.Properties, error)
- func (g *SerialNMEAMovementSensor) GetReadings(ctx context.Context) ([]interface{}, error)
- func (g *SerialNMEAMovementSensor) ReadFix(ctx context.Context) (int, error)
- func (g *SerialNMEAMovementSensor) Start(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type I2CAttrConfig ¶
type I2CAttrConfig struct { // I2C Board string `json:"board"` Bus string `json:"bus"` I2cAddr int `json:"i2c_addr"` }
I2CAttrConfig is used for converting Serial NMEA MovementSensor config attributes.
func (*I2CAttrConfig) ValidateI2C ¶
func (config *I2CAttrConfig) ValidateI2C(path string) error
ValidateI2C ensures all parts of the config are valid.
type NtripInfo ¶ added in v0.0.7
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 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) Close ¶
func (g *PmtkI2CNMEAMovementSensor) Close() error
Close shuts down the SerialNMEAMOVEMENTSENSOR.
func (*PmtkI2CNMEAMovementSensor) GetAccuracy ¶
GetAccuracy returns the accuracy, hDOP and vDOP.
func (*PmtkI2CNMEAMovementSensor) GetAngularVelocity ¶
func (g *PmtkI2CNMEAMovementSensor) GetAngularVelocity(ctx context.Context) (spatialmath.AngularVelocity, error)
GetAngularVelocity 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) GetCompassHeading ¶
func (g *PmtkI2CNMEAMovementSensor) GetCompassHeading(ctx context.Context) (float64, error)
GetCompassHeading not supported.
func (*PmtkI2CNMEAMovementSensor) GetLinearVelocity ¶
GetLinearVelocity returns the current speed of the MovementSensor.
func (*PmtkI2CNMEAMovementSensor) GetOrientation ¶
func (g *PmtkI2CNMEAMovementSensor) GetOrientation(ctx context.Context) (spatialmath.Orientation, error)
GetOrientation not supporter.
func (*PmtkI2CNMEAMovementSensor) GetPosition ¶
GetPosition returns the current geographic location of the MovementSensor.
func (*PmtkI2CNMEAMovementSensor) GetProperties ¶
func (g *PmtkI2CNMEAMovementSensor) GetProperties(ctx context.Context) (*movementsensor.Properties, error)
GetProperties what can I do!
func (*PmtkI2CNMEAMovementSensor) GetReadings ¶
func (g *PmtkI2CNMEAMovementSensor) GetReadings(ctx context.Context) ([]interface{}, error)
GetReadings will use return all of the MovementSensor Readings.
func (*PmtkI2CNMEAMovementSensor) ReadFix ¶
func (g *PmtkI2CNMEAMovementSensor) ReadFix(ctx context.Context) (int, error)
ReadFix returns quality.
func (*PmtkI2CNMEAMovementSensor) Start ¶
func (g *PmtkI2CNMEAMovementSensor) Start(ctx context.Context)
Start begins reading nmea messages from module and updates gps data.
type RTKAttrConfig ¶
type RTKAttrConfig struct { // Serial SerialPath string `json:"path"` CorrectionPath string `json:"correction_path"` // I2C Board string `json:"board"` Bus string `json:"bus"` I2cAddr int `json:"i2c_addr"` // Ntrip 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 string `json:"ntrip_baud,omitempty"` NtripInputProtocol string `json:"ntrip_input_protocol,omitempty"` }
RTKAttrConfig is used for converting Serial NMEA MovementSensor config attributes.
func (*RTKAttrConfig) ValidateRTK ¶
func (config *RTKAttrConfig) ValidateRTK(path string) error
ValidateRTK ensures all parts of the config are valid.
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) Close ¶
func (g *RTKMovementSensor) Close() error
Close shuts down the RTKMOVEMENTSENSOR.
func (*RTKMovementSensor) Connect ¶
func (g *RTKMovementSensor) Connect(casterAddr string, user string, pwd string, maxAttempts int) error
Connect attempts to connect to ntrip client until successful connection or timeout.
func (*RTKMovementSensor) GetAccuracy ¶
GetAccuracy passthrough.
func (*RTKMovementSensor) GetAngularVelocity ¶
func (g *RTKMovementSensor) GetAngularVelocity(ctx context.Context) (spatialmath.AngularVelocity, error)
GetAngularVelocity passthrough.
func (*RTKMovementSensor) GetCompassHeading ¶
func (g *RTKMovementSensor) GetCompassHeading(ctx context.Context) (float64, error)
GetCompassHeading passthrough.
func (*RTKMovementSensor) GetLinearVelocity ¶
GetLinearVelocity passthrough.
func (*RTKMovementSensor) GetOrientation ¶
func (g *RTKMovementSensor) GetOrientation(ctx context.Context) (spatialmath.Orientation, error)
GetOrientation passthrough.
func (*RTKMovementSensor) GetPosition ¶
GetPosition returns the current geographic location of the MOVEMENTSENSOR.
func (*RTKMovementSensor) GetProperties ¶
func (g *RTKMovementSensor) GetProperties(ctx context.Context) (*movementsensor.Properties, error)
GetProperties passthrough.
func (*RTKMovementSensor) GetReadings ¶
func (g *RTKMovementSensor) GetReadings(ctx context.Context) ([]interface{}, error)
GetReadings will use the default MovementSensor GetReadings if not provided.
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) NtripStatus ¶
func (g *RTKMovementSensor) NtripStatus() (bool, error)
NtripStatus returns true if connection to NTRIP stream is OK, false if not.
func (*RTKMovementSensor) ReadFix ¶
func (g *RTKMovementSensor) ReadFix(ctx context.Context) (int, error)
ReadFix passthrough.
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)
Start begins NTRIP receiver with specified protocol and begins reading/updating MovementSensor measurements.
type SerialAttrConfig ¶
type SerialAttrConfig struct { // Serial SerialPath string `json:"path"` CorrectionPath string `json:"correction_path"` }
SerialAttrConfig is used for converting Serial NMEA MovementSensor config attributes.
func (*SerialAttrConfig) ValidateSerial ¶
func (config *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) Close ¶
func (g *SerialNMEAMovementSensor) Close() error
Close shuts down the SerialNMEAMovementSensor.
func (*SerialNMEAMovementSensor) GetAccuracy ¶
GetAccuracy returns the accuracy, hDOP and vDOP.
func (*SerialNMEAMovementSensor) GetAngularVelocity ¶
func (g *SerialNMEAMovementSensor) GetAngularVelocity(ctx context.Context) (spatialmath.AngularVelocity, error)
GetAngularVelocity angularvelocity.
func (*SerialNMEAMovementSensor) GetCompassHeading ¶
func (g *SerialNMEAMovementSensor) GetCompassHeading(ctx context.Context) (float64, error)
GetCompassHeading 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) GetLinearVelocity ¶
GetLinearVelocity linear velocity.
func (*SerialNMEAMovementSensor) GetOrientation ¶
func (g *SerialNMEAMovementSensor) GetOrientation(ctx context.Context) (spatialmath.Orientation, error)
GetOrientation orientation.
func (*SerialNMEAMovementSensor) GetPosition ¶
GetPosition position, altitide.
func (*SerialNMEAMovementSensor) GetProperties ¶
func (g *SerialNMEAMovementSensor) GetProperties(ctx context.Context) (*movementsensor.Properties, error)
GetProperties what do I do!
func (*SerialNMEAMovementSensor) GetReadings ¶
func (g *SerialNMEAMovementSensor) GetReadings(ctx context.Context) ([]interface{}, error)
GetReadings will use return all of the MovementSensor Readings.
func (*SerialNMEAMovementSensor) ReadFix ¶
func (g *SerialNMEAMovementSensor) ReadFix(ctx context.Context) (int, error)
ReadFix returns Fix quality of MovementSensor measurements.
func (*SerialNMEAMovementSensor) Start ¶
func (g *SerialNMEAMovementSensor) Start(ctx context.Context)
Start begins reading nmea messages from module and updates gps data.