|
| 1 | +# RealSense OCF Demos |
| 2 | +These samples illustrate how to develop applications using Intel® RealSense™ JavaScript [API](https://01org.github.io/node-realsense/doc/spec) and Open Connectivity Foundation™ ([OCF](https://openconnectivity.org)) JavaScript [API](https://github.com/01org/zephyr.js/blob/master/docs/ocf.md). |
| 3 | + |
| 4 | +## Architecture |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | +## Demos |
| 9 | +The following demos are provided in this release. |
| 10 | + - **Control light by distance**(demo1): This sample app illustrates the use of libRealsense, libPT, and the Linux SDK Framework to use the ZR300 camera's depth and color sensors to detect people in the scene. Detected person in the scene will be displayed with the distance information on screen. Meanwhile, the led light will be on and off according to the person's position changing. |
| 11 | + - **Control light/buzzer by person recognition**(demo2):This sample app illustrates how to register new users to the database, upload the database to identify them when they appear in the scene. Recognized person in the scene will light a green led, otherwise light a red one and open buzzer. |
| 12 | + |
| 13 | +## Get Start |
| 14 | + |
| 15 | +### Hardware |
| 16 | +- PC with Ubuntu 16.04 |
| 17 | +- [MinnowBoard Turbot](https://store.netgate.com/Turbot2.aspx) |
| 18 | +- [Intel® RealSense™ Camera ZR300](https://newsroom.intel.com/chip-shots/intel-announces-tools-realsense-technology-development/) |
| 19 | +- [Grove Chainable RGB LED](http://www.seeedstudio.com/depot/twig-chainable-rgb-led-p-850.html?cPath=156_157) |
| 20 | +- [Grove Buzzer](http://wiki.seeed.cc/Grove-Buzzer/) |
| 21 | + |
| 22 | +### Setup RealSense Execution Environment on Ubuntu |
| 23 | + |
| 24 | +1. Please refer to this [tutorial](https://github.com/01org/node-realsense/blob/master/doc/setup_environment.md) to set up RealSense test environment on Ubuntu. |
| 25 | + |
| 26 | +2. Execute belows commands to start this demo journey: |
| 27 | + ```bash |
| 28 | + # git clone https://github.com/wanghongjuan/ocf-realsense-demos.git |
| 29 | + # cd ocf-realsense-demos |
| 30 | + # export API_SERVER_HOST=<The-OCF-Server-board-ip> |
| 31 | + ``` |
| 32 | + Please follow below guide to set up ocf server environment at first, then you can enter directory "demo1" or "demo2", following the corresponding README file to launch the demo. |
| 33 | + |
| 34 | + |
| 35 | +### Setup OCF Server Test Environment on MinnowBoard Turbot |
| 36 | +1. Please follow this [instruction](https://minnowboard.org/tutorials/installing-ubuntu-16.04-on-minnowboardmax) to install Ubuntu 16.04 on MinnowBoard Turbot. |
| 37 | + |
| 38 | +2. Install Node.js at first, v6.11.2 preferred(https://nodejs.org/en/download/package-manager/) |
| 39 | +3. There are some dependencies(uuid-dev, libcure4-openssl-dev and a C++ compiler (gcc-5 or later) etc.) need to install at first, you can install them via command: |
| 40 | + ```bash |
| 41 | + # sudo apt-get install uuid-dev libcurl4-openssl-dev libboost-all-dev sqlite3 libsqlite3-dev glib2.0-dev scons git |
| 42 | + ``` |
| 43 | +4. Install [`iot-rest-api-server`](https://github.com/01org/iot-rest-api-server) via command `npm install iot-rest-api-server`, for detail information, please refer to [here](https://github.com/01org/iot-rest-api-server/blob/master/README.md). Launch the rest api server: |
| 44 | + ```bash |
| 45 | + # cd node_modules/iot-rest-api-server |
| 46 | + # node index.js & |
| 47 | + ``` |
| 48 | +5. The other dependence is `libmraa` that Low Level Skeleton Library for Communication on GNU/Linux platforms, you can install it via `npm install mraa`. |
| 49 | + |
| 50 | +6. Please refer to this [guidance](./ocf-servers/README.md#setting-up-the-hw) to setup the sensors on this board |
| 51 | + |
| 52 | +7. Copy the downloaded repo "ocf-realsense-demo/ocf-servers" from the host to this board, then execute below commands to launch all sensors server as administrator(user "root"). |
| 53 | + ```bash |
| 54 | + # which node #Remember this node path |
| 55 | + # pwd #Remember this ocf-servers path |
| 56 | + # sudo -i |
| 57 | + # export PATH=$PATH:[path-to-node] |
| 58 | + # cd [path-to-ocf-servers] |
| 59 | + # npm install |
| 60 | + # export NODE_DEBUG=buzzer;node buzzer.js & |
| 61 | + # export NODE_DEBUG=rgb_led;node rgb_led.js & |
| 62 | + ``` |
| 63 | + Check these launched server resources whether can be found via iot-rest-api-server |
| 64 | + ```bash |
| 65 | + # cd <path-of-restapi-install> |
| 66 | + # ./test/oic-get /res |
| 67 | + ``` |
| 68 | + Then you can find the registered resource `/a/buzzer` and `/a/rgbled`. |
0 commit comments