Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 2.29 KB

readme.md

File metadata and controls

58 lines (42 loc) · 2.29 KB

Fuzzy logic controlled robot simulation

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

Running local demo

Serve src/ directory
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