frc538 / 2020-infinite-recharge

Robot code for FRC Team 538.
0 stars 0 forks source link

Add wheel-zeroing to prevent "the J" #55

Open drewwhis opened 4 years ago

drewwhis commented 4 years ago

There are two possible ways to handle this.

I think we can just call DriveSubsystem.drive(0,0,0) in the initialize method of any drive commands. This should zero the wheels before running the command (but not while the command runs).

If that doesn't do the trick, we can add a method onto the drive subsystem class to zero the wheels that we can call in the initialize method.

drewwhis commented 4 years ago

If the set drive to 0,0,0 doesn't work, we just need a public method on the DriveSubsystem class (zeroWheels(), for example), that will give all four modules the same state (speedMs = 0 and angle = new Rotation2d(0), most likely).

drewwhis commented 4 years ago

If 0,0,0 doesn't work like planned, adding this to DriveSubsystem could.


public void zeroModules() {
  SwerveModuleState zero = new SwerveModuleState(0, new Rotation2d(0));
  frontLeft.setState(zero);
  frontRight.setState(zero);
  rearLeft.setState(zero);
  rearRight.setState(zero);
}
drewwhis commented 4 years ago

oof, looks like we have to tackle #69