uavaustin / Flight-View

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create library to communicate directly to plane

bbridges opened this issue · comments

Create a library called core/mavlink that handles communication to the plane over the MAVLink protocol, as opposed to having an external program send in data.

node-mavlink would be a perfect fit for this use, as this library that needs to be made should essentially be a large wrapper around this.

Most likely this class should extend EventEmitter and should emit events when new information arises. Events would be handled like this:

let plane = /* The MAVLink class created */;

// Using the Telemetry class from util/types/telemetry
plane.on('telemetry', (telemetry) => {
    // Do stuff here
});

// A similar mission class would be used
plane.on('mission', (mission) => {
    // Do stuff here
});

A full list of events would include things such as:

  • telemetry
  • mission
  • waypoint
  • mode
  • connect
  • close
  • receive
  • send
  • error

Some methods that would need to be accessible from the outside would be:

  • setTelemetryRate(rate)
  • getTelemetryRate()
  • connect(<some connection parameters>)
  • disconnect()

Other possible features are handling dropped messages and uploading missions to the plane. If possible these methods would also be convenient:

  • setMission(mission)
  • setWaypoint(number)
  • setMode(mode)

The features that can be added are definitely not limited here, these are just what come to mind. More things can be found from reading the official MAVLink specification.

The pigeon library is intended to do this, so this is no longer needed.