Skip to content

lucaspar/fuzzy_bot_sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages