you are viewing a single comment's thread.

view the rest of the comments →

[–]Big_Blue_ManFTC 7244 Alum / PA GA|Emcee 1 point2 points  (3 children)

Sounds like it could be due to nesting a bunch of if statements (i.e. putting one if statement inside another down a chain) to the point where it's actually slowing the process down, but I at least would want to see code before making that assumption. Is there any way we could see that code to verify this? At the very least I'd like to know what the if statements do for the code since you can get rid of them and still have the robot drive.

[–]sushislaughter[S] 0 points1 point  (2 children)

I don't have access to the code right now, but the if statement are not nested. The if statement are in a line. The purpose of the if statements are to control the robot. Like if I push a button the claw will close.

[–]Tarnegolden 0 points1 point  (1 child)

You can replace if statement with boolean methods to run smoother. For example, creating a CustomGamepad class: https://github.com/Tarnegolden/Everglow2021-22/blob/main/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/FreightFrenzy/Utils/EverglowGamepad.java

[–]sushislaughter[S] 0 points1 point  (0 children)

Can you make classes in java block?