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 🙏

© 2025 – Pkg Stats / Ryan Hefner

rocs-client

v1.2.9

Published

RoCS-Client SDK (Javascript/Typescript) For Fourier

Downloads

1

Readme

RoCS JavaScript/TypeScript Client SDK

The SDK operates based on the concept of encapsulation, neatly organizing essential robot functions into separate classes, each equipped with specialized methods. Developers can make use of these encapsulated capabilities through provided interfaces, making it easy to create customized applications seamlessly. Whether you need to fine-tune low-level motor operations, coordinate complex high-level motion sequences, manage audio/video transmission, implement SLAM for mapping, or monitor odometry, the SDK's modular structure ensures flexibility and simplicity for developers to customize your solutions.

Prerequisite

Prior to the setup, install Node.js and npm:

  • Download and install Node.js from nodejs.org.
  • npm (Node Package Manager) comes bundled with Node.js.
  • Verify installation by running node -v and npm -v in your terminal.

Installing JavaScript/TypeScript SDK

The RoCS JavaScript/TypeScript Client packages can be easily installed or upgraded with the following command.

npm install rocs-client

Verifying the Installation

Run the following command to verify the installation:

npm list rocs-client

The following output signifies a successful installation.

C:\Users\Fourier>npm list rocs-client
Fourier@ C:\Users\Fourier
`-- [email protected]

Using JavaScript/TypeScript SDK

  1. Import the SDK to your JavaScript/TypeScript code.
import {Human} from 'rocs-client';   // import human class of RoCS client module
  1. Create a robot object.
import {Human} from 'rocs-client';  // Import Human, Car, Dog, etc

let human = new Human({host: '192.168.9.17'}); // Please replace host with the ip of your device
  1. Control the robot.

    You can use the following methods of the human class to control the robot:

    • start(): initiates or resets control.

    • stop(): triggers an emergency stop (halts with power off).

    • exit(): ends robot control session.

    • stand(): commands the robot to stand in place.

    • walk(angle, speed): guides the robot in movement.

      • angle(float): controls direction with a range of plus or minus 45 degrees. Positive for left, negative for right. The value is an 8-digit floating-point number.
      • speed(float): manages forward and backward movement with a range of plus or minus 0.8. Positive for forward, negative for backward. The value is an 8-digit floating-point number.
    • head(roll, pitch, yaw): directs the GR robot's head movements.

      • roll(float): controls the roll angle (rotation around the x-axis). Negative for left, positive for right, within the range of (-17.1887-17.1887).
      • pitch(float): adjusts the pitch angle (rotation around the y-axis). Positive for nodding forward, negative for nodding backward, within the range of (-17.1887-17.1887).
      • yaw(float): manages the yaw angle (rotation around the z-axis). Negative for turning left, positive for turning right, within the range of (-17.1887-17.1887).
    • move_joint(*motor): moves joints (variable length parameter, capable of controlling multiple joints simultaneously, estimated delay 2ms).

      • motor(Motor): joint object, provides joint mapping relationships and parameter numbers through human.motor_limits.
    • upper_body(arm_action, hand_action): executes preset commands for the upper limbs.

      • arm_action(ArmAction): enumeration for arm preset commands.
      • hand_action(HandAction): enumeration for hand preset commands.

Example code

Here's an example code snippet showcasing the utilization of the JavaScript/TypeScript Client SDK for robot control:

// Import Human class from the 'rocs-client' library
import {Human} from'rocs-client';  

// Create an instance of the Human class with the specified robot IP
let human = newHuman({host:'192.168.9.17'});      // Replace '192.168.9.17' with your robot's actual IP

// Enable remote control for the robot
human.start(); 

// After a brief delay, execute a sequence of actions
setTimeout(() => {
    // Make the robot stand up
    human.stand() 
    // Move the robot forward at a speed of 0.1
    human.walk(0, 0.1) 
    // Wave left hand
    human.upper_body(arm=ArmAction.LEFT_ARM_WAVE)   
    // Wave both hands
    human.upper_body(arm=ArmAction.TWO_ARMS_WAVE)   
    // Tremble the fingers
    human.upper_body(hand=HandAction.TREMBLE)   
  
    //Move motor no.1 left and right by 10 degrees each
    human.move_joint(Motor(no='1', angle=10, orientation='left'),

          Motor(no='1', angle=10, orientation='right')) 

  

    //  Control system built-in state machine to ensure the normal robot calibration and startup. It is recommended to execute subsequent commands 10 seconds after the start() command.

}, 10*1000)

Release History

| Version | Released by | Date | Description | | ------- | --------------------------- | ------- | ----------------------------------------------------------------------- | | 0.1 | Fourier Software Department | 2023.8 | 1. Project initiation2. Confirm basic architecture | | 0.2 | Fourier Software Department | 2023.9 | 1. Control module, system module2. Specific coding | | 1.1 | Fourier Software Department | 2023.10 | 1. Hand, head preset actions2. Single joint control of upper body |