feat:ftc2024-holonom.java

This commit is contained in:
GZod01 2024-01-07 17:26:01 +01:00
parent a6db57fcdb
commit 35a29749da

View file

@ -91,7 +91,7 @@ public class Werobot_FTC2024 extends LinearOpMode {
double joystick_angle = Math.atan2(joystick_vector[0],joystick_vector[1]);
double cur_motor_angle = Math.atan2(cur_motor[0],cur_motor[1]);
double diff_angle = joystick_angle - cur_motor_angle;
diff_angle-=Yaw;
diff_angle-=Yaw-Math.PI;
motors_values[i] = (cur_motor_norm*joystick_norm*Math.cos(diff_angle));
motors_values[i] = (motors_values[i]+gamepad1.right_stick_x)/(Math.abs(gamepad1.right_stick_x)+1);
motors_values[i]= motors_values[i]/Math.sqrt(2);
@ -107,6 +107,7 @@ public class Werobot_FTC2024 extends LinearOpMode {
frm.setPower(motors_values[1]);
blm.setPower(motors_values[2]);
brm.setPower(motors_values[3]);
telemetry.addData("yaw",Yaw);
telemetry.update();
}
}