DEVLOG 1 - LINE
My goal is to make a fully decentralized robot swarm, fast and precise enough to form complex patterns, which to my knowledge has never been done before. Before I make the physical robots however, I want to simulate them.
How it works
Communication
All the robots communicate via an external Network class that passes messages between the robots. Because I’m trying to simulate real IR emitters and receivers, the only information the network gives is the distance and direction of the signal. Every tick, the robots emit a heartbeat-like signal to their peers, and use the signals they receive to construct an internal map of the swarm.
Formation
Once they know where their neighbours are they can start moving in formation. Initially, I had them organise in a line from 0-4. This worked but it was very slow, because they would go to spots that were further away than necessary. After spending some time working it out on a whiteboard (and consulting chatgpt), I decided on a new method.
Using their internal map, they find the 2 robots with the largest distance between them and this becomes the line they use. They then compare every robot’s distance from the start of the line to determine the order, and move to their assigned point on the line. With this new algorithm, they can arrange themselves a lot faster with less collisions
Notes
Right now my goal is to make the simulation fully functional with as much detail as possible, down to the individual motors powering the wheels. Once this is complete, the simulation will be theoretically perfect. After that, the next step is implementing noise to make it a true simulation of real life. This will also be very helpful when I eventually build the real robots.
Until then, the next thing I want to add is real sensors. Right now, the robots magically know which direction the signal came from, but real ones will have a ring of IR receivers, and compare the signal strengths to determine the angle of origin.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.