Skip to content

Developing on a Computer via Local Host

dcyoung edited this page Sep 1, 2017 · 7 revisions

Work in Progress...


Concept

The scanner scripts (from the scanner/ directory) depend on software libraries for the hardware used by the scanner. These dependencies include:

In order to develop the scanner logic and the webapp without requiring these dependencies, the scanner/ directory includes dummy implementations of the dependencies. The following dummy scripts simulate the behavior of the scanner hardware and dependencies:

  • dummy_sweeppy.py
  • dummy_Adafruit_MotorHAT.py
  • dummy_GPIO.py

Running the node application with the dummy flag ("node ./app.js -d") replaces the dependencies in the python scripts with the dummy implementations. This enables rapid development of the webapp from a normal computer over localhost without requiring any scanner hardware or the installation of dependencies. All you need installed is node, python and numpy.

Quickstart

Installing the webapp on your local machine:

# Clone the repo
git clone https://github.com/scanse/sweep-3d-scanner
# Install app dependencies
npm install

Once installed, execute the webapp with the dummy flag:

# Launch the dummy app
node ./app.js -d

Then, use a web-browser (such as google chrome) on same computer to navigate to http://127.0.0.1:8080. From there you can use the webapp over local host with a simulated scanner.