Closed slim71 closed 1 year ago
After some review, I've found an algorithm that seems promising and easy enough for what I want to achieve: Raft. This is vote-based and has a lot of interesting properties, including the support for maintenance of the network I might add later in the project.
I might do some minor changes to the "classic" algorithm to adapt it to my needs. Here's one.
Normally, in Raft the agents vote a candidate following a FIFO approach. I'll be using a data-based decision instead. Since a good choice for the leader seems to be based on its thrust, but I also don't want to mix code and hardware too much, I'll take the mass of the candidate (from its model) as base to decide. This, in some way, is indeed linked to the required rotors the copter would have, which in turn would be reflected in their output thrust (thus, the total thrust of the copter).
Raft implementation completed with commit 8b8322afa654d233ae732fe9803ef4fd4c69cc46. I've done tests with up to three agent. Before closing, I'll try to get more agents involved, carry out more test and maybe add some other enhancements.
Closing after v0.1.0 release
The leader election algorithm must be coded.
The fleet managed in the project should have a leader (to be chosen in some way) which constitutes the main "entry-point" for all data in the user-fleet interaction (built later on). All other agents will then be followers, receiving commands and directions from the leader node.
Since the aim is to build a distributed system, the leader election should be coded in the same way: when selecting a leader, the overall fleet will cooperatively do it. Due to this requirements, a vote-based algorithm seems to be the way to go.