View Single Post
  #11   Spotlight this post!  
Unread 27-02-2014, 09:10
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,725
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Impressions: Command Based Robot

Quote:
Originally Posted by DjScribbles View Post
• For us, in order to spin the shooter wheels and fire, you need them both to be different subsystems (without cheating in your commands, or making a goofy "KeepSpinningAndShoot" command), even though they are functionally tightly coupled; because a command that requires a subsystem will interupt the current command that is executing on that subsystem when it runs.
Another way around this is to not have the shoot command actually require the shooter. As long as you know the command is going to finish, which with actuators is pretty simple, you shouldn't run into any issues. This allows you to keep the wheel and trigger in the same subsystem, but run them with two different commands.

Quote:
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.
We also did this for our robot last year. It works well, but we decided we'd try it a different way this year. We're actually cancelling out the default command and running new commands on the subsystems when something different needs done. So back to my arm example, the default command is DeployArm(Arm.RETRACT, 0) which retracts the arm and runs the roller at 0%. We set up two buttons PickUp and Pass that run DeployArm(Arm.DEPLOY, RobotMap.pickupPower) and DeployArm(Arm.RETRACT, RobotMap.passPower) respectively whileHeld().