Skip to content

oklemenz/RobosenJS

Repository files navigation

RobosenJS

K1 (Interstellar Scout K1 Series)

Getting Started

  • Install Node.js
  • Check-out project:
    • Checkout: git clone https://github.com/oklemenz/RobosenJS.git
    • Install: npm install
    • Test: npm test
    • Run: npm start
    • Demo: npm run demo
  • Use CLI:
  • Use Node.js module:
    • Install module: npm install robosen-js
    • See Programming section

Features

  • REPL for direct command execution
  • Control robot via keyboard or game controller
  • Perform sequence of commands via natural language prompt or voice
  • Perform sequence of joint moves via natural language prompt or voice
  • Record and playback sequences of joint movements
  • Program using Node.js robot API with JavaScript or TypeScript

Command-Line Interface (CLI)

  • Install globally: npm install -g robosen-js
Read-Eval-Print-Loop (REPL)

Terminal: k1

  • Type Volume 100 to change volume
  • Type Left Punch to punch left
  • Type Left Arm -30% to move
    • number: absolute value based movement
    • +/-: relative value based movement
    • %: percentage based movement (0-100%)
  • Type Boogaloo to perform dance action
    • Press any key to stop activity
  • Press Tab for completion suggestions
Control

Terminal: k1 control

  • Controller:

    • Press button L for Left Punch
    • Move Robot:
      • Move left stick to control movement
    • Move Joints:
      • Use DPad to select body parts:
        • up: Head
        • right: Right Arm
        • left: Left Arm
        • down: None (-> Move Robot)
      • Control body parts with left/right stick
  • Keyboard:

    • Move Robot:
      • Use arrow keys to control movement
      • Use delete/pagedown for side steps
    • Move Joints:
      • Use WASD to select body parts:
        • w: Head
        • a: Left Arm
        • s: None (-> Move Robot)
        • d: Right Arm
      • Use arrow keys to control movement
      • Use space to reset position

Details see controller, keyboard and control section in K1/robot.json.

Prompt

Prerequisites:

  • Setup .env specifying OPENAI_API_KEY

Terminal: k1 prompt

  • Type your command in natural language.
  • E.g., enter: Walk forward and punch left

Terminal: k1 prompt joint

  • Type your moves in natural language.
  • E.g., enter: Wave your right hand and shake your head
Voice

Prerequisites:

Terminal: k1 voice

  • Speak your command in natural language.
  • E.g., say: Walk forward and punch left

Terminal: k1 voice joint

  • Speak your moves in natural language.
  • E.g., say: Wave your right hand and shake your head
Recording

Terminal: k1

  • record <file>
  • unlock head
  • Move head manually to right
  • sync
  • Move head manually to left
  • sync
  • save change
  • Recorded file is located at recordings/K1/<file>.json
  • run <file>

Terminal: k1 run <file>

Programming

  • Install module: npm install robosen-js
  • Use module:
    • ESM:
      import { K1 } from "robosen-js";
    • CJS:
      const { K1 } = require("robosen-js");
  • Example usage:
import { K1 } from "robosen-js";
const k1 = new K1();
await k1.on();
await k1.volume(100);
await k1.autoStand(false);
await k1.moveForward();
await k1.leftPunch();
await k1.headLeft();
await k1.leftHand("+40%", 30);
await k1.audio("AppSysMS/101");
await k1.wait(3000);
await k1.end();

Specification

K1 specification and all commands can be found at K1/robot.json.