Team 283 Code Release

Team 283 is a new team set to compete in the 2015 season. During this off-season, we created a robot to play Aerial Assist as an exercise for our team members. The code we wrote for this robot is in a Google Code project linked below. Feel free to pm me with any question or comments.

https://code.google.com/p/general-robotics-283-offseason/

Looks like an excellent framework. I see that you did something similar to Command Based, but off of an iterative framework. What was your reasoning for this? Do you prefer iterative? (my teams debating doing something similar to your set up, with iterative as a base and classes for each subsystem, or the command based template).

Personally, iterative is easier to follow and debug. Having each subsystem as a separate class allows for them to be, in a sense, self contained and to me this seems simpler than the command base structure.

Let me add a couple of comments.

The framework started in Team 281 before the command driven robot was introduced by FIRST. As Sigma7 mentioned, we find it’s easier to understand for new programmers and it tended to have fewer issues (at least for us) than the Command driven robot (e.g. memory/object accesses between threads). These problems were especially prevalent when the subsystems needed to communicate with each other.

I will say we haven’t tried a command driven robot since the first year, and it looks like it has improved since then, so take this with a grain of salt. But we’ve been using it for many years and it has worked well for us.

By the way Sigma7, I’ve improved the base class (RobotSubsystem) for this year so that it automatically registers the subsystem with the main robot at the time of construction. Each of the IterativeRobot methods looks something like this now:


TeleopPeriodic()
{
    // Do any operator input changes here

   // Loop over subsystems and let them do their work
    for (std::list<RobotSubsystem *>::iterator it = m_subsys.begin() ; it != m_subsys.end(); ++it) {
        (*it)->TeleopPeriodic();
    }
}

Everything is done relatively automatically. Our 2013 Entech code (also on Google Code) was the inspiration for the work. I’ll post a baseline if anyone is interested.