npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nodriverai/mavjs

v0.1.2

Published

Node.js wrapper for mavlink/MAVSDK C++ library using node-addon-api.

Downloads

5

Readme

MAVJS

Build Status

Node.js wrapper for mavlink/MAVSDK C++ library using node-addon-api.

MAVJS is a Node.js addon, written in C++, that can be loaded into Node.js using the require() function, and used just as if they were an ordinary Node.js module.

The aim of the project is to provide an interface between JavaScript running in Node.js and MAVSDK C/C++ library.

The library also provides types definition to use Typescript.

documentation: https://nodriver-ai.github.io/MAVJS/

Prerequisites

Before starting to use MAVJS you need to assure you have the following prerequisites:

Cmake needs because we use CMake.js to build the addon

MAVJS requires MAVSDK System-wide Install.

Installation

This is a Node.js module available through the npm registry.

installation is done using the npm install command:

$ npm i @nodriverai/mavjs

Getting started

import { Mavsdk, System, Telemetry, Action } from "@nodriverai/mavjs";

//Create a Mavsdk instance
let mavsdk = new Mavsdk();

//Add connection
const connection_result = mavsdk.add_any_connection("udp://14540");

if (connection_result != Mavsdk.ConnectionResult.SUCCESS) {
    console.log(`Connection failed: ${connection_result.toString()}`);
    process.exit()
}

//Get the first system discovered
let system = mavsdk.system();

//Initialize telemtery and action objects
let telemetry = system.telemetry();
let action = system.action();

//Monitor altitude while the vehicle is in flight
telemetry.position_async((position) => {
    console.log(`Altitude: ${position.relative_altitude_m} m`)
})

// Arm vehicle
let arm_result: Action.Result = action.arm();

if (arm_result != Action.Result.SUCCESS) {
    console.log(`Arming failed: ${arm_result}`)
    process.exit();
}

// Take off
let takeoff_result: Action.Result = action.takeoff();
if (takeoff_result != Action.Result.SUCCESS) {
    console.log(`Takeoff failed: ${takeoff_result}`)
    process.exit();
}

//close all connections
mavsdk.close();

Examples

To view the examples, clone the Express repo and install the dependencies:

$ git clone https://github.com/nodriver-ai/MAVJS.git
$ cd MAVJS
$ npm install

Then run whichever example you want:

$ node examples/takeoff_and_land.js udp:://14540

Project Status

Plugins implementation:

  • [x] Action
  • [x] Info
  • [x] Telemetry
  • [x] Mission
  • [x] MissionItem
  • [ ] Offboard
  • [ ] Geofence
  • [ ] Gimbal
  • [ ] Camera
  • [ ] LogFiles
  • [ ] MavlinkPasstrough
  • [ ] MavlinkFTP
  • [ ] MissionRaw
  • [ ] Mocap
  • [ ] Param
  • [ ] Shell
  • [ ] Tune

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

You need also a PX4 SITL running and accessible via UDP in localhost. You can use docker to run a gazebo PX4 SITL simulator.

$ docker run -d -it --net=host jonasvautherin/px4-gazebo-headless:v1.9.2

License

This project is licensed under the permissive BSD 3-clause, see LICENSE.md.