github.com/ornen/go-xplane
go get github.com/ornen/go-xplane

github.com/ornen/go-xplane

X-Plane interface for Go

by ornen

v0.0.0-20190804101950-1f24620ec296 (see all)License:Apache-2.0
go get github.com/ornen/go-xplane
Readme

go-xplane

This is an interface to X-Plane for Go. The interface is functional and supports the basics, but does not cover all messages supported by X-Plane yet. Pull-requests are welcome.

Example

package main

import (
        "github.com/ornen/go-xplane"
        "github.com/ornen/go-xplane/messages"
        "log"
)

func main() {
        x := xplane.New("127.0.0.1:49000", ":49003")
        x.Connect()

        x.Send(messages.ThrottleCommandMessage{
                Throttle: 1,
        })

        x.Send(messages.FlightControlMessage{
                Elevator: 1,
                Aileron:  -1,
                Rudder:   0,
        })

        go x.Receive()

        for {
                message := <-x.Messages

                if message != nil {
                        log.Printf("%+v\n", message)
                }
        }
}

License

This code is licensed under the Apache License 2.0.

GitHub Stars

11

LAST COMMIT

3yrs ago

MAINTAINERS

0

CONTRIBUTORS

3

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
v0.0.0-20190804101950-1f24620ec296
2yrs ago
No alternatives found
No tutorials found
Add a tutorial