Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Redundancy: getSwarmBots() and getAllPose() #10

Open
pranitbauva1997 opened this issue Mar 29, 2017 · 3 comments
Open

Code Redundancy: getSwarmBots() and getAllPose() #10

pranitbauva1997 opened this issue Mar 29, 2017 · 3 comments

Comments

@pranitbauva1997
Copy link
Contributor

The file Swarmbot.h contains getSwarmBots() while Communication.h contains getAllPose(). On looking closely into both the methods, I think they do the exact same thing. Am I wrong? If not, then we should just stick to one.

@SpandanKumarSahu
Copy link
Contributor

Yeah, they both are same.

The original motivation behind this was the getSwarmBots() in Swarmbot.h will retrieve the pose data of all bots, that was last stored, while the getAllPose() will be the pose data, that is available from the communication network at that moment.

The difference between the data could be used to know, the state of the bot (dead/down/alive) or error in network. But since, this was a simple simulator, I just copied the same function. Anyway, since, the simulator is simple enough, and this feature is a bit far-fetched, we can remove the getSwarmBots() under Swarmbot.h

@SpandanKumarSahu
Copy link
Contributor

Also, in case of other types of bots joining, we will get data of all bots, irrespective of the type, from the communication. But if we specifically want to access only SwarmBots, this might be the way.

@mankeyboy
Copy link
Member

If you are building this to test distributed code, then I see the point of having this, otherwise, if you are just going to be testing it on one system only, you can close this issue with the changes.
What I will suggest is that go ahead on keeping both the functions and overload it later on by making one virtual or just changing the functionality itself when you add a communication from other nodes here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants