A PID Simulator written in Web Assembly.
The goal of this project is to help students with a high school math background (specifically students competing in First Robotics) understand PID controllers. Many of the descriptions of how PID controllers work (example: https://en.wikipedia.org/wiki/PID_controller) assume math background that isn't until the senior years of high school.
Web page link to try it out: https://glowmouse.github.io/wasm_pid/
This page was built using example code from https://github.com/AE1020/nanogui-GLES-wasm
Directory | Description |
---|---|
docs | The web page generated by the project |
ext | Libraries from external sources |
include | Include files for the nanogui toolkit |
models | 3D STL models for the PID Simulator Robot Arm + Converter |
nanogui_src | Source files for the nanogui toolkit |
pidsim | The PID simulator source C++ source code |
- Install the emsdk web-assembly compiler (see https://emscripten.org/docs/getting_started/downloads.html for instructions)
- As per the instructions on https://emscripten.org/docs/getting_started/downloads.html, source emsdk_env.sh (i.e., source "emsdk/emsdk_env.sh")
- Clone the wasm_pid repository
- In the source directory, git clone https://github.com/libigl/eigen.git ext/eigen. This copies the eigen library into the source tree.
- Make a separate build directory (i.e., mkdir build_wasm_pid) and cd into it
- Run cmake (i.e., if wasm_pid and build_wasm_pid are in the same directory cmake ../wasm_pid -B .)
- make
- In a separate window, make server. This will start a mini web server.
- In a browser, go to http://localhost:8000
The web page can be hosted by either taking the docs directory and copying the files into the web page directory or having github host the docs directory See https://pages.github.com/ for information on setting up a github page.