From 0db1ccdc53041e60c65328295ee9bbc72a020646 Mon Sep 17 00:00:00 2001 From: 2025246 Date: Fri, 27 Dec 2024 21:41:10 -0600 Subject: [PATCH] Docs here we come! --- TeamCode/src/main/java/baronTest.java | 27 ------------------- .../pedroPathing/constants/FConstants.java | 14 ++++++++-- .../pedroPathing/constants/LConstants.java | 14 +++------- .../automatic/ForwardVelocityTuner.java | 1 + build.dependencies.gradle | 2 +- 5 files changed, 17 insertions(+), 41 deletions(-) delete mode 100644 TeamCode/src/main/java/baronTest.java diff --git a/TeamCode/src/main/java/baronTest.java b/TeamCode/src/main/java/baronTest.java deleted file mode 100644 index 66e16216..00000000 --- a/TeamCode/src/main/java/baronTest.java +++ /dev/null @@ -1,27 +0,0 @@ -import com.pedropathing.follower.Follower; -import com.pedropathing.follower.FollowerConstants; -import com.qualcomm.robotcore.eventloop.opmode.OpMode; -import com.qualcomm.robotcore.eventloop.opmode.TeleOp; - -import pedroPathing.constants.FConstants; -import pedroPathing.constants.LConstants; - -@TeleOp(name = "barontest") -public class baronTest extends OpMode { - @Override - public void init() { - telemetry.addData("Follower Constants Localizer", FollowerConstants.localizers); - telemetry.update(); - } - - @Override - public void start() { - Follower f = new Follower(hardwareMap, FConstants.class, LConstants.class); - } - - @Override - public void loop() { - telemetry.addData("Follower Constants Localizer", FollowerConstants.localizers); - telemetry.update(); - } -} diff --git a/TeamCode/src/main/java/pedroPathing/constants/FConstants.java b/TeamCode/src/main/java/pedroPathing/constants/FConstants.java index 0ce7f415..ff2424b4 100644 --- a/TeamCode/src/main/java/pedroPathing/constants/FConstants.java +++ b/TeamCode/src/main/java/pedroPathing/constants/FConstants.java @@ -1,14 +1,24 @@ package pedroPathing.constants; -import com.acmerobotics.dashboard.config.Config; import com.pedropathing.localization.Localizers; import com.pedropathing.follower.FollowerConstants; +import com.pedropathing.util.CustomPIDFCoefficients; +import com.qualcomm.robotcore.hardware.DcMotorSimple; -@Config public class FConstants { static { FollowerConstants.mass = 5; FollowerConstants.localizers = Localizers.OTOS; FollowerConstants.zeroPowerAccelerationMultiplier = 4; + FollowerConstants.leftFrontMotorDirection = DcMotorSimple.Direction.REVERSE; + FollowerConstants.leftRearMotorDirection = DcMotorSimple.Direction.REVERSE; + FollowerConstants.rightFrontMotorDirection = DcMotorSimple.Direction.FORWARD; + FollowerConstants.rightRearMotorDirection = DcMotorSimple.Direction.FORWARD; + FollowerConstants.xMovement = 57.8741; + FollowerConstants.yMovement = 52.295; + FollowerConstants.forwardZeroPowerAcceleration = -41.278; + FollowerConstants.lateralZeroPowerAcceleration = -59.7819; + FollowerConstants.translationalPIDFCoefficients = new CustomPIDFCoefficients(0.1,0,0.01,0); + FollowerConstants.headingPIDFCoefficients = new CustomPIDFCoefficients(2,0,0.1,0); } } diff --git a/TeamCode/src/main/java/pedroPathing/constants/LConstants.java b/TeamCode/src/main/java/pedroPathing/constants/LConstants.java index 74c0dfaa..5a445956 100644 --- a/TeamCode/src/main/java/pedroPathing/constants/LConstants.java +++ b/TeamCode/src/main/java/pedroPathing/constants/LConstants.java @@ -1,19 +1,11 @@ package pedroPathing.constants; -import android.graphics.Path; - -import com.acmerobotics.dashboard.config.Config; -import com.pedropathing.localization.Encoder; import com.pedropathing.localization.constants.OTOSConstants; +import com.qualcomm.hardware.sparkfun.SparkFunOTOS; - -import org.firstinspires.ftc.robotcore.external.navigation.AngleUnit; -import org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit; -import com.qualcomm.hardware.sparkfun.SparkFunOTOS.Pose2D; - -@Config public class LConstants { static { - OTOSConstants.offset = new Pose2D(3, 2, (3 *Math.PI) / 2); + OTOSConstants.offset = new SparkFunOTOS.Pose2D(3,2,Math.toRadians(270)); + } } diff --git a/TeamCode/src/main/java/pedroPathing/tuners/automatic/ForwardVelocityTuner.java b/TeamCode/src/main/java/pedroPathing/tuners/automatic/ForwardVelocityTuner.java index 29f86f7e..bc985f76 100644 --- a/TeamCode/src/main/java/pedroPathing/tuners/automatic/ForwardVelocityTuner.java +++ b/TeamCode/src/main/java/pedroPathing/tuners/automatic/ForwardVelocityTuner.java @@ -105,6 +105,7 @@ public void init() { telemetryA.addLine("Make sure you have enough room, since the robot has inertia after cutting power."); telemetryA.addLine("After running the distance, the robot will cut power from the drivetrain and display the forward velocity."); telemetryA.addLine("Press CROSS or A on game pad 1 to stop."); + telemetryA.addData("pose", poseUpdater.getPose()); telemetryA.update(); } diff --git a/build.dependencies.gradle b/build.dependencies.gradle index f6946a7f..b8b7b2fc 100644 --- a/build.dependencies.gradle +++ b/build.dependencies.gradle @@ -15,7 +15,7 @@ dependencies { implementation 'org.firstinspires.ftc:Hardware:10.1.1' implementation 'org.firstinspires.ftc:FtcCommon:10.1.1' implementation 'org.firstinspires.ftc:Vision:10.1.1' - implementation 'com.pedropathing:pedro:0.0.1-beta8' + implementation 'com.pedropathing:pedro:0.0.1-beta12' //noinspection GradleDependency implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'com.acmerobotics.dashboard:dashboard:0.4.16'