telemetry

package
v0.0.0-...-8a0c759 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: BSD-2-Clause Imports: 8 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACCL

type ACCL struct {
	X float64
	Y float64
	Z float64
}

Accelerometer in m/s for XYZ

func (*ACCL) Parse

func (accl *ACCL) Parse(bytes []byte, scale *SCAL) error

type GPS5

type GPS5 struct {
	Latitude  float64 `json:"lat"`    // degrees lat
	Longitude float64 `json:"lon"`    // degrees lon
	Altitude  float64 `json:"alt"`    // meters above wgs84 ellipsoid ?
	Speed     float64 `json:"spd"`    // m/s
	Speed3D   float64 `json:"spd_3d"` // m/s, standard error?
	TS        int64   `json:"utc"`
}

GPS sentence with lat/lon/alt/speed/3d speed

func (*GPS5) Parse

func (gps *GPS5) Parse(bytes []byte, scale *SCAL) error

type GPSF

type GPSF struct {
	F uint32
}

GPS Fix

func (*GPSF) Parse

func (gpsf *GPSF) Parse(bytes []byte) error

type GPSP

type GPSP struct {
	Accuracy uint16
}

GPS position accuracy in cm

func (*GPSP) Parse

func (gpsp *GPSP) Parse(bytes []byte) error

type GPSU

type GPSU struct {
	Time time.Time
}

GPS-acquired timestamp

func (*GPSU) Parse

func (gpsu *GPSU) Parse(bytes []byte) error

type GYRO

type GYRO struct {
	X float64
	Y float64
	Z float64
}

3-axis Gyroscope data in rad/s

func (*GYRO) Parse

func (gyro *GYRO) Parse(bytes []byte, scale *SCAL) error

type SCAL

type SCAL struct {
	Values []int
}

Scale - contains slice of multipliers for subsequent data

func (*SCAL) Parse

func (scale *SCAL) Parse(bytes []byte, size int64) error

type TELEM

type TELEM struct {
	Accl        []ACCL
	Gps         []GPS5
	Gyro        []GYRO
	GpsFix      GPSF
	GpsAccuracy GPSP
	Time        GPSU
	Temp        TMPC
}

Represents one second of telemetry data

func Read

func Read(f io.Reader) (*TELEM, error)

func (*TELEM) Clear

func (t *TELEM) Clear()

zeroes out the telem struct

func (*TELEM) FillTimes

func (t *TELEM) FillTimes(until time.Time) error

try to populate a timestamp for every GPS row. probably bogus.

func (*TELEM) IsZero

func (t *TELEM) IsZero() bool

determines if the telem has data

func (*TELEM) ShitJson

func (t *TELEM) ShitJson() []TELEM_OUT

type TELEM_OUT

type TELEM_OUT struct {
	*GPS5

	GpsAccuracy uint16  `json:"gps_accuracy,omitempty"`
	GpsFix      uint32  `json:"gps_fix,omitempty"`
	Temp        float32 `json:"temp,omitempty"`
	Track       float64 `json:"track,omitempty"`
}

the thing we want, json-wise GPS data might have a generated timestamp and derived track

type TMPC

type TMPC struct {
	Temp float32
}

Temperature in °C

func (*TMPC) Parse

func (temp *TMPC) Parse(bytes []byte) error

type TSMP

type TSMP struct {
	Samples uint32
}

Total number of samples

func (*TSMP) Parse

func (t *TSMP) Parse(bytes []byte, scale *SCAL) error

Jump to

Keyboard shortcuts

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