Class Mechanism

java.lang.Object
me.autobot.lib.systems.mechanisms.Mechanism
Direct Known Subclasses:
LIDAR

public class Mechanism extends Object
A mechanism that can be used on the robot.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    If the mechanism is disabled.
    protected Robot
    The parent robot (of the mechanism, where the mechanism is attached to).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new Mechanism.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Disables the mechanism.
    void
    Enables the mechanism.
    protected void
    Initializes the mechanism.
    static void
    init_all(Robot robotRef)
    Runs the init method on all mechanisms.
    boolean
    Gets if the mechanism is disabled.
    protected void
    Stops the mechanism.
    static void
    Runs the stop method on all mechanisms.
    protected void
    Updates the mechanism.
    static void
    Runs the update method on all mechanisms.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • disabled

      protected boolean disabled
      If the mechanism is disabled.
    • parent

      protected Robot parent
      The parent robot (of the mechanism, where the mechanism is attached to).
  • Constructor Details

    • Mechanism

      public Mechanism()
      Creates a new Mechanism.
  • Method Details

    • init_all

      public static void init_all(Robot robotRef)
      Runs the init method on all mechanisms.
      Parameters:
      robotRef - The robot reference.
    • update_all

      public static void update_all()
      Runs the update method on all mechanisms.
    • stop_all

      public static void stop_all()
      Runs the stop method on all mechanisms.
    • init

      protected void init()
      Initializes the mechanism.
    • update

      protected void update()
      Updates the mechanism.
    • stop

      protected void stop()
      Stops the mechanism.
    • disable

      public void disable()
      Disables the mechanism.
    • enable

      public void enable()
      Enables the mechanism.
    • isDisabled

      public boolean isDisabled()
      Gets if the mechanism is disabled.
      Returns:
      If the mechanism is disabled.