mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Added more
This commit is contained in:
@@ -22,15 +22,17 @@ public class NavXSwerve extends SwerveIMU
|
||||
|
||||
/**
|
||||
* Constructor for the NavX swerve.
|
||||
*
|
||||
* @param port Serial Port to connect to.
|
||||
*/
|
||||
public NavXSwerve()
|
||||
public NavXSwerve(SerialPort.Port port)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Communicate w/navX-MXP via the MXP SPI Bus. */
|
||||
/* Alternatively: I2C.Port.kMXP, SerialPort.Port.kMXP or SerialPort.Port.kUSB */
|
||||
/* See http://navx-mxp.kauailabs.com/guidance/selecting-an-interface/ for details. */
|
||||
gyro = new AHRS(SerialPort.Port.kMXP);
|
||||
gyro = new AHRS(port);
|
||||
SmartDashboard.putData(gyro);
|
||||
} catch (RuntimeException ex)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package swervelib.parser.json;
|
||||
|
||||
import edu.wpi.first.wpilibj.SerialPort.Port;
|
||||
import swervelib.encoders.AnalogAbsoluteEncoderSwerve;
|
||||
import swervelib.encoders.CANCoderSwerve;
|
||||
import swervelib.encoders.SparkMaxEncoderSwerve;
|
||||
@@ -78,8 +79,13 @@ public class DeviceJson
|
||||
return new ADXRS450Swerve();
|
||||
case "analog":
|
||||
return new AnalogGyroSwerve(id);
|
||||
case "navx_onborard":
|
||||
return new NavXSwerve(Port.kOnboard);
|
||||
case "navx_usb":
|
||||
return new NavXSwerve(Port.kUSB);
|
||||
case "navx_mxp":
|
||||
case "navx":
|
||||
return new NavXSwerve();
|
||||
return new NavXSwerve(Port.kMXP);
|
||||
case "pigeon":
|
||||
return new PigeonSwerve(id);
|
||||
case "pigeon2":
|
||||
|
||||
Reference in New Issue
Block a user