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
-
Field Summary
Fields inherited from class xbot.common.command.BaseSetpointSubsystem
atGoal, lastTargetValueUsedforAtGoal
Fields inherited from class xbot.common.command.BaseSubsystem
aKitLog, dataFrameRefreshables
-
Constructor Summary
ConstructorDescriptionSwerveDriveSubsystem
(SwerveInstance swerveInstance, XCANMotorController.XCANMotorControllerFactory mcFactory, PropertyFactory pf, XSwerveDriveElectricalContract electricalContract) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
areTwoTargetsEquivalent
(Double target1, Double target2) double
Gets current velocity in meters per secondboolean
getLabel()
Gets target velocity in inches per secondboolean
void
periodic()
This method is called on eachCommandScheduler
loop.void
Consumes and processes inputs from the device or subsystem.void
void
void
setNoviceMode
(boolean enabled) void
setPower
(double power) void
setTargetValue
(Double value) Sets target velocity in inches per secondMethods inherited from class xbot.common.command.BaseSetpointSubsystem
areTwoDoublesEquivalent, areTwoDoublesEquivalent, createSetTargetCommand, createSetTargetCommand, getSetpointLock, isMaintainerAtGoal, setMaintainerIsAtGoal
Methods inherited from class xbot.common.command.BaseSubsystem
registerDataFrameRefreshable
Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
-
getLabel
-
getPrefix
- Specified by:
getPrefix
in interfaceIPropertySupport
- Overrides:
getPrefix
in classBaseSubsystem
-
getCurrentValue
Gets current velocity in meters per second- Specified by:
getCurrentValue
in classBaseSetpointSubsystem<Double>
-
getTargetValue
Gets target velocity in inches per second- Specified by:
getTargetValue
in classBaseSetpointSubsystem<Double>
-
setTargetValue
Sets target velocity in inches per second- Specified by:
setTargetValue
in classBaseSetpointSubsystem<Double>
-
getCurrentPositionValue
public double getCurrentPositionValue() -
setPower
public void setPower(double power) - Specified by:
setPower
in classBaseSetpointSubsystem<Double>
-
isCalibrated
public boolean isCalibrated()- Specified by:
isCalibrated
in classBaseSetpointSubsystem<Double>
-
getMotorController
-
getDrivePidEnabled
public boolean getDrivePidEnabled() -
setMotorControllerVelocityPidFromSubsystemTarget
public void setMotorControllerVelocityPidFromSubsystemTarget() -
setNoviceMode
public void setNoviceMode(boolean enabled) -
areTwoTargetsEquivalent
- Specified by:
areTwoTargetsEquivalent
in classBaseSetpointSubsystem<Double>
-
periodic
public void periodic()Description copied from class:BaseSubsystem
This method is called on eachCommandScheduler
loop.- Specified by:
periodic
in interfaceSubsystem
- Overrides:
periodic
in classBaseSubsystem
-
refreshDataFrame
public void refreshDataFrame()Description copied from interface:DataFrameRefreshable
Consumes and processes inputs from the device or subsystem.- Specified by:
refreshDataFrame
in interfaceDataFrameRefreshable
- Overrides:
refreshDataFrame
in classBaseSubsystem
-