Go to Post Come on baby, do the logomotion with me. - JaneYoung [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-12-2014, 19:12
Sigma7 Sigma7 is offline
Registered User
FRC #0283 (General Robotics)
Team Role: Programmer
 
Join Date: Dec 2014
Rookie Year: 2005
Location: Greenville, SC
Posts: 2
Sigma7 is an unknown quantity at this point
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-ro...283-offseason/
Reply With Quote
  #2   Spotlight this post!  
Unread 02-01-2015, 10:43
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
Re: Team 283 Code Release

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).
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
Reply With Quote
  #3   Spotlight this post!  
Unread 02-01-2015, 19:59
Sigma7 Sigma7 is offline
Registered User
FRC #0283 (General Robotics)
Team Role: Programmer
 
Join Date: Dec 2014
Rookie Year: 2005
Location: Greenville, SC
Posts: 2
Sigma7 is an unknown quantity at this point
Re: Team 283 Code Release

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.
Reply With Quote
  #4   Spotlight this post!  
Unread 31-01-2015, 12:20
mandrews281 mandrews281 is offline
Registered User
FRC #0281
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Greenville SC
Posts: 82
mandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to behold
Re: Team 283 Code Release

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:

Code:
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.
__________________
Michael Andrews
Team #281 Programming Mentor
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:44.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi