I'm planning to build some simple robotic boats. They will be travelling some distance alone but should also be able to group and physically connect together to form one boat. When they are near each other I want them to be able to "know" that they are near each other, identify each other, communicate and locate each other so that they know how to physically connect to each other.
As an example, let's say that we've got 3 boats: X, Y and Z. Boat X should be able to say for example the following:
Boat Y is located at 90 degrees and boat Z is located at 210 degrees from me.
and similarly, boat Y should be able to say:
Boat X is at 270 degrees and boat Z is located at 230 degrees from me.
My idea was to use bluetooth to make boats identify each other, wifi to communicate and send each other their GPS location to locate each other. I thought it could work like this:
- Each boat makes itself permanently discoverable with bluetooth, using a number as bluetooth name (e.g.:
boat_1
,boat_48
,boat_285
). - When a boat "sees" at least one other boat with a lower number and no boat with a higher number (i.e.: the boat realizes it's the highest number of the group) it sets up a wifi hotspot to which the other boats can connect. This boat becomes the "master" boat hosting the connections to all the boats that are near.
- The master boat then hosts an API endpoint on the internal network to which all boats can post their information and from which they can retrieve the information of the other boats.
- All boats continuously post their gps coordinates and continuously retrieve the gps coordinates of the other boats.
- Using the GPS coordinates the master boat decides what the physical order will be in which the boats should physically connect with each other. So boat X connects to boat Y and boat Z connects to boat X.
- Every boat moves behind the boat to which he is assigned by the master boat and connects to the boat in front of him.
Apart from some obvious security and failover issues, to me this sounds like something that could work. I have no experience with this though, so I wonder whether anybody knows any better ideas to let boat-robots identify, communicate and locate each other when they're near each other? I read about Zigbee Mesh Networks but since I'm familiar with wifi I thought of starting with that.
All tips are welcome!