This is a simulation of a robot controlled by fuzzy logic. It is built in JavaScript and runs in modern browsers, ideally in a machine with a graphics accelerator.
- jQuery - HTML manipulation and event handling
- Three.js - JavaScript 3D library
- Physijs - Physics plugin for Three.js
- Stats.js - JavaScript performance monitor
- Simplex-noise - Noise generation algorithm
npm i -g static-server
static-server -p 1234 src/
# open localhost:1234
-
Method Description setRenderer() Sets scene renderer setScene() Sets overall scene and gravity setLights() Creates lighting components setCameras() Creates cameras from views.json
descriptioncreateGround() Creates a solid floor and texture createObstacles() Creates map and obstacles of random sizes and positions createBot() Creates a robot with body, wheels, physics, and controls createSensors() Creates and initializes sensors and visualization -
Method Description update() Simulation update loop updateSensors() Simulates sensors' operations and their projections updateControl() Bridge between controller and bot actuators updateText() UI texts update loop updateWindowSize() Updates canvas on window resize -
Method Description autoDrive() Drives the bot based on fuzzy rules and speed fuzzy() Applies the set of fuzzy rules from sensor readings