Skip to content

Instantly share code, notes, and snippets.

@akshat-khare
Last active September 9, 2020 01:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akshat-khare/2afb8698b48e0f5391c869fa07363eca to your computer and use it in GitHub Desktop.
Save akshat-khare/2afb8698b48e0f5391c869fa07363eca to your computer and use it in GitHub Desktop.
Google Summer of Code 2018 - Akshat Khare - Open Roberta Lab - Contributions - GSoC 2018 with Open Roberta Lab

Google Summer of Code 2018 Final Working Product -

Student Akshat Khare
Github @akshat-khare
Organisation Open Roberta Lab
Project Multiple robots in simulation
Mentors Kostadin & Beate, Important help also provided by Stephan

Aim

To add the feature of multiple simulations for EV3 Robot. The Open Roberta® Lab provides a simulation, where users can test their programs without a real robot. Previously, the simulation only supported one board. I extended it in such a way that it is now possible to simulate behaviour of two or more robots efficiently. This would be achieved by first simulating multiple obstacles and analysing the optimisation needed to support heavy computation. Further simulating multiple robots with comfortable UI was done. Project broadly involved design practices involved in working with JavaServer Pages, Jetty Framework, Asynchronous JavaScript and many other technologies used in the project.

I contributed in several ways to Open Roberta Lab within the 2018 Google Summer of Code period and my main contribution was towards the Multiple robots in simulation.

My contributions to Open Roberta Lab repository are listed below.

Multiple robots in simulation: Github Repository & Fork

WorkLog

  • Before First Evaluation:

    • Understanding the codebase of the repository and tweaking with them.
    • Designing the interface with the help of mentors on paper.
    • Setting minumum and maximum achievable goals for the project.
    • Development of Popup with the saved programs list.
    • Making a Bootstrap table based on extended bootstrap table library and initializing desired robots to be simulated.
  • Before Second Evaluation:

    • Development of UI for simulating multiple robots.
    • Sending requests to the server for converting blockly xml to javascript program.
    • Converting xmltext to javascript program and sending it back to client.
    • Sending multiple requests asynchronously fetching them.
    • Cross-checking the received javascript program for any errors and alerting the same to the client.
    • Increasing the number of obstacles from 1 to 21 to check if the browser is slowing down due to increased computation.
    • Optimizing the math for collision detection to conclude that there is no need for any third party physics engine for simulating multiple objects. The calculation for the same could be done with existing maths module developed by OpenRoberta itself.
    • Initializing the simulation from the multiple javascript programs with multiple obstacles.
  • Before Final Evaluation:

    • Initializing multiple robots with rendering enabled on screen.
    • Changing various existing functions to optimize for the multiple simulation.
    • Since due to existing codebase, every instance of robot was linked with prototype chaining hence change in one robot resulted in other, the structure of EV3 robot was changed to nullify prototype chaining effect.
    • Ultrasonic sensor values and rendering of ultrasonic waves debugged.
    • The program was tested and debugged with each robot detecting obstacles and reacting to them but not detecting each other as obstacle, thus not interacting with each other in the desired way.
    • The math was not designed to handle obstacle cases when the obstacle is not paralled to x and y axis, therefore its solution was discussed with mentors.
    • The math was redesigned to take into consideration obstacles not parallel to x and y axis.
    • The math was further optimized to give faster computation.
    • Finally multiple robots were simulated and rendered with each detecting other as obstacle.
    • Prototype chaining of more elements like color sensor was solved.
    • Mouseevents were added to move the robot with the help of mouse.
    • Added sensor views to display sensor values of some particular robot and focus on that robot.
    • Debugged the pause feature, stop feature.
    • Added numbering to the robots for the identification of the robot's program.
    • Debugged the error which caused the browser to crash because of excessive memory usage by the sensor values.
    • Added a dropdown list to chose the robot of consideration to be simulated.
    • Configured double mouse click to change the robot of consideration.
    • Debugged the error which caused reinitializion of multiple robots after single robot simulation to be buggy.
    • Designed an algorithm to give random colors to robots upon initialization. Made the algorithm to inherently light colors to robots.
    • Added the feature of changing blockly workspace when the robot of consideration is changed. This will help user to debug the program more eficiently.
    • Added key events to rotate the robot of consideration by pressing up or down key.
    • Debugged an error which caused failure in initializing multiple simulation after executing single simulation and vice versa.
    • Debugging and documentation.

Results

The task was completed fully in time. The issues still hanging around which I am planning to solve asap are:

  • The git commit history is having many commits repeated, they are needed to be fixed.
  • More documentation of the code is needed.
  • The Css values effecting undesired colors in table needs to be resolved.

The code got merged in a separate branch in the Open Roberta Lab repository. It was merged in a separate branch because of the problems with the commit history.

Quick References

For seeing the working of the project quickly you can see the following videos I uploaded in my channel:

Blog Posts

All of my blog posts related to my work can be found in the Open Roberta Google Group https://groups.google.com/forum/#!forum/open-roberta

@rishabhdeepsingh
Copy link

Great Job 👍

@prem0862
Copy link

Looks great:)

@sunil-sopho
Copy link

Awesome old roommate

@Andrea171-ai
Copy link

Muy bueno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment