Go to Post Come on how can you not be excited about IRI! - richardp [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
  #16   Spotlight this post!  
Unread 27-01-2015, 10:04
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Command Based Programming (Threads?)


Thanks for the response. I hope you don't mind some follow-up questions:

Quote:
Originally Posted by notmattlythgoe View Post
I would suggest using a WaitCommand in a CommandGroup. Below is an example that will fire, then wait 1 second before firing again and then finishing the CommandGroup.

Code:
public FiringCommandGroup extends CommandGroup {

     public FiringCommandGroup() {
          addSequential(new FireCommand());
          addSeqiential(new waitCommand(1));
          addSequential(new FireCommand());
     }
}
What does the waitCommand() do, "under the hood". i.e., how is it implemented?

Quote:
Another way to do it would be to check the time passed in the execute method of a command to see if the period of time you want to wait has passed.
Is there a "recommended" or "best practice" way to implement that approach?


Reply With Quote
  #17   Spotlight this post!  
Unread 27-01-2015, 10:09
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is online now
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,722
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: Command Based Programming (Threads?)

Quote:
Originally Posted by Ether View Post

Thanks for the response. I hope you don't mind some follow-up questions:



What does the waitCommand() do, "under the hood". i.e., how is it implemented?



Is there a "recommended" or "best practice" way to implement that approach?


I haven't looked at the wait command under the hood, but this is how I believe it works. I can look under the hood tonight at the source code and see if I'm correct.

Code:
public class WaitCommand extends Command {

     private double waitTime;

     public WaitCommand(double waitTime) {
          this.waitTime = waitTime;
     }

     public boolean isFinished() {
          return timeSinceInitialized >= waitTme;
     }
}

As to the second question. Something like this would work for a single command doing multiple things based on time.

Code:
public void execute() {
     if (timeSinceInitialized() < sometime) {
          do something;
     } else if(timeSinceInitialized() < some bigger time) {
          do something 2;
     } else {
          do something 3;
     }
}

Last edited by notmattlythgoe : 27-01-2015 at 10:20.
Reply With Quote
  #18   Spotlight this post!  
Unread 27-01-2015, 13:04
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Command Based Programming (Threads?)

Quote:
Originally Posted by notmattlythgoe View Post
I haven't looked at the wait command under the hood, but this is how I believe it works. I can look under the hood tonight at the source code and see if I'm correct.

Code:
public class WaitCommand extends Command {

     private double waitTime;

     public WaitCommand(double waitTime) {
          this.waitTime = waitTime;
     }

     public boolean isFinished() {
          return timeSinceInitialized >= waitTme;
     }
}
I don't read much Java code. Is this the correct interpretation of what that code is supposed to do?
- the first time it is executed it notes the system time so that it can compute the value of "timeSinceInitialized" each time it is executed.

- it gets executed every 20ms as long as it returns "isFinished()" as false

- it returns "isFinished()" as false as long as "timeSinceInitialized" is less than the desired "waitTime" that was passed as a parameter

- as long as it is returning "isFinished()" as false, any commands that are waiting for it to finish will not execute.

- when "timeSinceInitialized" is greater than or equal to the desired "waitTime", it returns "isFinished()" as true, which results in it being removed from the list of commands to be executed every 20ms. Any commands that were waiting for it to finish will now execute.

Reply With Quote
  #19   Spotlight this post!  
Unread 27-01-2015, 13:13
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is online now
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,722
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: Command Based Programming (Threads?)

Quote:
Originally Posted by Ether View Post
I don't read much Java code. Is this the correct interpretation of what that code is supposed to do?
- the first time it is executed it notes the system time so that it can compute the value of "timeSinceInitialized" each time it is executed.

- it gets executed every 20ms as long as it returns "isFinished()" as false

- it returns "isFinished()" as false as long as "timeSinceInitialized" is less than the desired "waitTime" that was passed as a parameter

- as long as it is returning "isFinished()" as false, any commands that are waiting for it to finish will not execute.

- when "timeSinceInitialized" is greater than or equal to the desired "waitTime", it returns "isFinished()" as true, which results in it being removed from the list of commands to be executed every 20ms. Any commands that were waiting for it to finish will now execute.

Yes, that would be the correct process from my interpretation.
Reply With Quote
  #20   Spotlight this post!  
Unread 27-01-2015, 13:19
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Command Based Programming (Threads?)

Quote:
Originally Posted by notmattlythgoe View Post
As to the second question. Something like this would work for a single command doing multiple things based on time.

Code:
public void execute() {
     if (timeSinceInitialized() < sometime) {
          do something;
     } else if(timeSinceInitialized() < some bigger time) {
          do something 2;
     } else {
          do something 3;
     }
}
Again, is this the correct interpretation of the above code?
- "something" will be executed every 20ms as long as "timeSinceInitialized()" is less than "sometime"

- "something 2" will be executed every 20ms as long as "timeSinceInitialized()" is greater than or equal to "sometime" and less than "sometime bigger time"

- "something 3" will be executed every 20ms as long as "timeSinceInitialized()" is greater than or equal to "some bigger time"
Reply With Quote
  #21   Spotlight this post!  
Unread 27-01-2015, 13:22
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is online now
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,722
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: Command Based Programming (Threads?)

Quote:
Originally Posted by Ether View Post
Again, is this the correct interpretation of the above code?
- "something" will be executed every 20ms as long as "timeSinceInitialized()" is less than "sometime"

- "something 2" will be executed every 20ms as long as "timeSinceInitialized()" is greater than or equal to "sometime" and less than "sometime bigger time"

- "something 3" will be executed every 20ms as long as "timeSinceInitialized()" is greater than or equal to "some bigger time"
Perfect.
Reply With Quote
  #22   Spotlight this post!  
Unread 27-01-2015, 13:44
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Command Based Programming (Threads?)


So this codeA:
Code:
public FiringCommandGroup extends CommandGroup {

     public FiringCommandGroup() {
          addSequential(new FireCommand1());
          addSeqiential(new waitCommand(1));
          addSequential(new FireCommand2());
     }
}
...is quite different than this codeB:
Code:
public void execute() {
     if (timeSinceInitialized() < sometime) {
          do something;
     } else if(timeSinceInitialized() < some bigger time) {
          do nothing;
     } else {
          do something2;
     }
}
...because codeA executes FireCommand1() once, then waits, then executes FireCommand2() once, and exits.

whereas codeB executes "something" repeatedly, then waits, then executes "something2" repeatedly.

Yes?


Reply With Quote
  #23   Spotlight this post!  
Unread 27-01-2015, 13:47
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is online now
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,722
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: Command Based Programming (Threads?)

Quote:
Originally Posted by Ether View Post

So this codeA:
Code:
public FiringCommandGroup extends CommandGroup {

     public FiringCommandGroup() {
          addSequential(new FireCommand1());
          addSeqiential(new waitCommand(1));
          addSequential(new FireCommand2());
     }
}
...is quite different than this codeB:
Code:
public void execute() {
     if (timeSinceInitialized() < sometime) {
          do something;
     } else if(timeSinceInitialized() < some bigger time) {
          do nothing;
     } else {
          do something2;
     }
}
...because codeA executes FireCommand1() once, then waits, then executes FireCommand2() once, and exits.

whereas codeB executes "something" repeatedly, then waits, then executes "something2" repeatedly.

Yes?


Correct. I can write up something that would be similar to code A in the second style if you'd like.
Reply With Quote
  #24   Spotlight this post!  
Unread 27-01-2015, 14:18
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Command Based Programming (Threads?)

Quote:
Originally Posted by notmattlythgoe View Post
Correct. I can write up something that would be similar to code A in the second style if you'd like.
Yes, thank you, that is what I was asking originally.


Reply With Quote
  #25   Spotlight this post!  
Unread 27-01-2015, 14:52
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is online now
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,722
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: Command Based Programming (Threads?)

Quote:
Originally Posted by Ether View Post
Yes, thank you, that is what I was asking originally.


Apologies, here you go.

Code:
public class ShootCommand extends Command {

	public void initialize() {
		logic for fire1;
	}

	public void execute() {
		
	}
	
	public boolean isFinished() {
		return timeSinceInitialized() > 1;
	}
	
	public void end() {
		logic for fire 2;
	}
}
1. Run fire1 logic when command starts.
2. Do nothing for 1 second.
3. After 1 second return true in isFinished().
4. When isFinished() returns true the end() method is called.
5. Run logic for fire2 in end.

Keep in mind, the logic for both fire1 and fire2 will need to execute quickly. Meaning no Timer.delays or long running loops.

Last edited by notmattlythgoe : 27-01-2015 at 15:19.
Reply With Quote
  #26   Spotlight this post!  
Unread 27-01-2015, 17:49
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Command Based Programming (Threads?)

Quote:
Originally Posted by notmattlythgoe View Post
Code:
public class ShootCommand extends Command {

	public void initialize() {
		logic for fire1;
	}

	public void execute() {
		
	}
	
	public boolean isFinished() {
		return timeSinceInitialized() > 1;
	}
	
	public void end() {
		logic for fire 2;
	}
}
1. Run fire1 logic when command starts.
2. Do nothing for 1 second.
3. After 1 second return true in isFinished().
4. When isFinished() returns true the end() method is called.
5. Run logic for fire2 in end.
OK thanks that's pretty clear. Is there any performance difference between the approach shown above and the code in post#15? Which approach do you prefer, and why (or does it depend on context)?


Reply With Quote
  #27   Spotlight this post!  
Unread 27-01-2015, 20:49
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 543
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Command Based Programming (Threads?)

Quote:
Originally Posted by Ether View Post
OK thanks that's pretty clear. Is there any performance difference between the approach shown above and the code in post#15? Which approach do you prefer, and why (or does it depend on context)?


Performance-wise the latter would be better, since the post in number #15 has three elements in the list whereas the post that you quoted only as one element in the list. Every 20ms, every element in the list is enumerated upon and conditions for execution are checked. This performance boost is negligible unless command groups are in excess of hundreds of commands, which is extremely uncommon (the best I got was 75, though I re-made the entire command based framework from scratch so some of the commands were syntaxical (wait, if, else, etc.))

However, the former approach (#15) is the preferred option for modularity sake. Integrating the wait with both executions turn the command, not into a modular command, but rather a defined sequence. If the sequence is regular (e.g. load hopper, wait, shoot) than it would be preferential to use a CommandGroup, for readability sake. If the sequence is irregular (e.g. turn 15 degrees, wait, shoot at low velocity) than the command will only be used once and more commands of similar conditions (e.g. turn 30 degrees, wait, shoot at high velocity) would have to be developed. In this case, it would be easier to make a turn command, a wait command, and a shoot command and plug them in in a similar fashion to post #15.

Last edited by Arhowk : 27-01-2015 at 20:52.
Reply With Quote
  #28   Spotlight this post!  
Unread 28-01-2015, 06:51
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is online now
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,722
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: Command Based Programming (Threads?)

Quote:
Originally Posted by Ether View Post
OK thanks that's pretty clear. Is there any performance difference between the approach shown above and the code in post#15? Which approach do you prefer, and why (or does it depend on context)?


Honestly, the performance differences would between the two would be so minuscule they probably aren't measurable.

My team and I prefer the method I provided in post #15. It's easier to read, easier to modify, and more modular. Here is an example from our competition code from last season. Notice how easy it is to read exactly what the ShootSeries command does.

Code:
public class ShootSeries extends CommandGroup {
    
    public ShootSeries() {
        addParallel(new PickUpDeploy(PickUp.DEPLOY, 0, PickUp.CLOSE));
        addSequential(new WaitCommand(0.25));
        addSequential(new SetShooterPosition(Shooter.FIRE));
        addSequential(new WaitCommand(0.2));
        addSequential(new SetShooterPosition(Shooter.PRIME));
        addSequential(new WaitCommand(0.1));
        addParallel(new ResetArmCommand());    
    }
}
Code:
public class PickUpDeploy extends CommandBase {
    
    private boolean deploy;
    private double rollerSpeed;
    private boolean openWings;
    
    public PickUpDeploy(boolean deploy, double rollerSpeed) {
        this(deploy, rollerSpeed, PickUp.CLOSE);
    }
    
    public PickUpDeploy(boolean deploy, double rollerSpeed, boolean openWings) {
        requires(pickUp);
        this.deploy = deploy;
        this.rollerSpeed = rollerSpeed;
        this.openWings = openWings;
    }

    protected void initialize() {
        pickUp.deployArm(deploy);
        pickUp.deployCatch(openWings);
    }

    protected void execute() {
         if(oi.isRollerOn()){
            pickUp.setRollerSpeed(rollerSpeed);
        }else{
            pickUp.setRollerSpeed(0);
        }
    }

    protected boolean isFinished() {
        return false;
    }

    protected void end() { }

    protected void interrupted() { }
}
Code:
public class SetShooterPosition extends CommandBase {
    
    public boolean shooterPosition;
    
    public SetShooterPosition(boolean shooterPosition) {
        requires(shooter);
        this.shooterPosition = shooterPosition;
    }

    protected void initialize() { }
    
    protected void execute() {
        shooter.primeShooter(shooterPosition);
    }

    protected boolean isFinished() {
        return true;
    }

    protected void end() { }

    protected void interrupted() { }
}
Code:
public class ResetArmCommand extends CommandBase {
    
    public ResetArmCommand() {
        requires(pickUp);
    }
    
    protected void initialize() { }

    protected void execute() { }

    protected boolean isFinished() {
        return true;
    }

    protected void end() { }

    protected void interrupted() { }
}
Code:
public class PickUp extends Subsystem {
    
    public static final boolean DEPLOY = true;
    public static final boolean RETRACT = false;
    public static final boolean OPEN = true;
    public static final boolean CLOSE = false;
    
    private Solenoid pickUpSolenoid1 = new Solenoid(PropertyReader.getProperty("PICKUP_SOLENOID_MODULE", 2), PropertyReader.getProperty("PICKUP_SOLENOID_CHANNEL_A", RobotMap.pickUpSolenoid1));
    private Solenoid pickUpSolenoid2 = new Solenoid(PropertyReader.getProperty("PICKUP_SOLENOID_MODULE", 2), PropertyReader.getProperty("PICKUP_SOLENOID_CHANNEL_B", RobotMap.pickUpSolenoid2));
    
    private Solenoid wingSolenoid = new Solenoid(PropertyReader.getProperty("WING_SOLENOID_MODULE", 2), PropertyReader.getProperty("WING_SOLENOID_CHANNEL", RobotMap.wingSolenoidChannel));
    
    private SpeedController upperPickUp = new Talon(PropertyReader.getProperty("PICKUP_TALON_CHANNEL", RobotMap.upperPickUpRoller));
    
    private double powerLevel;
    
    private RollingAverager pickUpAverager = new RollingAverager(10, 0);
    
    public void initDefaultCommand() {
        setDefaultCommand(new PickUpDeploy(RETRACT, 0, CLOSE));
    }
    
    public void setRollerSpeed(double power) {
        powerLevel = power;
        pickUpAverager.addValue(powerLevel);
        upperPickUp.set(pickUpAverager.getAverage());
    }
    
    public void deployArm(boolean deploy) {
       pickUpSolenoid1.set(!deploy);
       pickUpSolenoid2.set(deploy);
    }
    public void deployCatch(boolean deploy) {
        wingSolenoid.set(deploy);
    }
}
Code:
public class Shooter extends Subsystem {
    public String currentHot;
    
    public Solenoid blockerPole1 = new Solenoid(PropertyReader.getProperty("BLOCKER_SOLENOID_MODULE", 1), PropertyReader.getProperty("BLOCKER_POLE_CHANNEL_A", RobotMap.blockerPolePort1));
    public Solenoid blockerPole2 = new Solenoid(PropertyReader.getProperty("BLOCKER_SOLENOID_MODULE", 1), PropertyReader.getProperty("BLOCKER_POLE_CHANNEL_B", RobotMap.blockerPolePort2));
    
    public static final boolean FIRE = true;
    public static final boolean PRIME = false;
    
    private Solenoid shooterSolenoid1 = new Solenoid(PropertyReader.getProperty("SHOOTER_SOLENOID_MODULE", 1), PropertyReader.getProperty("SHOOTER_SOLENOID_CHANNEL_A", RobotMap.shooterSolenoid1Port));
    private Solenoid shooterSolenoid2 = new Solenoid(PropertyReader.getProperty("SHOOTER_SOLENOID_MODULE", 1), PropertyReader.getProperty("SHOOTER_SOLENOID_CHANNEL_B", RobotMap.shooterSolenoid2Port));

    public void initDefaultCommand() {
        setDefaultCommand(new SetShooterPosition(Shooter.PRIME));
    }
    
    public void primeShooter(boolean prime) {
        //System.out.println("IN PRIME SHOOTER " + prime);
        shooterSolenoid1.set(prime);
        shooterSolenoid2.set(prime);
    }
}
If interested, here is the entirety of our code from last season, with some offseason additions.

Also, here is our code from this season so far.

Last edited by notmattlythgoe : 28-01-2015 at 07:08.
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 12:55.

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