Skip to content

Commit

Permalink
fixed lift movement on behavior tree
Browse files Browse the repository at this point in the history
  • Loading branch information
alanwong9664 committed Jan 27, 2024
1 parent 6ab1f16 commit 8992cdb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Conditions;

import org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Node;
import org.firstinspires.ftc.teamcode.ftc16072.OpModes.QQOpMode;

public class IfLiftAtBottom extends Node {
@Override
public State tick(QQOpMode opmode) {
if(opmode.robot.lift.currentPosition()<50){
return State.SUCCESS;


}
return State.FAILURE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Conditions.IfEjectButtonPressed;
import org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Conditions.IfIntakeButtonPressed;
import org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Conditions.IfLeftTriggerPressed;
import org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Conditions.IfLiftAtBottom;
import org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Conditions.IfLiftToPixelGrabPosButtonPressed;
import org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Conditions.IsControllerDriving;
import org.firstinspires.ftc.teamcode.ftc16072.BehaviorTrees.Failover;
Expand Down Expand Up @@ -151,17 +152,28 @@ public static Node root(){
),
new Parallel(2,
new Sequence(
new IfLiftAtBottom(),
new Has1or2Pixels(),

new Failover(
new Sequence(
new MoveArmAndLift(),
new PlacePixels()
new IfLiftAtBottom(),
new Has1or2Pixels(),

new Failover(
new Sequence(
new MoveArmAndLift(),
new PlacePixels()
)

)

),

new Sequence(
new MoveArmAndLift(),
new PlacePixels()
)




),
new Failover(
new AreSlidesExtended(),
Expand Down

0 comments on commit 8992cdb

Please sign in to comment.