Class MecanumDrivetrain
- java.lang.Object
-
- ca.team3161.lib.robot.subsystem.AbstractSubsystem
-
- ca.team3161.lib.robot.subsystem.AbstractPooledSubsystem
-
- ca.team3161.lib.robot.subsystem.RepeatingPooledSubsystem
-
- ca.team3161.lib.robot.motion.drivetrains.AbstractDrivetrainBase
-
- ca.team3161.lib.robot.motion.drivetrains.MecanumDrivetrain
-
- All Implemented Interfaces:
LifecycleListener,Subsystem,ComposedComponent<java.lang.Object>
public class MecanumDrivetrain extends AbstractDrivetrainBase implements ComposedComponent<java.lang.Object>
A prepackaged mecanum drive solution, suitable for 4-wheeled Mecanum drivetrains. SeeVelocityControllerfor a recommended SpeedController to use for each wheel.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMecanumDrivetrain.BuilderA Builder for mecanum drivetrains.-
Nested classes/interfaces inherited from class ca.team3161.lib.robot.subsystem.AbstractSubsystem
AbstractSubsystem.RunTask
-
-
Field Summary
-
Fields inherited from class ca.team3161.lib.robot.subsystem.AbstractSubsystem
job, resourceLocks, THREAD_PRIORITY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineResources()Define the set of resourceLocks required for this Subsystem's task.java.util.Collection<java.lang.Object>getComposedComponents()Get the composed components within this one.voidsetForwardTarget(double forwardTarget)Set the "forward target", which is a value in the range [-1.0, 1.0]; 1.0 representing full speed forward, -1.0 representing full speed backward, and 0 representing no forward or backward movement.voidsetRotateTarget(double rotateTarget)Set the "rotate target", which is a value in the range [-1.0, 1.0]; 1.0 representing full speed clockwise, -1.0 representing full speed counterclockwise, and 0 representing no rotation.voidsetStrafeTarget(double strafeTarget)Set the "strafe target", which is a value in the range [-1.0, 1.0]; 1.0 representing full speed right, -1.0 representing full speed left, and 0 representing no strafing.voidstop()Stop all movement by setting all motor target values to 0 and disabling them.voidtask()The background task to run.-
Methods inherited from class ca.team3161.lib.robot.motion.drivetrains.AbstractDrivetrainBase
onLifecycleChange
-
Methods inherited from class ca.team3161.lib.robot.subsystem.RepeatingPooledSubsystem
isDone, start
-
Methods inherited from class ca.team3161.lib.robot.subsystem.AbstractPooledSubsystem
getExecutorService
-
Methods inherited from class ca.team3161.lib.robot.subsystem.AbstractSubsystem
acquireResources, cancel, getJob, isCancelled, isScheduled, isStarted, releaseResources, require
-
-
-
-
Method Detail
-
defineResources
public void defineResources()
Define the set of resourceLocks required for this Subsystem's task.- Specified by:
defineResourcesin interfaceSubsystem- See Also:
AbstractSubsystem.require(Object)
-
setForwardTarget
public void setForwardTarget(double forwardTarget)
Set the "forward target", which is a value in the range [-1.0, 1.0]; 1.0 representing full speed forward, -1.0 representing full speed backward, and 0 representing no forward or backward movement.- Parameters:
forwardTarget- the forward target
-
setStrafeTarget
public void setStrafeTarget(double strafeTarget)
Set the "strafe target", which is a value in the range [-1.0, 1.0]; 1.0 representing full speed right, -1.0 representing full speed left, and 0 representing no strafing.- Parameters:
strafeTarget- the forward target
-
setRotateTarget
public void setRotateTarget(double rotateTarget)
Set the "rotate target", which is a value in the range [-1.0, 1.0]; 1.0 representing full speed clockwise, -1.0 representing full speed counterclockwise, and 0 representing no rotation.- Parameters:
rotateTarget- the forward target
-
stop
public void stop()
Stop all movement by setting all motor target values to 0 and disabling them.- Specified by:
stopin classAbstractDrivetrainBase
-
task
public void task() throws java.lang.ExceptionThe background task to run.
-
getComposedComponents
public java.util.Collection<java.lang.Object> getComposedComponents()
Get the composed components within this one.- Specified by:
getComposedComponentsin interfaceComposedComponent<java.lang.Object>- Returns:
- the composed components.
-
-