reach

module
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT

README

Reach Go

PkgGoDev GoReportCard Codecov

Go client for Emlid Reach GNSS receivers.

Usage

$ go get -u go.einride.tech/reach

Examples

Reach ERB protocol data
package main

import (
	"fmt"
	"net"

	"go.einride.tech/reach/erb"
)

func main() {
	// Connect to the Emlid Reach Binary (ERB) protocol port of the Reach.
	conn, err := net.Dial("tcp", "<REACH_ERB_ADDRESS>")
	if err != nil {
		panic(err)
	}
	// Wrap the connection in an ERB protocol scanner.
	sc := erb.NewScanner(conn)
	for sc.Scan() {
		// Handle packet.
		switch sc.ID() {
		case erb.IDVER:
			fmt.Printf("%v: %+v\n", sc.ID(), sc.VER())
		case erb.IDPOS:
			fmt.Printf("%v: %+v\n", sc.ID(), sc.POS())
		case erb.IDSTAT:
			fmt.Printf("%v: %+v\n", sc.ID(), sc.STAT())
		case erb.IDDOPS:
			fmt.Printf("%v: %+v\n", sc.ID(), sc.DOPS())
		case erb.IDVEL:
			fmt.Printf("%v: %+v\n", sc.ID(), sc.VEL())
		case erb.IDSVI:
			fmt.Printf("%v: %+v\n", sc.ID(), sc.SVI())
			for sc.ScanSVI() {
				fmt.Printf("%v: %+v\n", sc.ID(), sc.SV())
			}
		default:
			fmt.Printf("%v: %s\n", sc.ID(), hex.EncodeToString(sc.Bytes()))
		}
	}
	if sc.Err() != nil {
		panic(err)
	}
	if err := conn.Close(); err != nil {
		panic(err)
	}
}

Reference ≫

Directories

Path Synopsis
cmd
Package erb provides primitives for parsing the Emlid Reach Binary protocol (ERB).
Package erb provides primitives for parsing the Emlid Reach Binary protocol (ERB).

Jump to

Keyboard shortcuts

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