Team-4536 / Command-Based-2015

0 stars 0 forks source link

DriveTrain subsystem default command #8

Closed stepansubbotin closed 9 years ago

stepansubbotin commented 9 years ago

The DriveTrain could have a default command in the initDefaultCommand() method.

AnonymousAnion commented 9 years ago

I have added the following lines inside of the initDefaultCommand() method:

leftTalon.set(0.0); rightTalon.set(0.0);

This should set their initial states as not moving.

stepansubbotin commented 9 years ago

It should be something like setDefaultCommand(new Drive())

stepansubbotin commented 9 years ago

Is it possible that the code you have in the setDefaultCommand is what's messing up the driving? It doesn't really make any sense. "leftTalon.set(0.0); rightTalon.set(0.0);"

inkling16 commented 9 years ago

Are you looking at recent code Stepan? I don't see those lines anywhere.

stepansubbotin commented 9 years ago

I was looking at the AccelLimit branch. I thought you guys were testing the drive code from there.

AnonymousAnion commented 9 years ago

I wasn't understanding what you guys meant at first. I have made the appropriate changes and it works and all is well with the universe. Here is the new code:

public void initDefaultCommand() {
    // Set the default command for a subsystem here.
    //setDefaultCommand(new MySpecialCommand())
    setDefaultCommand(new Drive());
}

image