mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Updated to 2024
This commit is contained in:
@@ -81,4 +81,15 @@ public class SwerveDriveConfiguration
|
||||
}
|
||||
return modArr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assume the first module is the furthest. Usually front-left.
|
||||
*
|
||||
* @return Drive base radius from center of robot to the farthest wheel in meters.
|
||||
*/
|
||||
public double getDriveBaseRadiusMeters()
|
||||
{
|
||||
Translation2d furthestModule = moduleLocationsMeters[0];
|
||||
return Math.abs(Math.sqrt(Math.pow(furthestModule.getX(), 2) + Math.pow(furthestModule.getY(), 2)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package swervelib.parser.json;
|
||||
|
||||
import com.revrobotics.SparkMaxRelativeEncoder.Type;
|
||||
import com.revrobotics.SparkRelativeEncoder.Type;
|
||||
import edu.wpi.first.wpilibj.DriverStation;
|
||||
import edu.wpi.first.wpilibj.I2C;
|
||||
import edu.wpi.first.wpilibj.SPI;
|
||||
@@ -20,6 +20,7 @@ import swervelib.imu.NavXSwerve;
|
||||
import swervelib.imu.Pigeon2Swerve;
|
||||
import swervelib.imu.PigeonSwerve;
|
||||
import swervelib.imu.SwerveIMU;
|
||||
import swervelib.motors.SparkFlexSwerve;
|
||||
import swervelib.motors.SparkMaxBrushedMotorSwerve;
|
||||
import swervelib.motors.SparkMaxSwerve;
|
||||
import swervelib.motors.SwerveMotor;
|
||||
@@ -175,6 +176,8 @@ public class DeviceJson
|
||||
case "neo":
|
||||
case "sparkmax":
|
||||
return new SparkMaxSwerve(id, isDriveMotor);
|
||||
case "sparkflex":
|
||||
return new SparkFlexSwerve(id, isDriveMotor);
|
||||
case "falcon":
|
||||
case "talonfx":
|
||||
return new TalonFXSwerve(id, canbus != null ? canbus : "", isDriveMotor);
|
||||
|
||||
Reference in New Issue
Block a user