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

aerogel

v0.0.5

Published

CrazyFlie control software

Downloads

27

Readme

aerogel

A node.js control library for the Crazyflie nano-copter. This is a work in progress! Your contributions are more than welcome.

Installation

libusb is required for the radio driver. On OS X, install with homebrew:

brew install libusb

Then install Aerogel:

npm install aerogel

Aerogel uses new-style node streams so it requires node 0.10.x or later.

Basics

The copter object is what your control scripts should manipulate.

A simple script for taking off then landing again immediately looks like this:

var Aerogel = require('../index');

var driver = new Aerogel.CrazyDriver();
var copter = new Aerogel.Copter(driver);
process.on('SIGINT', copter.land.bind(copter));

driver.findCopters()
.then(function(copters)
{
	if (copters.length === 0)
	{
		console.error('No copters found! Is your copter turned on?');
		process.exit(1);
	}

	var uri = copters[0];
	console.log('Using copter at', uri);
	return uri;
})
.then(function(uri) { return copter.connect(uri); })
.then(function() { return copter.takeoff(); })
.then(function() { return copter.land(); })
.then(function() { return copter.shutdown(); })
.done();

Telemetry

The protocol driver emits telemetry information as events that the copter object listens for. The handlers for these events don't do anything yet, but the plan is that they'll eventually be used to implement higher-level flight control constructs & autonomous goal-seeking.

copter.handleStabilizerTelemetry() gets an object with three orientation fields:

  • roll
  • pitch
  • yaw

copter.handleMotorTelemetry() gets an object with the state of the four motors: m1, m2, m3, and m4.

API

TODO

Aerogel exposes a promises API at the moment. Eventually I plan to offer a standard callback API as well. If you do not pass a callback to a method, a promise is returned.

To-do

Everything.

Contributing

Allman bracing, tabs to indent, camel case. Write tests in Mocha. mocha-as-promised and chai-as-promised are available. Do cool things.

License

MIT.