Blue Net Auto files

This commit is contained in:
2024-12-08 08:44:15 -08:00
parent 0e3e6f437a
commit 7f61c1d3f5
2 changed files with 72 additions and 5 deletions

View File

@ -0,0 +1,31 @@
package org.firstinspires.ftc.teamcode;
import com.acmerobotics.roadrunner.Action;
import com.acmerobotics.roadrunner.ftc.Actions;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import org.firstinspires.ftc.teamcode.pedroPathing.follower.Follower;
import org.firstinspires.ftc.teamcode.subsystem.AutoLine1;
@Autonomous(name = "BlueNetAuto", group = "Dev")
public class NetAuto extends OpMode {
public Follower follower;
@Override
public void init() {
follower = new Follower(hardwareMap);
}
public Action autoLine1() {return new AutoLine1(follower);}
@Override
public void loop() {
follower.update();
Actions.runBlocking(
autoLine1()
);
follower.telemetryDebug(telemetry);
}
}

View File

@ -7,7 +7,9 @@ import com.acmerobotics.roadrunner.Action;
import org.firstinspires.ftc.teamcode.pedroPathing.follower.Follower;
import org.firstinspires.ftc.teamcode.pedroPathing.localization.Pose;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.BezierCurve;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.BezierLine;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathBuilder;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathChain;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.Point;
@ -27,12 +29,46 @@ public class AutoLine1 implements Action {
public AutoLine1(Follower robot) {
this.actionRobot = robot;
this.actionRobot.setStartingPose(startPose);
this.pathChain = actionRobot.pathBuilder().addPath(
new BezierLine(
new Point(8.000, 65.000, Point.CARTESIAN),
new Point(33.000, 65.000, Point.CARTESIAN)
PathBuilder builder = new PathBuilder();
builder
.addPath(
// Line 1
new BezierLine(
new Point(8.000, 65.000, Point.CARTESIAN),
new Point(36.000, 72.000, Point.CARTESIAN)
)
)
).setConstantHeadingInterpolation(Math.toRadians(0)).build();
.setConstantHeadingInterpolation(Math.toRadians(0))
.addPath(
// Line 2
new BezierCurve(
new Point(36.000, 72.000, Point.CARTESIAN),
new Point(36.000, 36.000, Point.CARTESIAN),
new Point(48.000, 36.000, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 3
new BezierCurve(
new Point(48.000, 36.000, Point.CARTESIAN),
new Point(72.000, 30.000, Point.CARTESIAN),
new Point(57.000, 24.000, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 4
new BezierLine(
new Point(57.000, 24.000, Point.CARTESIAN),
new Point(10.000, 24.000, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation();
pathChain = builder.build();
this.actionRobot.followPath(this.pathChain);
}