hello
This commit is contained in:
parent
6d2ed0fb44
commit
2c42078e53
2 changed files with 214 additions and 213 deletions
|
@ -73,7 +73,7 @@ public class ftc2024_autonome extends LinearOpMode {
|
||||||
double x = vec[0];
|
double x = vec[0];
|
||||||
double y = vec[1];
|
double y = vec[1];
|
||||||
double total_dist = (double) Math.sqrt(Math.pow(y,2)+Math.pow(x,2));
|
double total_dist = (double) Math.sqrt(Math.pow(y,2)+Math.pow(x,2));
|
||||||
double time = time_for_dist(speed, time);
|
double time = time_for_dist(speed, total_dist);
|
||||||
double a = (-y+x)/Math.pow(2,1/2);
|
double a = (-y+x)/Math.pow(2,1/2);
|
||||||
double b = (-y-x)/Math.pow(2,1/2);
|
double b = (-y-x)/Math.pow(2,1/2);
|
||||||
double vmean = (Math.abs(a)+Math.abs(b))/2;
|
double vmean = (Math.abs(a)+Math.abs(b))/2;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.firstinspires.ftc.teamcode;
|
package org.firstinspires.ftc.teamcode;
|
||||||
|
|
||||||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
||||||
|
import org.firstinspires.ftc.robotcore.external.navigation.YawPitchRollAngles;
|
||||||
import com.qualcomm.robotcore.robot.Robot;
|
import com.qualcomm.robotcore.robot.Robot;
|
||||||
import org.firstinspires.ftc.robotcore.external.Telemetry;
|
import org.firstinspires.ftc.robotcore.external.Telemetry;
|
||||||
import com.qualcomm.robotcore.hardware.Gamepad;
|
import com.qualcomm.robotcore.hardware.Gamepad;
|
||||||
|
@ -45,7 +46,7 @@ public class Werobot_FTC2024_carlike extends LinearOpMode {
|
||||||
telemetry.update();
|
telemetry.update();
|
||||||
lm = hardwareMap.get(DcMotor.class, "blm");
|
lm = hardwareMap.get(DcMotor.class, "blm");
|
||||||
rm = hardwareMap.get(DcMotor.class, "brm");
|
rm = hardwareMap.get(DcMotor.class, "brm");
|
||||||
moissoneuse = hardwareMap.get(DCMotor.class, "flm");
|
moissoneuse = hardwareMap.get(DcMotor.class, "flm");
|
||||||
|
|
||||||
|
|
||||||
imu = hardwareMap.get(IMU.class, "imu");
|
imu = hardwareMap.get(IMU.class, "imu");
|
||||||
|
@ -132,7 +133,7 @@ public class Werobot_FTC2024_carlike extends LinearOpMode {
|
||||||
|
|
||||||
if(gamepad1.b && !already_b){
|
if(gamepad1.b && !already_b){
|
||||||
already_b = !already_b;
|
already_b = !already_b;
|
||||||
if(moissoneuse.getPowerFloat == (float) 1){
|
if(moissoneuse.getPower() == 1.0){
|
||||||
moissoneuse.setPower(0);
|
moissoneuse.setPower(0);
|
||||||
}else{
|
}else{
|
||||||
moissoneuse.setPower(1);
|
moissoneuse.setPower(1);
|
||||||
|
@ -143,7 +144,7 @@ public class Werobot_FTC2024_carlike extends LinearOpMode {
|
||||||
}
|
}
|
||||||
if(gamepad1.a && !already_a){
|
if(gamepad1.a && !already_a){
|
||||||
already_a = !already_a;
|
already_a = !already_a;
|
||||||
if(moissoneuse.getPowerFloat == (float) -1){
|
if(moissoneuse.getPower() == -1.0){
|
||||||
moissoneuse.setPower(0);
|
moissoneuse.setPower(0);
|
||||||
}else{
|
}else{
|
||||||
moissoneuse.setPower(-1);
|
moissoneuse.setPower(-1);
|
||||||
|
|
Loading…
Reference in a new issue