Skip to content

Commit

Permalink
Turned Turbo into Slow Mode and square with sign
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahin-W committed Jan 23, 2024
1 parent b3f419b commit 6c4eb48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
import org.firstinspires.ftc.teamcode.ftc16072.OpModes.QQOpMode;

public class DriveFieldRelative extends Node {
private double squareWithSign(double number){
return number * number * Math.signum(number);
}

@Override
public State tick(QQOpMode opmode) {
opmode.robot.nav.fieldRelative(-opmode.gamepad1.left_stick_y,
opmode.gamepad1.left_stick_x,
opmode.gamepad1.right_stick_x);
opmode.robot.nav.fieldRelative(squareWithSign(-opmode.gamepad1.left_stick_y),
squareWithSign(opmode.gamepad1.left_stick_x),
squareWithSign(opmode.gamepad1.right_stick_x));
return State.RUNNING;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Trees;

import org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Actions.DriveFieldRelative;
import org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Actions.MakeFastDrive;
import org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Actions.MakeNormalDrive;
import org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Actions.MakeSlowDrive;
import org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Actions.MoveArmAndLift;
Expand Down Expand Up @@ -93,7 +92,7 @@ public static Node root(){
new AreSlidesExtended(),
new Sequence(
new IfLeftTriggerPressed(),
new MakeFastDrive()
new MakeSlowDrive()
),
new MakeNormalDrive()
)
Expand Down

0 comments on commit 6c4eb48

Please sign in to comment.