Class Drive
java.lang.Object
org.edu_nation.easy_ftc.mechanism.Drive
Implements a drivetrain by extending the functionality of
MotorMechanism- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConstruct aDriveobject using the builder design patternstatic enumDirections that can be passed tocommand(direction, measurement, power)static enumDrivetrain layouts that can be passed toDrive.Builder.layout(layout)static enumDrivetrain types that can be passed toDrive.Builder.type(type) -
Method Summary
Modifier and TypeMethodDescriptionvoidcommand(Drive.Direction direction, double measurement, double power) Initiate an automated drivetrain movementvoidcommand(Drive.Direction direction, double measurement, double power, org.firstinspires.ftc.robotcore.external.navigation.AngleUnit unit) Initiate an automated drivetrain turn using the IMU's gyrovoidcontrol()Enable teleoperated drivetrain movement with gamepad (joysticks), with multiplier = 1.0voidcontrol(double multiplier) Enable teleoperated drivetrain movement with gamepad (joysticks), scaling by multiplier
-
Method Details
-
control
public void control(double multiplier) Enable teleoperated drivetrain movement with gamepad (joysticks), scaling by multiplier- Parameters:
multiplier- fraction of total power/velocity to use for mechanism control at given input value- Throws:
IllegalArgumentException- if multiplier is not in the interval (0, 1]
-
control
public void control()Enable teleoperated drivetrain movement with gamepad (joysticks), with multiplier = 1.0 -
command
Initiate an automated drivetrain movement- Parameters:
direction- direction to move the mechanism; seeDrive.Directionfor accepted valuesmeasurement- time(s) or distance to move the mechanismpower- fraction of total power/velocity to use for mechanism command- Throws:
NullPointerException- if direction is nullIllegalArgumentException- if direction is an unexpected valueIllegalArgumentException- if measurement < 0IllegalArgumentException- if power is not in the interval (0, 1]
-