From 0e3e6f437a2958ca301ab1de562e324a1b28d831 Mon Sep 17 00:00:00 2001 From: carlos Date: Thu, 5 Dec 2024 15:32:58 -0800 Subject: [PATCH] Updated values --- .../ftc/teamcode/subsystem/AutoLine1.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystem/AutoLine1.java diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystem/AutoLine1.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystem/AutoLine1.java new file mode 100644 index 0000000..c711315 --- /dev/null +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystem/AutoLine1.java @@ -0,0 +1,45 @@ +package org.firstinspires.ftc.teamcode.subsystem; + +import androidx.annotation.NonNull; + +import com.acmerobotics.dashboard.telemetry.TelemetryPacket; +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.BezierLine; +import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathChain; +import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.Point; + + + +/* + AutoLine# - This file does something of a path...... + + */ +public class AutoLine1 implements Action { + + private Follower actionRobot; + private PathChain pathChain; + + private Pose startPose = new Pose(8,65); + + 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) + ) + ).setConstantHeadingInterpolation(Math.toRadians(0)).build(); + this.actionRobot.followPath(this.pathChain); + } + + @Override + public boolean run(@NonNull TelemetryPacket telemetryPacket) { + this.actionRobot.update(); + return this.actionRobot.isBusy(); + } +} +