From 4afbf1656fa77a6d7fc4b3d5ebed8cefa089c933 Mon Sep 17 00:00:00 2001 From: C4llSiqn <83995467+C4llSqin@users.noreply.github.com> Date: Thu, 30 Jan 2025 16:32:45 -0700 Subject: [PATCH] lidar debugging --- src/main/java/frc4388/robot/Constants.java | 2 +- src/main/java/frc4388/robot/commands/LidarAlign.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index 615b8ee..27a0469 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -237,7 +237,7 @@ public final class Constants { public static final Trim X_OFFSET_TRIM = new Trim("X Offset Trim", Double.MAX_VALUE, -Double.MAX_VALUE, 0.05, 0); public static final int LIDAR_DETECT_DISTANCE = 100; // Min distance to detect pole - public static final int LIDAR_DIO_CHANNEL = 0; + public static final int LIDAR_DIO_CHANNEL = 2; public static final int LIDAR_MICROS_TO_CM = 10; public static final int SECONDS_TO_MICROS = 1000000; diff --git a/src/main/java/frc4388/robot/commands/LidarAlign.java b/src/main/java/frc4388/robot/commands/LidarAlign.java index 7f0e528..5ce0a7e 100644 --- a/src/main/java/frc4388/robot/commands/LidarAlign.java +++ b/src/main/java/frc4388/robot/commands/LidarAlign.java @@ -37,7 +37,7 @@ public class LidarAlign extends Command { @Override public void initialize() { this.currentFinderTick = 0; - this.speed = 0.05; // TODO: find good speed for this + this.speed = 0.1; // TODO: find good speed for this this.foundReef = false; this.headedRight = constructedHeadedRight; } @@ -76,10 +76,10 @@ public class LidarAlign extends Command { // Returns true when the command should end. @Override public boolean isFinished() { - if (foundReef && lidar.withinDistance()) { + if (foundReef && lidar.withinDistance()) { // spot on swerveDrive.stopModules(); return true; - } else if (foundReef && !lidar.withinDistance()) { + } else if (foundReef && !lidar.withinDistance()) { // over shot speed = speed / 2; headedRight = !headedRight; currentFinderTick = 0;