Go to Post How are you supposed to conceptualize without a complete grasp of what your trying to do? - Aren_Hill [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 27-01-2012, 18:13
Nekel_Seyew's Avatar
Nekel_Seyew Nekel_Seyew is offline
Registered User
FRC #2374 (Crusaderbots)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Portland
Posts: 2
Nekel_Seyew is an unknown quantity at this point
Specificity in Command Classes

Hello,

A big problem I'm having with the command based robot structure is the exact use of extending the command class. If I want to say "turn turret right", I'd have to use a TurnTurretRight class which extends the command class. But what if I just want to turn the turret a little bit, say pi/6 radians. How can I specify that in my command class, and allow for other variable lengths, or must I make a different class for each amount I wish to turn my turret?

Any and all opinions on this would be helpful!

-Nekel_Seyew
  #2   Spotlight this post!  
Unread 27-01-2012, 18:28
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 990
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Specificity in Command Classes

You should be able to make a TurnTurret command that takes a parameter of how much to rotate the turret. Then to turn the turret right, you pass positive values and to turn it left pass negative values or visa-versa.
  #3   Spotlight this post!  
Unread 27-01-2012, 20:13
Sunstroke Sunstroke is offline
Programmer
AKA: Joe Grinstead
FRC #3504 (Girls of Steel)
Team Role: Mentor
 
Join Date: Apr 2009
Rookie Year: 2009
Location: New England
Posts: 49
Sunstroke is an unknown quantity at this point
Re: Specificity in Command Classes

Quote:
Originally Posted by RufflesRidge View Post
You should be able to make a TurnTurret command that takes a parameter of how much to rotate the turret. Then to turn the turret right, you pass positive values and to turn it left pass negative values or visa-versa.
I agree. Just put the degree you want to turn in the constructor of your Turn command.
Closed Thread


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 18:50.

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