node_server

Andrew Dresner edited this page Jan 6, 2016 · 8 revisions

Overview of node_server

Node.js API Server for HR-OSX Humanoid Robots

You must build the api_wrapper.so prior to running the node_server project, see api_wrapper README.

**This project does NOT work without a bit of code modification and page remapping, as it needs updating to bring it up to sync with the motion page changes we made among other things. **

This project allows the use of a Node.js API Server. This node_server project connects to the HR-OSX-Framework libraries via Linux/build/api_wrapper/api_wrapper.so The api_wrapper.so has basic high-level functions of the robot exposed to the node_server API, allowing users to send high-level commands such as "walk on/off, walk forward/back X speed, Turn left/right Y degree/sec, play action page X, etc"

It uses a socket server connection over IP to communicate with a Hello World app on a remote device (Android Tablet, etc).

Getting Started

Ensure these are installed via root user or sudo.

node_server dependencies & install

Dependencies: (installed via package.json file)

Change Directory to your node_server project folder:

$ cd path/to/HROSXFramework/Linux/project/node_server

Install dependencies via npm install, using package.json file within node_server:

$ npm install

This installs socket.io, ffi, node-gyp, and grunt.

To launch the node_server app.js program:

$ node app.js

Optional: If you would like to build a minimal version of the node server, dev dependencies are required:

$ npm install --dev

Lint node.js install:

$ grunt

To launch the minimized node_server app.js program:

$ node node-app.min.js

node_server start on boot

  • HR-OS5 Humanoid Research Robot

    • Use upstart to start node server
  • HR-OS1 Humanoid Robot

    • Use init.d to start node server

node_server test

Make sure the node server is running properly:

  • Type http://<ipaddress>:<port#> in the URL box
    • You should see various action "pages" buttons

Android App 'Hello World' walkthrough

References