Improved Swerve Builder
This commit is contained in:
parent
5270012b74
commit
9b7572f22e
|
|
@ -7,6 +7,7 @@ import edu.wpi.first.math.geometry.Translation2d;
|
||||||
public class SwerveBuilder {
|
public class SwerveBuilder {
|
||||||
|
|
||||||
ArrayList<SwerveModule> modules = new ArrayList<SwerveModule>();
|
ArrayList<SwerveModule> modules = new ArrayList<SwerveModule>();
|
||||||
|
String canBusName = "";
|
||||||
|
|
||||||
private int pigeonId;
|
private int pigeonId;
|
||||||
|
|
||||||
|
|
@ -19,6 +20,11 @@ public class SwerveBuilder {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SwerveBuilder withCanbusName(String canBusname){
|
||||||
|
this.canBusName = canBusname;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public SwerveBuilder withSwerveModule(SwerveModule module){
|
public SwerveBuilder withSwerveModule(SwerveModule module){
|
||||||
this.modules.add(module);
|
this.modules.add(module);
|
||||||
return this;
|
return this;
|
||||||
|
|
@ -40,7 +46,6 @@ public class SwerveBuilder {
|
||||||
private double steerKD;
|
private double steerKD;
|
||||||
private int steerEncoderId;
|
private int steerEncoderId;
|
||||||
private double steerOffset;
|
private double steerOffset;
|
||||||
private String canBusName;
|
|
||||||
private Translation2d moduleLocation;
|
private Translation2d moduleLocation;
|
||||||
private double gearRatio;
|
private double gearRatio;
|
||||||
private double wheelDiameterInMeters;
|
private double wheelDiameterInMeters;
|
||||||
|
|
@ -94,11 +99,6 @@ public class SwerveBuilder {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SwerveModuleBuilder withCanBusName(String canBusName){
|
|
||||||
this.canBusName = canBusName;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SwerveModuleBuilder withModuleLocation(Translation2d moduleLocation){
|
public SwerveModuleBuilder withModuleLocation(Translation2d moduleLocation){
|
||||||
this.moduleLocation = moduleLocation;
|
this.moduleLocation = moduleLocation;
|
||||||
return this;
|
return this;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue