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

wpilib-ws-robot

v0.0.7

Published

Base library for a WPILib WebSocket robot (Client/Server implementations)

Downloads

5

Readme

wpilib-ws-robot

Library for creating robots controllable via WPILib's WebSocket protocol

Installation

npm install wpilib-ws-robot

Overview

This package consists of two main units, an abstract class representing a robot (WPILibWSRobotBase) and an endpoint (either client or server) that links a provided WPILibWSRobotBase-derived class and the protocol implementation from node-wpilib-ws. The endpoint (WPILibWSRobotEndpoint) acts as an interface between the WPILib WebSocket protocol implementation and the robot controller.

Usage

To start, create a robot controller class that extends from WPILibWSRobotBase. This abstract base class provides methods to interact with robot "hardware" (this can be actual hardware, or even a simulated robot). See src/debug-robot.ts for a simplistic example.

With a concrete robot controller class in hand, you can then create an endpoint, passing in the robot controller as a parameter. Endpoints come in two flavors, a client or a server.

To create a server (which interacts with the halsim_ws_client extension):

const endpointServer = WPILibWSRobotEndpoint.createServer(robot, optionalServerConfig);

Similarly, to create a client (which interacts with the halsim_ws_server extension):

const endpointClient = WPILibWSRobotEndpoint.createClient(robot, optionalClientConfig);

Once your endpoint is created, start it up with the startP() method, which resolves a promise when the protocol interface and robot are ready.

endpoint.startP()
.then(() => {
    console.log("System Ready");
});

Example Implementations

This library is designed to make it easy to implement a robot controller interface. For a more feature complete example, look at the reference robot design