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
ConstructorDescriptionBackUp()
Initializes the BackUp object.Gets instance of the singletons it requires in case they are null. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.void
suppress()
Suppress function does nothing here.boolean
Takes 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:
action
in interfacelejos.robotics.subsumption.Behavior
-
suppress
public void suppress()Suppress function does nothing here.- Specified by:
suppress
in interfacelejos.robotics.subsumption.Behavior
-
takeControl
public boolean takeControl()Takes control when the state is equal to the BACK_UP state.- Specified by:
takeControl
in interfacelejos.robotics.subsumption.Behavior
- Returns:
- boolean
-