Go to Post Stupid programmer question: where does the tread go? - Joel J [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #19   Spotlight this post!  
Unread 27-02-2014, 07:38
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 582
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
Re: Impressions: Command Based Robot

I'm a big fan of the command-based approach, primarily because properly done it reduces coupling and makes it easier for >1 person to work on the code.

One example -- our 2013 robot had a tilting Frisbee intake that was fully automatic. Its control system was a tilt motor combined with one of the AB object detectors to sense the Frisbee, an encoder to sense the tilt angle of the platform, and two limit switches to detect the limits of travel on the platform.

https://github.com/stevep001/RoboEag...sorCommand.cpp

https://github.com/stevep001/RoboEag...nSubsystem.cpp

https://github.com/stevep001/RoboEag...PanCommand.cpp

A couple things to note.

1. Note the state machine implemented inside the command.

2. I've suspected that the state machine could be refactored into a set of commands, but haven't tried it.

3. We always group sensors into their own subsystem.

4. The Mode (the current activity/goal) is stored in the subsystem, not the command. We never store persistent state in a command, even if it executes perpetually.

5. The supervisor command is set as the default command on the subsystem, and is never interrupted. Other commands (e.g., the deploy example) inject changes in desired state into the subsystem, and the supervisor command reacts accordingly.
__________________
2016-17 events: 10000 Lakes Regional, Northern Lights Regional, FTC Burnsville Qualifying Tournament

2011 - present · FRC 3081 Kennedy RoboEagles mentor
2013 - present · event volunteer at 10000 Lakes Regional, Northern Lights Regional, North Star Regional, Lake Superior Regional, Minnesota State Tournament, PNW District 4 Glacier Peak, MN FTC, CMP
http://twitter.com/MrRoboSteve · www.linkedin.com/in/speterson
 


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:01.

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