Package behaviors

Class BackUp

java.lang.Object
behaviors.BackUp
All Implemented Interfaces:
lejos.robotics.subsumption.Behavior

public class BackUp extends Object implements lejos.robotics.subsumption.Behavior
BackUp implements Behavior in order to back the robot up until it hits a black line. This is used for calibration and ensuring the robot draws things in the right place.
Since:
2023
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes the BackUp object.Gets instance of the singletons it requires in case they are null.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Implements the action method of behavior.Using a sample provider it checks the light level of the sensor to see when near the marker line.
    void
    Suppress function does nothing here.
    boolean
    Takes control when the state is equal to the BACK_UP state.

    Methods inherited from class java.lang.Object

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

    • BackUp

      public BackUp()
      Initializes the BackUp object.Gets instance of the singletons it requires in case they are null.
  • Method Details

    • action

      public void action()
      Implements the action method of behavior.Using a sample provider it checks the light level of the sensor to see when near the marker line. It uses the motors to go backwards until this point is reached.
      Specified by:
      action in interface lejos.robotics.subsumption.Behavior
    • suppress

      public void suppress()
      Suppress function does nothing here.
      Specified by:
      suppress in interface lejos.robotics.subsumption.Behavior
    • takeControl

      public boolean takeControl()
      Takes control when the state is equal to the BACK_UP state.
      Specified by:
      takeControl in interface lejos.robotics.subsumption.Behavior
      Returns:
      boolean