Go to Post Making a part look pretty even after it is functionaly done can be a very good thing, espically when the part gets cut from the bot and you get to keep it as a trophey. Take pride in your work. - Andy A. [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 27-01-2012, 03:42
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: A good time based way to program

Look at the updated documentation for 2012 WPILib. I think the command based robot is exactly what you are looking for.
Reply With Quote
  #2   Spotlight this post!  
Unread 27-01-2012, 13:25
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: A good time based way to program

Quote:
Originally Posted by Tom Bottiglieri View Post
Look at the updated documentation for 2012 WPILib. I think the command based robot is exactly what you are looking for.
I agree, and you can specify timeouts for commands. Look at the WPILib Cookbook and find the section on using timeouts. The stuff you're looking for is built in. It will only do the delay for a single command and everything else will keep running.

You might also check out the videos at http://youtube.com/user/bradamiller. It explains how to write the GearsBot sample program step by step.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #3   Spotlight this post!  
Unread 27-01-2012, 17:54
neal's Avatar
neal neal is offline
Neal
FRC #1777 (Viking Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: United States
Posts: 56
neal is an unknown quantity at this point
Re: A good time based way to program

Thanks all for your suggestions. I'm trying to just stick with SimpleRobot for this year since I don't think we have enough time now to write it for CommandBased one, and to test, troubleshoot it.

Brad, does timeouts also work with SimpleRobot, I checked the cookbook and it only shows examples for the command-based bot.
Reply With Quote
  #4   Spotlight this post!  
Unread 28-01-2012, 03:44
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: A good time based way to program

Quote:
Originally Posted by neal View Post
Thanks all for your suggestions. I'm trying to just stick with SimpleRobot for this year since I don't think we have enough time now to write it for CommandBased one, and to test, troubleshoot it.

Brad, does timeouts also work with SimpleRobot, I checked the cookbook and it only shows examples for the command-based bot.
Unfortunately it doesn't. You're correct that if you do a Timer.delay() it will stop the thread, and the rest of the program. If you want overlapped stuff happening then, as you suggested, you can use timers. Then you'll need a loop that checks if the time is up on the drive system while continuing to service the other subsystems. For trying to do a lot of overlapping operations I'd prefer to use the IterativeRobot base class. Then the looping is built in.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #5   Spotlight this post!  
Unread 28-01-2012, 19:10
neal's Avatar
neal neal is offline
Neal
FRC #1777 (Viking Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: United States
Posts: 56
neal is an unknown quantity at this point
Re: A good time based way to program

Thanks!

We'll probably just use Command Based Robot. Just started writing it again and looking through the cookbook and GearsBot.
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 11:21.

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