Package behaviors
Class BackUp
java.lang.Object
behaviors.BackUp
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionBackUp()Initializes the BackUp object.Gets instance of the singletons it requires in case they are null. -
Method Summary
Modifier and TypeMethodDescriptionvoidaction()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.voidsuppress()Suppress function does nothing here.booleanTakes control when the state is equal to the BACK_UP state.
-
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:
actionin interfacelejos.robotics.subsumption.Behavior
-
suppress
public void suppress()Suppress function does nothing here.- Specified by:
suppressin interfacelejos.robotics.subsumption.Behavior
-
takeControl
public boolean takeControl()Takes control when the state is equal to the BACK_UP state.- Specified by:
takeControlin interfacelejos.robotics.subsumption.Behavior- Returns:
- boolean
-