Class TeleOpPedroModule

java.lang.Object
com.cdarobotics.cdalib.opmodes.modules.Module
com.cdarobotics.cdalib.opmodes.modules.TeleOpPedroModule

public class TeleOpPedroModule extends Module
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

    Constructors
    Constructor
    Description
    TeleOpPedroModule(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 Type
    Method
    Description
    void
    Called once when the OpMode initializes.
    void
    Called repeatedly during the OpMode init phase, after Module.init() and before Module.start(), while the driver is still on the init screen.
    void
    Called every loop.
    void
    Registers the four driving inputs with the binding manager under the ids "drive", "strafe", "turn", and "slowMode".
    void
    Called once when the OpMode starts (play pressed).
    void
    Called once when the OpMode ends.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 driving
      startingPose - The starting Pose for the Follower
      bindingManager - The BindingManager for the OpMode
      slowModeMultiplier - 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 driving
      startingPose - The starting Pose for the Follower
      bindingManager - 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 Y
      strafe - left/right input, typically the left stick X
      turn - rotation input, typically the right stick X
      slowMode - when true, drive and strafe are scaled by the slow-mode multiplier
    • init

      public void init()
      Description copied from class: Module
      Called once when the OpMode initializes.
      Specified by:
      init in class Module
    • init_loop

      public void init_loop()
      Description copied from class: Module
      Called repeatedly during the OpMode init phase, after Module.init() and before Module.start(), while the driver is still on the init screen.
      Specified by:
      init_loop in class Module
    • start

      public void start()
      Description copied from class: Module
      Called once when the OpMode starts (play pressed).
      Specified by:
      start in class Module
    • loop

      public void loop()
      Description copied from class: Module
      Called every loop.
      Specified by:
      loop in class Module
    • stop

      public void stop()
      Description copied from class: Module
      Called once when the OpMode ends.
      Specified by:
      stop in class Module