Package dev.narlyx.tweetybird
Class TweetyBird.Builder
java.lang.Object
dev.narlyx.tweetybird.TweetyBird.Builder
- Enclosing class:
- TweetyBird
Use this method to properly set up TweetyBird using Java's builder pattern.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Will construct TweetyBird with the configuration defined within this builder and return a new copy of TweetyBird.setDebuggingEnabled
(boolean debuggingEnabled) NOT RECOMMENDED This wil flood your console with debug messages, only use for development and will slow the runtime loop without a linear op mode, the default value is falsesetDistanceBuffer
(double distanceBuffer) OPTIONAL This value will define how close TweetyBird needs to move be to its target to consider itself to be okay to stop moving, the default value is 1.setDriver
(TweetyBird.Driver driver) REQUIRED A new class that implements TweetyBird's Driver interface, TweetyBird will use this class to output motion.setLinearOpMode
(com.qualcomm.robotcore.eventloop.opmode.LinearOpMode opMode) REQUIRED FOR FTC Sets the LinearOpMode that TweetyBird will use, this will be used to start and stop TweetyBird.setMaximumSpeed
(double maxSpeed) OPTIONAL This value will define how fast TweetyBird is allowed to move, the default value is 1.setMinimumSpeed
(double minSpeed) OPTIONAL This value will define how slow TweetyBird is allowed to move, the default value is 0.1.setOdometer
(TweetyBird.Odometer odometer) REQUIRED A new class that implements TweetyBird's Odometer interface, TweetyBird will use this class to receive input on the robot's location.setRotationBuffer
(double rotationBuffer) OPTIONAL This value will define how close TweetyBird needs to rotate to its target to consider itself to be okay to stop rotating, the default value is 1 degree.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setLinearOpMode
public TweetyBird.Builder setLinearOpMode(com.qualcomm.robotcore.eventloop.opmode.LinearOpMode opMode) REQUIRED FOR FTC Sets the LinearOpMode that TweetyBird will use, this will be used to start and stop TweetyBird.- Parameters:
opMode
- Passed OpMode- Returns:
- Updated builder
-
setOdometer
REQUIRED A new class that implements TweetyBird's Odometer interface, TweetyBird will use this class to receive input on the robot's location.- Parameters:
odometer
- Passed Odometer- Returns:
- Updated builder
-
setDriver
REQUIRED A new class that implements TweetyBird's Driver interface, TweetyBird will use this class to output motion.- Parameters:
driver
- Passed Odometer- Returns:
- Updated builder
-
setMinimumSpeed
OPTIONAL This value will define how slow TweetyBird is allowed to move, the default value is 0.1.- Parameters:
minSpeed
- A number between 0 and 1- Returns:
- Updated builder
-
setMaximumSpeed
OPTIONAL This value will define how fast TweetyBird is allowed to move, the default value is 1.- Parameters:
maxSpeed
- A number between 0 and 1, must be greater than the minimum speed- Returns:
- Updated builder
-
setDistanceBuffer
OPTIONAL This value will define how close TweetyBird needs to move be to its target to consider itself to be okay to stop moving, the default value is 1.- Parameters:
distanceBuffer
- Number of units of measurement- Returns:
- Updated builder
-
setRotationBuffer
OPTIONAL This value will define how close TweetyBird needs to rotate to its target to consider itself to be okay to stop rotating, the default value is 1 degree.- Parameters:
rotationBuffer
- Number in degrees- Returns:
- Updated builder
-
setDebuggingEnabled
NOT RECOMMENDED This wil flood your console with debug messages, only use for development and will slow the runtime loop without a linear op mode, the default value is false- Parameters:
debuggingEnabled
- Weather to enable debug logs- Returns:
- Updated builder
-
build
Will construct TweetyBird with the configuration defined within this builder and return a new copy of TweetyBird.- Returns:
- TweetyBird
-