Merge remote-tracking branch 'origin/branch-rc-chassis-14493-subsystem-actions' into branch-rc-chassis-14493-subsystem-actions
This commit is contained in:
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,9 @@ import com.acmerobotics.roadrunner.Action;
|
|||||||
|
|
||||||
import org.firstinspires.ftc.teamcode.pedroPathing.follower.Follower;
|
import org.firstinspires.ftc.teamcode.pedroPathing.follower.Follower;
|
||||||
import org.firstinspires.ftc.teamcode.pedroPathing.localization.Pose;
|
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.BezierLine;
|
||||||
|
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathBuilder;
|
||||||
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathChain;
|
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathChain;
|
||||||
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.Point;
|
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.Point;
|
||||||
|
|
||||||
@ -27,12 +29,46 @@ public class AutoLine1 implements Action {
|
|||||||
public AutoLine1(Follower robot) {
|
public AutoLine1(Follower robot) {
|
||||||
this.actionRobot = robot;
|
this.actionRobot = robot;
|
||||||
this.actionRobot.setStartingPose(startPose);
|
this.actionRobot.setStartingPose(startPose);
|
||||||
this.pathChain = actionRobot.pathBuilder().addPath(
|
|
||||||
new BezierLine(
|
PathBuilder builder = new PathBuilder();
|
||||||
new Point(8.000, 65.000, Point.CARTESIAN),
|
builder
|
||||||
new Point(33.000, 65.000, Point.CARTESIAN)
|
.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);
|
this.actionRobot.followPath(this.pathChain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user