Skip to content
implementation of Mavlink 2.0 and 1.0 in the Go programming language.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dialects
dialgen
example
.travis.yml test examples too Mar 29, 2019
LICENSE
Makefile
README.md
channel.go
channelaccepter.go
dialect.go
dialect_test.go
endpoint.go update docs May 21, 2019
endpoint_broadcast.go
endpoint_client.go
endpoint_custom.go
endpoint_serial.go
endpoint_server.go
events.go
frame.go rename SignatureKey into Key May 27, 2019
go.mod tests simplified Mar 15, 2019
go.sum
message.go
node.go
node_heartbeat.go
node_streamrequest.go fix goreportcard warnings May 27, 2019
node_test.go
parser.go
parser_test.go
udplistener.go udplistener: improve performance by using as index ip and port instea… May 27, 2019
udplistener_test.go
various.go
x25.go
x25_test.go

README.md

gomavlib

GoDoc Go Report Card Build Status

gomavlib is a library that implements Mavlink 2.0 and 1.0 in the Go programming language. It can power UGVs, UAVs, ground stations, monitoring systems or routers acting in a Mavlink network.

Mavlink is a lighweight and transport-independent protocol that is mostly used to communicate with unmanned ground vehicles (UGV) and unmanned aerial vehicles (UAV, drones, quadcopters, multirotors). It is supported by the most common open-source flight controllers (Ardupilot and PX4).

This library powers the mavp2p router.

Features

  • Decodes and encodes Mavlink v2.0 and v1.0. Supports checksums, empty-byte truncation (v2.0), signatures (v2.0), message extensions (v2.0)
  • Dialect is optional, the library can work a standard dialect, a custom dialect or no dialect at all. Standard dialects are provided in directory dialects/, with no need for generation. A dialect generator is provided anyway.
  • Provides a high-level API ("Node") with:
    • ability to communicate with multiple endpoints in parallel:
      • serial
      • UDP (server, client or broadcast mode)
      • TCP (server or client mode)
      • custom reader/writer
    • automatic heartbeat emission
    • automatic stream requests to Ardupilot devices (disabled by default)
  • Provides a low-level API ("Parser") with ability to decode/encode frames from/to a generic reader/writer
  • UDP connections are tracked and removed when inactive
  • Supports both domain names and IPs
  • Examples provided for every feature
  • Comprehensive test suite

Installation

Go ≥ 1.11 is required. If modules are enabled (i.e. there's a go.mod file in your project folder), it is enough to write the library name in the import section of the source files that are referring to it. Go will take care of downloading the needed files:

import (
    "github.com/gswly/gomavlib"
)

If modules are not enabled, the library must be downloaded manually:

go get github.com/gswly/gomavlib

Examples

Documentation

https://godoc.org/github.com/gswly/gomavlib

Dialect generation

Although standard dialects are provided in the dialects/ folder, dialect definitions in XML format can be converted into Go files by running the dialgen utility:

go get github.com/gswly/gomavlib/dialgen
dialgen --output=dialect.go [path_or_url_to_xml_definition]

Testing

If you want to edit the library and test the results, unit tests can be launched with:

make test

Links

Protocol references

Other Go libraries

Other non-Go libraries

You can’t perform that action at this time.