From 6b35895532d1d597997a8b0f774e13c27b590e21 Mon Sep 17 00:00:00 2001 From: Ryan Brott Date: Sat, 2 Mar 2024 22:56:53 -0800 Subject: [PATCH] Use new params --- TeamCode/build.gradle | 2 ++ .../firstinspires/ftc/teamcode/MecanumDrive.java | 11 ++++++++--- .../org/firstinspires/ftc/teamcode/TankDrive.java | 13 ++++++++++--- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/TeamCode/build.gradle b/TeamCode/build.gradle index b0c4a83f9f10..355a5a309309 100644 --- a/TeamCode/build.gradle +++ b/TeamCode/build.gradle @@ -34,5 +34,7 @@ dependencies { annotationProcessor files('lib/OpModeAnnotationProcessor.jar') implementation "com.acmerobotics.roadrunner:ftc:0.1.13" + implementation "com.acmerobotics.roadrunner:core:1.0.0-beta7" + implementation "com.acmerobotics.roadrunner:actions:1.0.0-beta7" implementation "com.acmerobotics.dashboard:dashboard:0.4.14" } diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MecanumDrive.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MecanumDrive.java index 688e88186d2f..233f653f7650 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MecanumDrive.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MecanumDrive.java @@ -475,10 +475,15 @@ public TrajectoryActionBuilder actionBuilder(Pose2d beginPose) { return new TrajectoryActionBuilder( TurnAction::new, FollowTrajectoryAction::new, - beginPose, 1e-6, 0.0, + new TrajectoryBuilderParams( + 1e-6, + new ProfileParams( + 0.25, 0.1, 1e-2 + ) + ), + beginPose, 0.0, defaultTurnConstraints, - defaultVelConstraint, defaultAccelConstraint, - 0.25, 0.1 + defaultVelConstraint, defaultAccelConstraint ); } } diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TankDrive.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TankDrive.java index c7f0ba23d42a..4f1ade9498b4 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TankDrive.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TankDrive.java @@ -18,12 +18,14 @@ import com.acmerobotics.roadrunner.PoseVelocity2d; import com.acmerobotics.roadrunner.PoseVelocity2dDual; import com.acmerobotics.roadrunner.ProfileAccelConstraint; +import com.acmerobotics.roadrunner.ProfileParams; import com.acmerobotics.roadrunner.RamseteController; import com.acmerobotics.roadrunner.TankKinematics; import com.acmerobotics.roadrunner.Time; import com.acmerobotics.roadrunner.TimeTrajectory; import com.acmerobotics.roadrunner.TimeTurn; import com.acmerobotics.roadrunner.TrajectoryActionBuilder; +import com.acmerobotics.roadrunner.TrajectoryBuilderParams; import com.acmerobotics.roadrunner.TurnConstraints; import com.acmerobotics.roadrunner.Twist2dDual; import com.acmerobotics.roadrunner.Vector2d; @@ -482,10 +484,15 @@ public TrajectoryActionBuilder actionBuilder(Pose2d beginPose) { return new TrajectoryActionBuilder( TurnAction::new, FollowTrajectoryAction::new, - beginPose, 1e-6, 0.0, + new TrajectoryBuilderParams( + 1e-6, + new ProfileParams( + 0.25, 0.1, 1e-2 + ) + ), + beginPose, 0.0, defaultTurnConstraints, - defaultVelConstraint, defaultAccelConstraint, - 0.25, 0.1 + defaultVelConstraint, defaultAccelConstraint ); } }