View Single Post
  #4   Spotlight this post!  
Unread 01-28-2016, 11:34 PM
mmaunu's Avatar
mmaunu mmaunu is offline
Registered User
FRC #2485 (W.A.R. Lords)
Team Role: Mentor
 
Join Date: Mar 2013
Rookie Year: 2010
Location: San Diego, CA
Posts: 86
mmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the rough
Re: Updating Joysticks in a Command

Quote:
Originally Posted by Snapperbot View Post
Here's the GitHub page.
The code I'm talking about would be in these classes:
  • Robot
  • OI
  • subsystems/Shooter
  • commands/ShooterArcade
  • commands/ShooterIdle.
Here's a part of the ShooterArcade class:
Code:
public class ShooterArcade extends Command {
	OI oi;
	Shooter shooter;
    public ShooterArcade() {
    	requires(Robot.shooter);
    	shooter = Robot.shooter;
    	oi = Robot.oi;
    }

    // Called just before this Command runs the first time
    protected void initialize() {
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
    	double shooterSpeed = oi.getShooterThrottle();
    	
    	shooter.shooterArcade(shooterSpeed);
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return true;
    }
If you need more info feel free to ask.
Our team doesn't use the Command-based template, but I'm guessing that having isFinished() always return true immediately is a problem. I think that you are starting and stopping the command over and over. Try changing isFinished() to return false and see if that helps.

Here is a good thread to read for a bit more:
http://www.chiefdelphi.com/forums/sh...d.php?t=125671
__________________
2014 Las Vegas (Winners with 987, 2478; Excellence in Engineering)
2014 San Diego (Finalists with 987, 3250; Quality Award)
2013 Inland Empire (Winners with 1538, 968; Excellence in Engineering Award)
2013 San Diego (Finalists with 2984, 4322; Creativity Award)
2012 Las Vegas (Finalists with 2034, 3187; Quality Award)
Reply With Quote