mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Added new encoders, updated docs, safety's
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package swervelib.parser.json;
|
||||
|
||||
import com.revrobotics.SparkMaxRelativeEncoder.Type;
|
||||
import edu.wpi.first.wpilibj.DriverStation;
|
||||
import edu.wpi.first.wpilibj.I2C;
|
||||
import edu.wpi.first.wpilibj.SPI;
|
||||
import edu.wpi.first.wpilibj.SerialPort.Port;
|
||||
import swervelib.encoders.AnalogAbsoluteEncoderSwerve;
|
||||
import swervelib.encoders.CANCoderSwerve;
|
||||
import swervelib.encoders.CanAndCoderSwerve;
|
||||
import swervelib.encoders.PWMDutyCycleEncoderSwerve;
|
||||
import swervelib.encoders.SparkMaxEncoderSwerve;
|
||||
import swervelib.encoders.SwerveAbsoluteEncoder;
|
||||
import swervelib.imu.ADIS16448Swerve;
|
||||
@@ -59,9 +63,14 @@ public class DeviceJson
|
||||
return new SparkMaxEncoderSwerve(motor, 360);
|
||||
case "canandcoder_can":
|
||||
return new CanAndCoderSwerve(id);
|
||||
case "ma3":
|
||||
case "ctre_mag":
|
||||
case "rev_hex":
|
||||
case "am_mag":
|
||||
case "dutycycle":
|
||||
return new PWMDutyCycleEncoderSwerve(id);
|
||||
case "thrifty":
|
||||
case "throughbore":
|
||||
case "dutycycle":
|
||||
case "analog":
|
||||
return new AnalogAbsoluteEncoderSwerve(id);
|
||||
case "cancoder":
|
||||
@@ -88,6 +97,15 @@ public class DeviceJson
|
||||
return new ADXRS450Swerve();
|
||||
case "analog":
|
||||
return new AnalogGyroSwerve(id);
|
||||
case "navx_spi":
|
||||
return new NavXSwerve(SPI.Port.kMXP);
|
||||
case "navx_i2c":
|
||||
DriverStation.reportWarning(
|
||||
"WARNING: There exists an I2C lockup issue on the roboRIO that could occur, more information here: " +
|
||||
"\nhttps://docs.wpilib.org/en/stable/docs/yearly-overview/known-issues" +
|
||||
".html#onboard-i2c-causing-system-lockups",
|
||||
false);
|
||||
return new NavXSwerve(I2C.Port.kMXP);
|
||||
case "navx_onborard":
|
||||
return new NavXSwerve(Port.kOnboard);
|
||||
case "navx_usb":
|
||||
|
||||
Reference in New Issue
Block a user