all my homies hate roadrunner
This commit is contained in:
parent
97bf2a6caa
commit
5ec14a3fc7
|
@ -1,34 +1,25 @@
|
||||||
package org.firstinspires.ftc.teamcode.createdcode.enhancedautos;
|
package org.firstinspires.ftc.teamcode.createdcode.enhancedautos;
|
||||||
|
|
||||||
import com.acmerobotics.roadrunner.geometry.Pose2d;
|
|
||||||
import com.acmerobotics.roadrunner.geometry.Vector2d;
|
|
||||||
import com.acmerobotics.roadrunner.trajectory.Trajectory;
|
|
||||||
import com.acmerobotics.roadrunner.trajectory.TrajectoryBuilder;
|
|
||||||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
||||||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
||||||
|
import com.qualcomm.robotcore.hardware.DcMotor;
|
||||||
import org.firstinspires.ftc.teamcode.drive.SampleMecanumDrive;
|
|
||||||
|
|
||||||
@Autonomous
|
@Autonomous
|
||||||
public class AutoBlueSubstationParkingBehavior extends LinearOpMode {
|
public class AutoBlueSubstationParkingBehavior extends LinearOpMode {
|
||||||
SampleMecanumDrive mecanumDrive;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runOpMode() throws InterruptedException {
|
public void runOpMode() throws InterruptedException {
|
||||||
mecanumDrive = new SampleMecanumDrive(hardwareMap);
|
DcMotor fl = hardwareMap.get(DcMotor.class, "frontLeft");
|
||||||
API api = new API(this);
|
DcMotor fr = hardwareMap.get(DcMotor.class, "frontRight");
|
||||||
|
DcMotor rl = hardwareMap.get(DcMotor.class, "rearLeft");
|
||||||
|
DcMotor rr = hardwareMap.get(DcMotor.class, "rearRight");
|
||||||
|
|
||||||
|
API api = new API(this);
|
||||||
|
MovementAPI movementAPI = new MovementAPI(api, fl, fr, rl, rr);
|
||||||
|
|
||||||
waitForStart();
|
waitForStart();
|
||||||
|
|
||||||
// init move to default terminal
|
movementAPI.move(90, 0.7);
|
||||||
Trajectory endpos = api.makeTrajectories(
|
api.pause(0.7);
|
||||||
mecanumDrive,
|
movementAPI.stop();
|
||||||
new Pose2d(new Vector2d(-34, 60), Math.toRadians(270)),
|
|
||||||
new int[]{-34, 1},
|
|
||||||
new int[]{60, 60}
|
|
||||||
);
|
|
||||||
|
|
||||||
mecanumDrive.followTrajectory(endpos);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,34 +1,25 @@
|
||||||
package org.firstinspires.ftc.teamcode.createdcode.enhancedautos;
|
package org.firstinspires.ftc.teamcode.createdcode.enhancedautos;
|
||||||
|
|
||||||
import com.acmerobotics.roadrunner.geometry.Pose2d;
|
|
||||||
import com.acmerobotics.roadrunner.geometry.Vector2d;
|
|
||||||
import com.acmerobotics.roadrunner.trajectory.Trajectory;
|
|
||||||
import com.acmerobotics.roadrunner.trajectory.TrajectoryBuilder;
|
|
||||||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
||||||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
||||||
|
import com.qualcomm.robotcore.hardware.DcMotor;
|
||||||
import org.firstinspires.ftc.teamcode.drive.SampleMecanumDrive;
|
|
||||||
|
|
||||||
@Autonomous
|
@Autonomous
|
||||||
public class AutoBlueTerminalParkingBehavior extends LinearOpMode {
|
public class AutoBlueTerminalParkingBehavior extends LinearOpMode {
|
||||||
SampleMecanumDrive mecanumDrive;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runOpMode() throws InterruptedException {
|
public void runOpMode() throws InterruptedException {
|
||||||
mecanumDrive = new SampleMecanumDrive(hardwareMap);
|
DcMotor fl = hardwareMap.get(DcMotor.class, "frontLeft");
|
||||||
API api = new API(this);
|
DcMotor fr = hardwareMap.get(DcMotor.class, "frontRight");
|
||||||
|
DcMotor rl = hardwareMap.get(DcMotor.class, "rearLeft");
|
||||||
|
DcMotor rr = hardwareMap.get(DcMotor.class, "rearRight");
|
||||||
|
|
||||||
|
API api = new API(this);
|
||||||
|
MovementAPI movementAPI = new MovementAPI(api, fl, fr, rl, rr);
|
||||||
|
|
||||||
waitForStart();
|
waitForStart();
|
||||||
|
|
||||||
// init move to default terminal
|
movementAPI.move(-90, 0.7);
|
||||||
Trajectory endpos = api.makeTrajectories(
|
api.pause(0.7);
|
||||||
mecanumDrive,
|
movementAPI.stop();
|
||||||
new Pose2d(new Vector2d(-34, 60), Math.toRadians(270)),
|
|
||||||
new int[]{-34, -70},
|
|
||||||
new int[]{60, 60}
|
|
||||||
);
|
|
||||||
|
|
||||||
mecanumDrive.followTrajectory(endpos);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,34 +1,25 @@
|
||||||
package org.firstinspires.ftc.teamcode.createdcode.enhancedautos;
|
package org.firstinspires.ftc.teamcode.createdcode.enhancedautos;
|
||||||
|
|
||||||
import com.acmerobotics.roadrunner.geometry.Pose2d;
|
|
||||||
import com.acmerobotics.roadrunner.geometry.Vector2d;
|
|
||||||
import com.acmerobotics.roadrunner.trajectory.Trajectory;
|
|
||||||
import com.acmerobotics.roadrunner.trajectory.TrajectoryBuilder;
|
|
||||||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
||||||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
||||||
|
import com.qualcomm.robotcore.hardware.DcMotor;
|
||||||
import org.firstinspires.ftc.teamcode.drive.SampleMecanumDrive;
|
|
||||||
|
|
||||||
@Autonomous
|
@Autonomous
|
||||||
public class AutoRedSubstationParkingBehavior extends LinearOpMode {
|
public class AutoRedSubstationParkingBehavior extends LinearOpMode {
|
||||||
SampleMecanumDrive mecanumDrive;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runOpMode() throws InterruptedException {
|
public void runOpMode() throws InterruptedException {
|
||||||
mecanumDrive = new SampleMecanumDrive(hardwareMap);
|
DcMotor fl = hardwareMap.get(DcMotor.class, "frontLeft");
|
||||||
API api = new API(this);
|
DcMotor fr = hardwareMap.get(DcMotor.class, "frontRight");
|
||||||
|
DcMotor rl = hardwareMap.get(DcMotor.class, "rearLeft");
|
||||||
|
DcMotor rr = hardwareMap.get(DcMotor.class, "rearRight");
|
||||||
|
|
||||||
|
API api = new API(this);
|
||||||
|
MovementAPI movementAPI = new MovementAPI(api, fl, fr, rl, rr);
|
||||||
|
|
||||||
waitForStart();
|
waitForStart();
|
||||||
|
|
||||||
// init move to default terminal
|
movementAPI.move(-90, 0.7);
|
||||||
Trajectory endpos = api.makeTrajectories(
|
api.pause(0.7);
|
||||||
mecanumDrive,
|
movementAPI.stop();
|
||||||
new Pose2d(new Vector2d(-34, -60), Math.toRadians(90)),
|
|
||||||
new int[]{-34, 1},
|
|
||||||
new int[]{-60, -60}
|
|
||||||
);
|
|
||||||
|
|
||||||
mecanumDrive.followTrajectory(endpos);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,34 +1,27 @@
|
||||||
package org.firstinspires.ftc.teamcode.createdcode.enhancedautos;
|
package org.firstinspires.ftc.teamcode.createdcode.enhancedautos;
|
||||||
|
|
||||||
import com.acmerobotics.roadrunner.geometry.Pose2d;
|
|
||||||
import com.acmerobotics.roadrunner.geometry.Vector2d;
|
|
||||||
import com.acmerobotics.roadrunner.trajectory.Trajectory;
|
|
||||||
import com.acmerobotics.roadrunner.trajectory.TrajectoryBuilder;
|
|
||||||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
||||||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
||||||
|
import com.qualcomm.robotcore.hardware.DcMotor;
|
||||||
|
|
||||||
import org.firstinspires.ftc.teamcode.drive.SampleMecanumDrive;
|
|
||||||
|
|
||||||
@Autonomous
|
@Autonomous
|
||||||
public class AutoRedTerminalParkingBehavior extends LinearOpMode {
|
public class AutoRedTerminalParkingBehavior extends LinearOpMode {
|
||||||
SampleMecanumDrive mecanumDrive;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runOpMode() throws InterruptedException {
|
public void runOpMode() throws InterruptedException {
|
||||||
mecanumDrive = new SampleMecanumDrive(hardwareMap);
|
DcMotor fl = hardwareMap.get(DcMotor.class, "frontLeft");
|
||||||
|
DcMotor fr = hardwareMap.get(DcMotor.class, "frontRight");
|
||||||
|
DcMotor rl = hardwareMap.get(DcMotor.class, "rearLeft");
|
||||||
|
DcMotor rr = hardwareMap.get(DcMotor.class, "rearRight");
|
||||||
|
|
||||||
API api = new API(this);
|
API api = new API(this);
|
||||||
|
MovementAPI movementAPI = new MovementAPI(api, fl, fr, rl, rr);
|
||||||
|
|
||||||
waitForStart();
|
waitForStart();
|
||||||
|
|
||||||
// init move to default terminal
|
movementAPI.move(90, 0.7);
|
||||||
Trajectory endpos = api.makeTrajectories(
|
api.pause(0.7);
|
||||||
mecanumDrive,
|
movementAPI.stop();
|
||||||
new Pose2d(new Vector2d(-34, -60), Math.toRadians(90)),
|
|
||||||
new int[]{-34, -70},
|
|
||||||
new int[]{-60, -60}
|
|
||||||
);
|
|
||||||
|
|
||||||
mecanumDrive.followTrajectory(endpos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue