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 🙏

© 2026 – Pkg Stats / Ryan Hefner

hrp

v0.0.7

Published

Module that implements a protocol for talking to robots over a HID-USB communication

Readme

hrp (HID Robot Protocol)

Module that implements a protocol for talking to robots over a HID-USB communication

Install

npm install hrp

Use

var HRP = require('hrp');

var robot_handler = HRP('USB_PATH','PORT_IF_VIRTUAL','ONLY_DEFS');

Where:

  • USB_PATH is the path to the device (XXXX:XXXX:XX) or 'virtual'
  • PORT_IF_VIRTUAL is the port used when talking to a virtual robot
  • ONLY_DEFS is true if you want only the protocol definitions and helper functions

Protocol

Generalities

  • Every frame must start and finish with :
  • Every frame must have the preamble :HRP
  • The isssued command follows the preamble
    • Get: G
    • Set: S
    • Get All: GA
    • Set All: SA
  • The target device follows the command
    • Robot: R
    • Joint(s): J
    • End Effector: EE
  • The target property follows the device
    • Info: INFO
    • Value: V
  • Every part of the frame is followed by :
  • Arrays items are separated by ,
  • Decimal point is actually a point 1.23
  • The robot must ACK the received Set command even if it can not complete the operation (e.g., move the end effector to desired position)
  • The robot must not ACK the received Get command, it should only send the requested information
    • ACK: A
    • Compliance ACK: CA
  • The robot should send the following general information when asked to:
    • Brand (string) (B)
    • Model (string) (M)
    • Degrees of Freedom (positive integer) (DOF)
    • Joints' IDs (array of positive integers between 0 and 999) (J)
  • The robot should send the following information about a joint when asked to:
    • Joint Type (string, e.g., 'R', 'T') (J_TYPE)
    • Joint Description (string, e.g., 'Stepper Motor') (J_DESC)
    • Joint Range (array of floating point numbers, e.g., [0 23.4] formatted as ':0.00,23.40:') (J_RANGE)
    • Joint Units (string, e.g., 'deg','rad','mm') (J_UNITS)

Specifics

  • HRP-Compliance ACK frame
    • Q: :HRP:CA: -- A: :HRP:CA:
  • Get the robot information
    • Q: :HRP:G:R:INFO: -- A: :HRP:G:R:INFO:info_string:
    • (info_string can be obtained with the function HRP.robotInfo2str(info)
    • (the info can be converted to an object with the function HRP.str2robotInfo(str)
  • Get the joint information
    • Q: :HRP:G:J:INFO: -- A: :HRP:G:J:INFO:info_string:
    • (info_string can be obtained with the function HRP.robotInfo2str(info)
    • (the info can be converted to an object with the function HRP.str2robotInfo(str)
  • Get a joint value
    • Q: :HRP:G:J:V:id: -- A: :HRP:G:J:id:value:
    • (id is an integer between 0 and 999, formatted as 000-999)
    • (value is a number with two decimal places. It must contain the two decimal places, as in 1.00)
  • Get all joints values
    • Q: :HRP:GA:J:V: -- A: :HRP:GA:J:id1:value1: ... idn:valuen:
  • Set the end effector value (position)
    • Q: :HRP:S:EE:V:x_pos:y_pos:z_pos: -- A: :HRP:A:S:EE:V:
    • (work TODO: set also the orientation)
  • Set the end effector value (differential position)
    • Q: :HRP:S:EED:V:x_pos:y_pos:z_pos: -- A: :HRP:A:S:EED:V:
    • (work TODO: set also the orientation)
  • Set a joint value (position, angle, etc)
    • Q: :HRP:S:J:V:id:value: -- A: :HRP:A:S:J:V:id
    • (id is an integer between 0 and 999, formatted as 000-999)
    • (value is a number with two decimal places. It must contain the two decimal places, as in 1.00)

Example of information string

  • Q: :HRP:G:R:INFO -- A: :HRP:G:R:INFO:B:MY_BRAND:M:MODEL_A:DOF:2:J:012,056:
  • Q: :HRP:G:J:INFO:012 -- A: :HRP:G:J:INFO:012:J_TYPE:R:J_DESC:CC_MOTOR:J_RANGE:0.00,180.00:J_UNITS:deg:
  • Q: :HRP:G:J:INFO:056 -- A: :HRP:G:J:INFO:056:J_TYPE:T:J_DESC:STEPPER_MOTOR:J_RANGE:0.00,20.00:J_UNITS:mm:
  • The order of the fields are not important because they are stored in an object.

...to be continued

Note

Version 0.1.0 will respond to this specification. Work in progress.