Class SwerveDriveSubsystem
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
xbot.common.command.BaseSubsystem
xbot.common.command.BaseSetpointSubsystem<Double>
xbot.common.subsystems.drive.swerve.SwerveDriveSubsystem
- All Implemented Interfaces:
Sendable,Subsystem,DataFrameRefreshable,SupportsSetpointLock,IPropertySupport
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class xbot.common.command.BaseSetpointSubsystem
atGoal, lastTargetValueUsedforAtGoalFields inherited from class xbot.common.command.BaseSubsystem
aKitLog, dataFrameRefreshables -
Constructor Summary
ConstructorsConstructorDescriptionSwerveDriveSubsystem(SwerveInstance swerveInstance, XCANMotorController.XCANMotorControllerFactory mcFactory, PropertyFactory pf, XSwerveDriveElectricalContract electricalContract) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanareTwoTargetsEquivalent(Double target1, Double target2) doubleGets current velocity in meters per secondbooleangetLabel()doubleGets target velocity in inches per secondbooleanvoidperiodic()This method is called on eachCommandSchedulerloop.voidConsumes and processes inputs from the device or subsystem.voidvoidvoidsetNoviceMode(boolean enabled) voidsetPower(double power) voidsetTargetValue(Double value) Sets target velocity in inches per secondMethods inherited from class xbot.common.command.BaseSetpointSubsystem
areTwoDoublesEquivalent, areTwoDoublesEquivalent, createSetTargetCommand, createSetTargetCommand, getSetpointLock, isMaintainerAtGoal, setMaintainerIsAtGoalMethods inherited from class xbot.common.command.BaseSubsystem
registerDataFrameRefreshableMethods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Constructor Details
-
SwerveDriveSubsystem
@Inject public SwerveDriveSubsystem(SwerveInstance swerveInstance, XCANMotorController.XCANMotorControllerFactory mcFactory, PropertyFactory pf, XSwerveDriveElectricalContract electricalContract)
-
-
Method Details
-
setCurrentLimitsForMode
-
getMetersPerMotorRotation
public double getMetersPerMotorRotation() -
getLabel
-
getPrefix
- Specified by:
getPrefixin interfaceIPropertySupport- Overrides:
getPrefixin classBaseSubsystem
-
getCurrentValue
Gets current velocity in meters per second- Specified by:
getCurrentValuein classBaseSetpointSubsystem<Double>
-
getTargetValue
Gets target velocity in inches per second- Specified by:
getTargetValuein classBaseSetpointSubsystem<Double>
-
setTargetValue
Sets target velocity in inches per second- Specified by:
setTargetValuein classBaseSetpointSubsystem<Double>
-
getCurrentPositionValue
public double getCurrentPositionValue() -
setPower
public void setPower(double power) - Specified by:
setPowerin classBaseSetpointSubsystem<Double>
-
isCalibrated
public boolean isCalibrated()- Specified by:
isCalibratedin classBaseSetpointSubsystem<Double>
-
getMotorController
-
getDrivePidEnabled
public boolean getDrivePidEnabled() -
setMotorControllerVelocityPidFromSubsystemTarget
public void setMotorControllerVelocityPidFromSubsystemTarget() -
setNoviceMode
public void setNoviceMode(boolean enabled) -
areTwoTargetsEquivalent
- Specified by:
areTwoTargetsEquivalentin classBaseSetpointSubsystem<Double>
-
periodic
public void periodic()Description copied from class:BaseSubsystemThis method is called on eachCommandSchedulerloop.- Specified by:
periodicin interfaceSubsystem- Overrides:
periodicin classBaseSubsystem
-
refreshDataFrame
public void refreshDataFrame()Description copied from interface:DataFrameRefreshableConsumes and processes inputs from the device or subsystem.- Specified by:
refreshDataFramein interfaceDataFrameRefreshable- Overrides:
refreshDataFramein classBaseSubsystem
-