m-abdulhak / SwarmJS

Interactive 2D swarm robotics simulation platform developed to prototype, benchmark, and showcase control algorithms for multi robot systems.
https://m-abdulhak.github.io/SwarmJS/
10 stars 7 forks source link

Allow users to define custom controllers #5

Closed m-abdulhak closed 1 year ago

m-abdulhak commented 1 year ago

Add a code editor that allows users to dynamically define and use their own controllers for the specified scene from the UI without the need to modify the code and redeploy.

avardy commented 1 year ago

Sorry I'm a month late in taking a look at this. Overall, it seems to work great once a scene is loaded. However, there are some outstanding issues:

  1. When switching between scenes, the "loop" field will update once the user clicks the "Reset Code" button. However, the "init" field doesn't.
  2. In the Orbital Construction scene the "loop" field for the default code calls another function (getAngularSpeed). This doesn't show up anywhere. Perhaps we just need to forbid either block of code from calling external functions?