Actualiser ftc2024-carlike.java
This commit is contained in:
parent
84d5725c89
commit
cf53b5fc46
1 changed files with 5 additions and 2 deletions
|
@ -57,8 +57,11 @@ public class Werobot_FTC2024_carlike extends LinearOpMode {
|
|||
rpower = gamepad1.right_stick_y;
|
||||
}
|
||||
else if (mode=="essaifranck"){
|
||||
lpower = (gamepad1.left_stick_x-gamepad1.left_stick_y)/Math.pow(2,1/2);
|
||||
rpower = (gamepad1.left_stick_x+gamepad1.left_stick_y)/Math.pow(2,1/2);
|
||||
double a = (gamepad1.left_stick_x-gamepad1.left_stick_y)/Math.pow(2,1/2);
|
||||
double b = (gamepad1.left_stick_x+gamepad1.left_stick_y)/Math.pow(2,1/2);
|
||||
double asqr_plus_bsqr = Math.pow(a,2)+Math.pow(b,2);
|
||||
lpower = (a/asqr_plus_bsqr)*Math.pow(gamepad1.left_trigger,1/2);
|
||||
rpower = (b/asqr_plus_bsqr)*Math.pow(gamepad1.left_trigger,1/2);
|
||||
}
|
||||
if(!(gamepad1.left_bumper)){
|
||||
lpower/=3;
|
||||
|
|
Loading…
Reference in a new issue