Added support for Falcons, and the ability to disable the CANCoders

This commit is contained in:
thenetworkgrinch
2023-02-16 21:21:26 -06:00
parent e8f6ca3659
commit c747645bcc
118 changed files with 2706 additions and 370 deletions

View File

@@ -44,6 +44,7 @@ public class DeviceJson
{
switch (type)
{
case "none":
case "integrated":
case "attached":
return null;
@@ -113,9 +114,12 @@ public class DeviceJson
*/
public SwerveAbsoluteEncoder createIntegratedEncoder(SwerveMotor motor)
{
if (type.equals("sparkmax"))
switch (type)
{
return new SparkMaxEncoderSwerve(motor);
case "sparkmax":
return new SparkMaxEncoderSwerve(motor);
case "none":
return null;
}
throw new RuntimeException("Could not create absolute encoder from data port of " + type + " id " + id);
}