Magicbot vs command framework

Hi

As our team is growing and the robot becoming more complex, I believe we need to start looking at a code framework sooner than later. As we use python, the two options seem to be the Command or Magicbot frameworks. I am interested to hear from other python teams, which is a better option and why?
Thanks

My team used the Python command framework last year. I appreciated it’s similarity to the command framework in other languages, which made it easy to learn and useful even outside of Python. We did run into some issues meeting the 20 ms watchdog, but I don’t know if that was due to this framework or not.

I don’t have experience with the MagicBot framework but perhaps someone else can comment on that.

We’ve been using MagicBot for 2 years now, and so I’ll gladly tell you my opinion on it. We’ve used the command framework before, when we were just starting out with robotpy, so looking at the fact that you are looking for a framework for a more complicated robot, I’ll try to convey you our reasons for using MagicBot.

Basically, for us, it all boils down to the logic behind the framework, and also how easy it is to implement the functionality of the robot, especially with the already huge advantage that is Python. MagicBot basically tries to make a more Pythonic framework, and cleverly uses some features of Python to allow for an overall easier experience of writing robot code. The switch in logic comes from the understanding that MagicBot uses components instead of dividing robot functions into subsystems and commands. We like having each and every part in one place, without having to jump between endless files. In addition, I think the overall autonomous experience, which includes writing the autonomous classes themselves, and how MagicBot organizes them in a way that allows for easy switching between the mods - is a lot better than the Command framework, and working with the StateMachine class is just a charm.

Overall, I would say that it is a matter of preference, and there is no obviously right or wrong choice, it’s what your team would be more comfortable with. MagicBot is really worth a try though, and if you see that it works well for the team, and doesn’t cause any trouble, then purely based on my experience and opinion you should go for it. Not to say that MagicBot doesn’t have some cons, and keep in mind that although it is implemented in other languages, command-based is a lot more popular. But anyhow, don’t forget that the libraries are open to contributions and always being worked on, so if you encounter any issues or difficulties we are always happy to help here in the forum :slight_smile:

Thanks both for the input. It sounds like both will work and may come down to what we are most comfortable with. I do like the state machine and being able to easily switch mods with MagicBot. Might be the way to go for us then. By selecting python we are already at peace with knowing there is not as much sample code out there, so would not expect it be any different for the framework :slight_smile:
Thanks again - much appreciated.

1 Like

In case you haven’t found them yet, there’s quite a few examples on github: https://github.com/robotpy/examples :slight_smile: