Class SwerveDriveSubsystem
java.lang.Object
org.wpilib.command2.SubsystemBase
xbot.common.command.BaseSubsystem
xbot.common.command.BaseSetpointSubsystem<Double,Double>
xbot.common.command.BaseSimpleSetpointSubsystem
xbot.common.subsystems.drive.swerve.SwerveDriveSubsystem
- All Implemented Interfaces:
org.wpilib.command2.Subsystem, org.wpilib.telemetry.TelemetryLoggable, SupportsSetpointLock, TunablePrefixProvider
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class BaseSetpointSubsystem
atGoal, lastTargetValueUsedforAtGoalFields inherited from class BaseSubsystem
aKitLog -
Constructor Summary
ConstructorsConstructorDescriptionSwerveDriveSubsystem(SwerveInstance swerveInstance, XCANMotorController.XCANMotorControllerFactory mcFactory, TunableFactory tunableFactory, XSwerveDriveElectricalContract electricalContract) -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets current velocity in meters per secondbooleangetLabel()doubleGets target velocity in inches per secondbooleanvoidperiodic()This method is called on eachCommandSchedulerloop.voidvoidvoidsetNoviceMode(boolean enabled) voidvoidsetTargetValue(Double value) Sets target velocity in inches per secondMethods inherited from class BaseSimpleSetpointSubsystem
areTwoTargetsEquivalentMethods inherited from class BaseSetpointSubsystem
areTwoDoublesEquivalent, areTwoDoublesEquivalent, createSetTargetCommand, createSetTargetCommand, getSetpointLock, isMaintainerAtGoal, setMaintainerIsAtGoalMethods inherited from class org.wpilib.command2.SubsystemBase
getName, getTelemetryType, logTo, setNameMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wpilib.command2.Subsystem
defer, getCurrentCommand, getDefaultCommand, idle, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Constructor Details
-
SwerveDriveSubsystem
@Inject public SwerveDriveSubsystem(SwerveInstance swerveInstance, XCANMotorController.XCANMotorControllerFactory mcFactory, TunableFactory tunableFactory, XSwerveDriveElectricalContract electricalContract)
-
-
Method Details
-
setCurrentLimitsForMode
-
getMetersPerMotorRotation
public double getMetersPerMotorRotation() -
getLabel
-
getPrefix
- Specified by:
getPrefixin interfaceTunablePrefixProvider- Overrides:
getPrefixin classBaseSubsystem
-
getCurrentValue
Gets current velocity in meters per second- Specified by:
getCurrentValuein classBaseSetpointSubsystem<Double,Double>
-
getTargetValue
Gets target velocity in inches per second- Specified by:
getTargetValuein classBaseSetpointSubsystem<Double,Double>
-
setTargetValue
Sets target velocity in inches per second- Specified by:
setTargetValuein classBaseSetpointSubsystem<Double,Double>
-
getCurrentPositionValue
public double getCurrentPositionValue() -
setPower
- Specified by:
setPowerin classBaseSetpointSubsystem<Double,Double>
-
isCalibrated
public boolean isCalibrated()- Specified by:
isCalibratedin classBaseSetpointSubsystem<Double,Double>
-
getMotorController
-
getDrivePidEnabled
public boolean getDrivePidEnabled() -
setMotorControllerVelocityPidFromSubsystemTarget
public void setMotorControllerVelocityPidFromSubsystemTarget() -
setNoviceMode
public void setNoviceMode(boolean enabled) -
periodic
public void periodic()Description copied from class:BaseSubsystemThis method is called on eachCommandSchedulerloop.- Specified by:
periodicin interfaceorg.wpilib.command2.Subsystem- Overrides:
periodicin classBaseSubsystem
-