/fossbot-web-simulator

Primary LanguageGDScriptMIT LicenseMIT

🤖 GSOC 2023 - Web Based robotic simulator for the DIY robot kit for educators

simple robot

Introduction

This project introduces a web-based fossbot simulator developed using the open-source game engine Godot 3.5.2. It encompasses all methods in the fossbot interface, for which you can find more details here and introduces new features, like controlling multiple fossbots and dynamically creating levels from the client, providing an immersive platform. Communication relies on a Flask-SocketIO server I developed, using rooms. Additionally, Python and JavaScript libraries have been created for running the simulator.

For more details on the fossbot web simulator, please refer to this repository or the comprehensive wiki, in which I go in detail about the new Fossbot Web Simulator implementation and the JavaScript Library. Similarly, for additional insights into the fossbot Python library, you'll find a wealth of information in this wiki.

View the project on Google Summer of Code website.

You can see the detailed timeline here.

Fossbot web simulator showcase video

Final Report

You can visit this gist that summarizes in a few words, the work which was done during the Google Summer of Code working period.

Synopsis

This project offers the capability to run and thoroughly test all functions of the fossbot (which can be found in the corresponding section of thiw wiki). Furthermore, it facilitates dynamic level creation using JSON messages available in the Python library. The process to test the simulator locally involves the following steps:

  1. Familiarize yourself with the web simulator documentation.
  2. Install the godot fossbot library and refer to its documentation.
  3. Launch the server by executing the command below (from the exports directory of current repository):
python3 server.py
  1. Open http://localhost:8000/godot or http://localhost:8000/godotcode in your web browser.
  2. Copy the session ID.
  3. Run the simulator using the fossbot godot library in Python (if connected to /godot) or directly from the browser (if connected to /godotcode).

Challenges and Solutions

One of the central challenges encountered during the project was the creation of the fossbot model from scratch. Although Godot does not inherently restrict vehicles to only four wheels, implementing a three-wheeled vehicle proved an intricate challenge. To ensure precise and realistic fossbot movements, I devised custom methods to adapt the model's center of gravity and exhaustively tested various options for optimal results.

Additionally, crafting accurate representations of each robotic component (like the ultrasonic sensor, line sensor and light sensor) for the fossbot from scratch posed another significant challenge. I meticulously matched these virtual parts to their real-world counterparts, aiming for authenticity and flawless functionality within the simulation.

Addressing the complexities of the socketio server presented another hurdle. To ensure seamless message routing without message conflicts in multiple fossbot scenarios, I conceived a message distributor within the simulation, effectively utilizing socketio's capabilities.

Furthermore, devising a dynamic level generation process encompassing obstacles, terrain, and image integration onto the floor also demanded innovative problem-solving techniques.

GSoC Deliverables

  1. Fossbot Model Implementation
  2. Robotic Component Integration in Godot
  3. Multiple Fossbot Message Routing Mechanism
  4. Advanced Level Generation System
  5. Flask-Socketio Server Development
  6. Web Simulator Frontend Design
  7. Expansion of fossbot's source library
  8. Development of JavaScript Library for Fossbot
  9. Comprehensive Usage Documentation

Future Work

There are still opportunities for further enhancement of the Fossbot Web Simulator. I am confident that, with the combined efforts of the Open Source community, this goal can be achieved. Feel free, to contribute and participate on this project, any suggestions and improvements are welcome.

Some thoughts for future work:

  1. Enhance Fossbot Model in Godot
  2. Refine Terrain Generation
  3. Diversify Preset Client Levels
  4. Extend JavaScript Library
  5. Extend Python Godot Library for AI Training

Student

GSoC Mentors

Organization : Open Technologies Alliance - GFOSS

MIT License