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

swarms

v0.3.1

Published

The ultimate node.js library for controlling Bitcraze Crazyflie 2.0 drones

Downloads

42

Readme

swarms

The ultimate node.js client for controlling Bitcraze Crazyflie 2.0 drones

npm npm Travis Dependency Status Dev Dependency Status

Motive

There were too many outdated and undocumented node.js libraries out there for programming Crazyflies. This package's goal is to fix that.

Prerequisites

Crazyflie Firmware

This package assumes you have the latest version of the Crazyflie firmware.

Crazyradio Driver on Windows

If on a Windows machine, look on the Bitcraze wiki for instructions to install the correct driver onto your Crazyradio. You do not need to do this on macOS or Linux!

Installation

This package's main dependency is node-usb. Refer to its installation directions for any help installing it on your operating system.

$ npm install swarms

Note: On Windows, you may get errors installing the node-usb package like the following: you may fail to install the node-usb package getting errors like:

error C2011: 'timespec': 'struct' type redefinition

You can fix this by following the directions here.

Usage

The following script moves the drone's propellers. More examples are located in the /examples directory.

const { Crazyradio } = require('swarms');

const radio = new Crazyradio();

// Because you can only use `await` within an async function...
main();
async function main() {
	try {
		await radio.init();
		const drones = await radio.findDrones();

		if (drones.length < 1) {
			throw 'Could not find any drones!';
		}

		const drone = await radio.connect(drones[0]);

		await drone.commander.setpoint({
			roll  : 0,
			yaw   : 0,
			pitch : 0,
			thrust: 32500
		});

	} catch (err) {
		console.log('Uh oh!', err);
		await radio.close();
	}
}

Documentation

Check out the repository documentation for information, tutorials, and more!

Troubleshooting

Got a problem? Refer to the troubleshooting page in the documentation. If that doesn't help, create an issue.

Contributing

Encounter a bug or have an idea for a new feature? Open up an issue! Pull requests also welcome! Check out the Contributing Guide for more details.

License

This project is under the MIT License.

Acknowledgments

Special thanks to the following people, whose libraries were used as a reference: