Merge remote-tracking branch 'origin/branch-silver-14493' into branch-silver-14493

# Conflicts:
#	TeamCode/src/main/java/org/firstinspires/ftc/teamcode/pedroPathing/tuning/FollowerConstants.java
This commit is contained in:
2024-10-21 21:57:45 -07:00
8 changed files with 845 additions and 1 deletions

View File

@ -0,0 +1,107 @@
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.BezierLine;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathBuilder;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.Point;
public class GeneratedPath {
public GeneratedPath() {
PathBuilder builder = new PathBuilder();
builder
.addPath(
// Line 1
new BezierLine(
new Point(9.757, 84.983, Point.CARTESIAN),
new Point(28.573, 76.302, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 2
new BezierLine(
new Point(28.573, 76.302, Point.CARTESIAN),
new Point(36.203, 76.140, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 3
new BezierLine(
new Point(36.203, 76.140, Point.CARTESIAN),
new Point(35.067, 35.716, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 4
new BezierLine(
new Point(35.067, 35.716, Point.CARTESIAN),
new Point(73.705, 34.742, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 5
new BezierLine(
new Point(73.705, 34.742, Point.CARTESIAN),
new Point(73.705, 24.839, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 6
new BezierLine(
new Point(73.705, 24.839, Point.CARTESIAN),
new Point(7.630, 26.462, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 7
new BezierLine(
new Point(7.630, 26.462, Point.CARTESIAN),
new Point(64.126, 22.728, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 8
new BezierLine(
new Point(64.126, 22.728, Point.CARTESIAN),
new Point(63.964, 13.150, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 9
new BezierLine(
new Point(63.964, 13.150, Point.CARTESIAN),
new Point(12.338, 15.260, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 10
new BezierLine(
new Point(12.338, 15.260, Point.CARTESIAN),
new Point(63.802, 13.150, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 11
new BezierLine(
new Point(63.802, 13.150, Point.CARTESIAN),
new Point(63.639, 11.689, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 12
new BezierLine(
new Point(63.639, 11.689, Point.CARTESIAN),
new Point(12.014, 11.689, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation();
}
}

View File

@ -0,0 +1,236 @@
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import org.firstinspires.ftc.robotcore.external.Telemetry;
import org.firstinspires.ftc.teamcode.pedroPathing.follower.Follower;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.BezierLine;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.Path;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathBuilder;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathChain;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.Point;
@Autonomous(name = "bBlueAutoV1", group = "V1")
public class bBlueAutoV1 extends OpMode {
public Telemetry telemetry;
public Follower robot;
public PathChain path;
@Override
public void init() {
robot = new Follower(hardwareMap);
PathBuilder builder = new PathBuilder();
path = builder
.addPath(
// Line 1
new BezierLine(
new Point(9.757, 84.983, Point.CARTESIAN),
new Point(28.573, 76.302, Point.CARTESIAN)
)
)
.addPath(
// Line 2
new BezierLine(
new Point(28.573, 76.302, Point.CARTESIAN),
new Point(36.203, 76.140, Point.CARTESIAN)
)
)
.addPath(
// Line 3
new BezierLine(
new Point(36.203, 76.140, Point.CARTESIAN),
new Point(35.067, 35.716, Point.CARTESIAN)
)
)
.addPath(
// Line 4
new BezierLine(
new Point(35.067, 35.716, Point.CARTESIAN),
new Point(73.705, 34.742, Point.CARTESIAN)
)
)
.addPath(
// Line 5
new BezierLine(
new Point(73.705, 34.742, Point.CARTESIAN),
new Point(73.705, 24.839, Point.CARTESIAN)
)
)
.addPath(
// Line 6
new BezierLine(
new Point(73.705, 24.839, Point.CARTESIAN),
new Point(7.630, 26.462, Point.CARTESIAN)
)
)
.addPath(
// Line 7
new BezierLine(
new Point(7.630, 26.462, Point.CARTESIAN),
new Point(64.126, 22.728, Point.CARTESIAN)
)
)
.addPath(
// Line 8
new BezierLine(
new Point(64.126, 22.728, Point.CARTESIAN),
new Point(63.964, 13.150, Point.CARTESIAN)
)
)
.addPath(
// Line 9
new BezierLine(
new Point(63.964, 13.150, Point.CARTESIAN),
new Point(12.338, 15.260, Point.CARTESIAN)
)
)
.addPath(
// Line 10
new BezierLine(
new Point(12.338, 15.260, Point.CARTESIAN),
new Point(63.802, 13.150, Point.CARTESIAN)
)
)
.addPath(
// Line 11
new BezierLine(
new Point(63.802, 13.150, Point.CARTESIAN),
new Point(63.639, 11.689, Point.CARTESIAN)
)
)
.addPath(
// Line 12
new BezierLine(
new Point(63.639, 11.689, Point.CARTESIAN),
new Point(12.014, 11.689, Point.CARTESIAN)
)
)
.addPath(
// Line 13
new BezierLine(
new Point(12.014, 11.689, Point.CARTESIAN),
new Point(62.665, 30.196, Point.CARTESIAN)
)
)
.addPath(
// Line 14
new BezierLine(
new Point(62.665, 30.196, Point.CARTESIAN),
new Point(13.312, 51.463, Point.CARTESIAN)
)
)
.addPath(
// Line 15
new BezierLine(
new Point(13.312, 51.463, Point.CARTESIAN),
new Point(16.234, 103.738, Point.CARTESIAN)
)
)
.addPath(
// Line 16
new BezierLine(
new Point(16.234, 103.738, Point.CARTESIAN),
new Point(68.023, 108.284, Point.CARTESIAN)
)
)
.addPath(
// Line 17
new BezierLine(
new Point(68.023, 108.284, Point.CARTESIAN),
new Point(68.185, 121.109, Point.CARTESIAN)
)
)
.addPath(
// Line 18
new BezierLine(
new Point(68.185, 121.109, Point.CARTESIAN),
new Point(21.754, 119.811, Point.CARTESIAN)
)
)
.addPath(
// Line 19
new BezierLine(
new Point(21.754, 119.811, Point.CARTESIAN),
new Point(11.526, 129.227, Point.CARTESIAN)
)
)
.addPath(
// Line 20
new BezierLine(
new Point(11.526, 129.227, Point.CARTESIAN),
new Point(72.568, 111.856, Point.CARTESIAN)
)
)
.addPath(
// Line 21
new BezierLine(
new Point(72.568, 111.856, Point.CARTESIAN),
new Point(58.607, 128.902, Point.CARTESIAN)
)
)
.addPath(
// Line 22
new BezierLine(
new Point(58.607, 128.902, Point.CARTESIAN),
new Point(11.364, 130.850, Point.CARTESIAN)
)
)
.addPath(
// Line 23
new BezierLine(
new Point(11.364, 130.850, Point.CARTESIAN),
new Point(58.931, 128.577, Point.CARTESIAN)
)
)
.addPath(
// Line 24
new BezierLine(
new Point(58.931, 128.577, Point.CARTESIAN),
new Point(58.769, 133.123, Point.CARTESIAN)
)
)
.addPath(
// Line 25
new BezierLine(
new Point(58.769, 133.123, Point.CARTESIAN),
new Point(13.475, 133.935, Point.CARTESIAN)
)
).build();
;
}
@Override
public void loop() {
robot.update();
if (robot.atParametricEnd())
robot.followPath(path);
robot.telemetryDebug(telemetry);
}
}

View File

@ -0,0 +1,8 @@
package nbRedAutoV1;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.BezierLine;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathBuilder;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.Point;
public class Java {
}

View File

@ -0,0 +1,174 @@
package nbRedAutoV1;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.BezierLine;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathBuilder;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.Point;
public class bRedAutoV1 {
public bRedAutoV1() {
PathBuilder builder = new PathBuilder();
builder
.addPath(
// Line 1
new BezierLine(
new Point(133.935, 83.770, Point.CARTESIAN),
new Point(79.874, 117.213, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 2
new BezierLine(
new Point(79.874, 117.213, Point.CARTESIAN),
new Point(79.874, 120.785, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 3
new BezierLine(
new Point(79.874, 120.785, Point.CARTESIAN),
new Point(131.824, 118.349, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 4
new BezierLine(
new Point(131.824, 118.349, Point.CARTESIAN),
new Point(79.549, 120.460, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 5
new BezierLine(
new Point(79.549, 120.460, Point.CARTESIAN),
new Point(79.549, 128.740, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 6
new BezierLine(
new Point(79.549, 128.740, Point.CARTESIAN),
new Point(131.337, 128.090, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 7
new BezierLine(
new Point(131.337, 128.090, Point.CARTESIAN),
new Point(79.549, 128.740, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 8
new BezierLine(
new Point(79.549, 128.740, Point.CARTESIAN),
new Point(79.549, 133.610, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 9
new BezierLine(
new Point(79.549, 133.610, Point.CARTESIAN),
new Point(130.850, 133.285, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 10
new BezierLine(
new Point(130.850, 133.285, Point.CARTESIAN),
new Point(130.201, 36.528, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 11
new BezierLine(
new Point(130.201, 36.528, Point.CARTESIAN),
new Point(84.095, 36.203, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 12
new BezierLine(
new Point(84.095, 36.203, Point.CARTESIAN),
new Point(84.095, 23.378, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 13
new BezierLine(
new Point(84.095, 23.378, Point.CARTESIAN),
new Point(119.811, 23.378, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 14
new BezierLine(
new Point(119.811, 23.378, Point.CARTESIAN),
new Point(127.603, 13.475, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 15
new BezierLine(
new Point(127.603, 13.475, Point.CARTESIAN),
new Point(88.640, 28.248, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 16
new BezierLine(
new Point(88.640, 28.248, Point.CARTESIAN),
new Point(87.666, 15.910, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 17
new BezierLine(
new Point(87.666, 15.910, Point.CARTESIAN),
new Point(127.603, 12.014, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 18
new BezierLine(
new Point(127.603, 12.014, Point.CARTESIAN),
new Point(86.692, 12.825, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 19
new BezierLine(
new Point(86.692, 12.825, Point.CARTESIAN),
new Point(86.692, 10.390, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 20
new BezierLine(
new Point(86.692, 10.390, Point.CARTESIAN),
new Point(126.467, 9.903, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation();
}
}

View File

@ -0,0 +1,91 @@
package org.firstinspires.ftc.teamcode;
import com.acmerobotics.dashboard.FtcDashboard;
import com.acmerobotics.dashboard.config.Config;
import com.acmerobotics.dashboard.telemetry.MultipleTelemetry;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import org.firstinspires.ftc.robotcore.external.Telemetry;
import org.firstinspires.ftc.teamcode.pedroPathing.follower.Follower;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.BezierCurve;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.BezierLine;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathChain;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.Point;
/**
* This is the Circle autonomous OpMode. It runs the robot in a PathChain that's actually not quite
* a circle, but some Bezier curves that have control points set essentially in a square. However,
* it turns enough to tune your centripetal force correction and some of your heading. Some lag in
* heading is to be expected.
*
* @author Anyi Lin - 10158 Scott's Bots
* @author Aaron Yang - 10158 Scott's Bots
* @author Harrison Womack - 10158 Scott's Bots
* @version 1.0, 3/12/2024
*/
@Config
@Autonomous (name = "Test", group = "Autonomous Pathing Tuning")
public class AutoTest extends OpMode {
private Telemetry telemetryA;
private Follower follower;
private PathChain test;
@Override
public void init() {
follower = new Follower(hardwareMap);
test = follower.pathBuilder()
.addPath(
new BezierLine(
new Point(8.000, 60.000, Point.CARTESIAN),
new Point(18.000, 60.000, Point.CARTESIAN)
)
)
.addPath(
// Line 2
new BezierCurve(
new Point(18.000, 60.000, Point.CARTESIAN),
new Point(18.000, 23.000, Point.CARTESIAN),
new Point(48.000, 23.000, Point.CARTESIAN)
)
)
.addPath(
// Line 3
new BezierLine(
new Point(48.000, 23.000, Point.CARTESIAN),
new Point(60.000, 36.000, Point.CARTESIAN)
)
)
.addPath(
// Line 4
new BezierLine(
new Point(60.000, 36.000, Point.CARTESIAN),
new Point(60.000, 49.000, Point.CARTESIAN)
)
).build();
follower.followPath(test);
telemetryA = new MultipleTelemetry(this.telemetry, FtcDashboard.getInstance().getTelemetry());
telemetryA.update();
}
@Override
public void loop() {
follower.update();
if (follower.atParametricEnd()) {
follower.followPath(test);
}
follower.telemetryDebug(telemetryA);
}
}

View File

@ -0,0 +1,128 @@
package org.firstinspires.ftc.teamcode;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.BezierLine;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathBuilder;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.Point;
public class BlueAuto {
public void GeneratedPath() {
PathBuilder builder = new PathBuilder();
builder
.addPath(
// Line 1
new BezierLine(
new Point(9.757, 84.983, Point.CARTESIAN),
new Point(8.442, 129.227, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 2
new BezierLine(
new Point(8.442, 129.227, Point.CARTESIAN),
new Point(52.762, 101.628, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 3
new BezierLine(
new Point(52.762, 101.628, Point.CARTESIAN),
new Point(79.224, 116.564, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 4
new BezierLine(
new Point(79.224, 116.564, Point.CARTESIAN),
new Point(54.548, 130.525, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 5
new BezierLine(
new Point(54.548, 130.525, Point.CARTESIAN),
new Point(12.338, 133.772, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 6
new BezierLine(
new Point(12.338, 133.772, Point.CARTESIAN),
new Point(52.437, 101.628, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 7
new BezierLine(
new Point(52.437, 101.628, Point.CARTESIAN),
new Point(71.594, 120.947, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 8
new BezierLine(
new Point(71.594, 120.947, Point.CARTESIAN),
new Point(52.275, 120.785, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 9
new BezierLine(
new Point(52.275, 120.785, Point.CARTESIAN),
new Point(11.039, 131.012, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 10
new BezierLine(
new Point(11.039, 131.012, Point.CARTESIAN),
new Point(70.782, 120.460, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 11
new BezierLine(
new Point(70.782, 120.460, Point.CARTESIAN),
new Point(50.327, 142.377, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 12
new BezierLine(
new Point(50.327, 142.377, Point.CARTESIAN),
new Point(13.799, 134.422, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 13
new BezierLine(
new Point(13.799, 134.422, Point.CARTESIAN),
new Point(13.799, 134.422, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 14
new BezierLine(
new Point(13.799, 134.422, Point.CARTESIAN),
new Point(71.919, 103.901, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation();
}
}

View File

@ -0,0 +1,99 @@
package org.firstinspires.ftc.teamcode;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.BezierLine;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.PathBuilder;
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.Point;
public class RedAuto {
public class GeneratedPath {
public GeneratedPath() {
PathBuilder builder = new PathBuilder();
builder
.addPath(
// Line 1
new BezierLine(
new Point(131.499, 58.931, Point.CARTESIAN),
new Point(131.986, 18.183, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 2
new BezierLine(
new Point(131.986, 18.183, Point.CARTESIAN),
new Point(90.264, 40.911, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 3
new BezierLine(
new Point(90.264, 40.911, Point.CARTESIAN),
new Point(83.445, 26.300, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 4
new BezierLine(
new Point(83.445, 26.300, Point.CARTESIAN),
new Point(136.207, 14.286, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 5
new BezierLine(
new Point(136.207, 14.286, Point.CARTESIAN),
new Point(81.497, 24.352, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 6
new BezierLine(
new Point(81.497, 24.352, Point.CARTESIAN),
new Point(82.634, 12.988, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 7
new BezierLine(
new Point(82.634, 12.988, Point.CARTESIAN),
new Point(133.935, 11.364, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 8
new BezierLine(
new Point(133.935, 11.364, Point.CARTESIAN),
new Point(82.309, 11.689, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 9
new BezierLine(
new Point(82.309, 11.689, Point.CARTESIAN),
new Point(83.445, 2.598, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation()
.addPath(
// Line 10
new BezierLine(
new Point(83.445, 2.598, Point.CARTESIAN),
new Point(132.149, 10.390, Point.CARTESIAN)
)
)
.setTangentHeadingInterpolation();
}
}
}

View File

@ -71,7 +71,8 @@ measurements will be in centimeters.
of how fast your robot will coast to a stop. Honestly, this is up to you. I personally used 4, but
what works best for you is most important. Higher numbers will cause a faster brake, but increase
oscillations at the end. Lower numbers will do the opposite. This can be found on line `107` in
`FollowerConstants`, named `zeroPowerAccelerationMultiplier`. The drive PID is much, much more sensitive than the others. For reference,
`FollowerConstants`, named `zeroPowerAccelerationMultiplier`. The drive PID is much, much more
* sensitive than the others. For reference,
my P values were in the hundredths and thousandths place values, and my D values were in the hundred
thousandths and millionths place values. To tune this, enable `useDrive`, `useHeading`, and
`useTranslational` in the `Follower` dropdown in FTC Dashboard. Next, run `StraightBackAndForth`