https://github.com/lucaspar/fuzzy_bot_sim
Fuzzy Logic Robot Simulator
https://github.com/lucaspar/fuzzy_bot_sim
fuzzy-logic robot simulation threejs webgl
Last synced: 7 months ago
JSON representation
Fuzzy Logic Robot Simulator
- Host: GitHub
- URL: https://github.com/lucaspar/fuzzy_bot_sim
- Owner: lucaspar
- License: mit
- Created: 2017-06-05T20:06:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-05T20:20:45.000Z (over 7 years ago)
- Last Synced: 2025-03-16T10:42:00.641Z (10 months ago)
- Topics: fuzzy-logic, robot, simulation, threejs, webgl
- Language: JavaScript
- Homepage: https://lucaspar.com/fuzzy_bot.html
- Size: 1.4 MB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
## Fuzzy logic controlled robot simulation
### [Demo](https://lucaspar.com/fuzzy_bot.html)
> 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.
### Project dependencies
* [**jQuery**](https://jquery.com/) - HTML manipulation and event handling
* [**Three.js**](https://threejs.org/) - JavaScript 3D library
* [**Physijs**](https://chandlerprall.github.io/Physijs/) - Physics plugin for Three.js
* [**Stats.js**](https://github.com/mrdoob/stats.js/) - JavaScript performance monitor
* [**Simplex-noise**](http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf) - Noise generation algorithm
### Running local demo
##### Serve src/ directory
```bash
npm i -g static-server
static-server -p 1234 src/
# open localhost:1234
```
### Overview
* #### Scene components `scene.js`
Method | Description
--------------------|-------------------------------------------------------
setRenderer() | Sets scene renderer
setScene() | Sets overall scene and gravity
setLights() | Creates lighting components
setCameras() | Creates cameras from `views.json` description
createGround() | 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
* #### Dynamics and system evolution `dynamics.js`
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
* #### Bot controls `controls.js`, `fuzzy.js`
Method | Description
--------------------|-------------------------------------------------------
autoDrive() | Drives the bot based on fuzzy rules and speed
fuzzy() | Applies the set of fuzzy rules from sensor readings