core

package
v0.0.0-...-edb31bc Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distance

func Distance(lat1, lon1, lat2, lon2 float64) float64

Distance function returns the distance (in meters) between two points of

a given longitude and latitude relatively accurately (using a spherical
approximation of the Earth) through the Haversin Distance Formula for
great arc distance on a sphere with accuracy for small distances

point coordinates are supplied in degrees and converted into rad. in the func

distance returned is METERS!!!!!! http://en.wikipedia.org/wiki/Haversine_formula

Types

type AccelerationTracker

type AccelerationTracker interface {
	UpdateAcceleration(x, y, z physic.Acceleration)
}

type AltitudeTracker

type AltitudeTracker interface {
	UpdateAltitude(temperature float64, pressure float64, altitude float64)
}

type BMPReader

type BMPReader struct {
	// contains filtered or unexported fields
}

func NewBMPReader

func NewBMPReader(i2cBus i2c2.BusCloser, altitudeTracker AltitudeTracker, bmpI2CAddr uint16) *BMPReader

func (*BMPReader) UpdateFromBMPLoop

func (recv *BMPReader) UpdateFromBMPLoop() (err error)

type GPSReader

type GPSReader struct {
	// contains filtered or unexported fields
}

func InitGPSI2CReader

func InitGPSI2CReader(gpsTracker GPSTracker, bus i2c.BusCloser, opts *gps.Opts) (*GPSReader, error)

func InitGPSSerialReader

func InitGPSSerialReader(gpsTracker GPSTracker, port string, baudRate uint, dataBits uint, stopBits uint) (*GPSReader, error)

func (*GPSReader) UpdateFromGPSLoop

func (recv *GPSReader) UpdateFromGPSLoop() (err error)

type GPSTracker

type GPSTracker interface {
	UpdateGPS(gpsInfo nmea.GGA)
}

type LSMReader

type LSMReader struct {
	// contains filtered or unexported fields
}

func NewLSMReader

func NewLSMReader(i2cBus i2c2.BusCloser, accelerationTracker AccelerationTracker, bmpI2CAddr uint16) *LSMReader

func (*LSMReader) UpdateFromLSMLoop

func (recv *LSMReader) UpdateFromLSMLoop() (err error)

type RocketInfo

type RocketInfo struct {
	RocketInfoJSON
	// contains filtered or unexported fields
}

func (*RocketInfo) MarshalJSON

func (recv *RocketInfo) MarshalJSON() ([]byte, error)

func (*RocketInfo) SetRecording

func (recv *RocketInfo) SetRecording(recording bool, videoFile string)

func (*RocketInfo) UnmarshalJSON

func (recv *RocketInfo) UnmarshalJSON(buf []byte) error

func (*RocketInfo) UpdateAcceleration

func (recv *RocketInfo) UpdateAcceleration(x, y, z physic.Acceleration)

func (*RocketInfo) UpdateAltitude

func (recv *RocketInfo) UpdateAltitude(temperature float64, pressure float64, altitude float64)

func (*RocketInfo) UpdateGPS

func (recv *RocketInfo) UpdateGPS(gps nmea.GGA)

type RocketInfoJSON

type RocketInfoJSON struct {
	Logtime          time.Time
	GPS              nmea.GGA
	Altitude         float64 // Altitude in meters
	XAcc, YAcc, ZAcc physic.Acceleration
	Recording        bool
	VideoFile        string
}

type RocketInfoLog

type RocketInfoLog interface {
	BaseAGL() float64
	NumRecords() int
	Record(recordNum int) RocketInfo
	BaroHeight(recordNum int) float64
	BaroHeightAGL(recordNum int) float64
	MaxBaroHeight() (float64, RocketInfo)
	MaxBaroHeightAGL() (float64, RocketInfo)
}

func ReadRocketInfoLog

func ReadRocketInfoLog(logFilePath string) (RocketInfoLog, error)

Jump to

Keyboard shortcuts

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