|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
Re: Specificity in Command Classes
I agree. Just put the degree you want to turn in the constructor of your Turn command.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|