Class TeleOpPedroModule
java.lang.Object
com.cdarobotics.cdalib.opmodes.modules.Module
com.cdarobotics.cdalib.opmodes.modules.TeleOpPedroModule
A simple Module that handles driving with PedroPathing. It uses the built in functions for TeleOp driving in the follower and also uses four bindings, drive, strafe, turn, and slowMode. If using this module, the function setBindings will set the bindings automatically
-
Constructor Summary
ConstructorsConstructorDescriptionTeleOpPedroModule(com.pedropathing.follower.Follower follower, com.pedropathing.math.Pose startingPose, BindingManager bindingManager) A simple Module that handles driving for PedroPathing.TeleOpPedroModule(com.pedropathing.follower.Follower follower, com.pedropathing.math.Pose startingPose, BindingManager bindingManager, double slowModeMultiplier) Creates a simple Module that handles driving for PedroPathing. -
Method Summary
Modifier and TypeMethodDescriptionvoidinit()Called once when the OpMode initializes.voidCalled repeatedly during the OpMode init phase, afterModule.init()and beforeModule.start(), while the driver is still on the init screen.voidloop()Called every loop.voidsetBindings(DoubleSupplier drive, DoubleSupplier strafe, DoubleSupplier turn, BooleanSupplier slowMode) Registers the four driving inputs with the binding manager under the ids"drive","strafe","turn", and"slowMode".voidstart()Called once when the OpMode starts (play pressed).voidstop()Called once when the OpMode ends.
-
Constructor Details
-
TeleOpPedroModule
public TeleOpPedroModule(com.pedropathing.follower.Follower follower, com.pedropathing.math.Pose startingPose, BindingManager bindingManager, double slowModeMultiplier) Creates a simple Module that handles driving for PedroPathing.- Parameters:
follower- The Follower to be used for drivingstartingPose- The starting Pose for the FollowerbindingManager- The BindingManager for the OpModeslowModeMultiplier- The multiplier for the slow mode
-
TeleOpPedroModule
public TeleOpPedroModule(com.pedropathing.follower.Follower follower, com.pedropathing.math.Pose startingPose, BindingManager bindingManager) A simple Module that handles driving for PedroPathing.- Parameters:
follower- The Follower to be used for drivingstartingPose- The starting Pose for the FollowerbindingManager- The BindingManager for the OpMode
-
-
Method Details
-
setBindings
public void setBindings(DoubleSupplier drive, DoubleSupplier strafe, DoubleSupplier turn, BooleanSupplier slowMode) Registers the four driving inputs with the binding manager under the ids"drive","strafe","turn", and"slowMode".- Parameters:
drive- forward/back input, typically the left stick Ystrafe- left/right input, typically the left stick Xturn- rotation input, typically the right stick XslowMode- when true, drive and strafe are scaled by the slow-mode multiplier
-
init
public void init()Description copied from class:ModuleCalled once when the OpMode initializes. -
init_loop
public void init_loop()Description copied from class:ModuleCalled repeatedly during the OpMode init phase, afterModule.init()and beforeModule.start(), while the driver is still on the init screen. -
start
public void start()Description copied from class:ModuleCalled once when the OpMode starts (play pressed). -
loop
public void loop()Description copied from class:ModuleCalled every loop. -
stop
public void stop()Description copied from class:ModuleCalled once when the OpMode ends.
-