even more updates

This commit is contained in:
2025-10-11 22:03:40 -05:00
parent aea3f0b2d4
commit 458b6f53a2
12 changed files with 46 additions and 15 deletions

View File

@@ -1,4 +0,0 @@
package org.firstinspires.ftc.teamcode.constants;
public class blank {
}

View File

@@ -1,5 +1,6 @@
package org.firstinspires.ftc.teamcode.libs.RR; package org.firstinspires.ftc.teamcode.libs.RR;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.acmerobotics.dashboard.canvas.Canvas; import com.acmerobotics.dashboard.canvas.Canvas;
@@ -211,6 +212,7 @@ public final class MecanumDrive {
headingDelta headingDelta
)); ));
return twist.velocity().value(); return twist.velocity().value();
} }
} }
@@ -222,7 +224,7 @@ public final class MecanumDrive {
module.setBulkCachingMode(LynxModule.BulkCachingMode.AUTO); module.setBulkCachingMode(LynxModule.BulkCachingMode.AUTO);
} }
// TODO: make sure your config has motors with these names (or change them) // TODO: make sure your HardwareConfig has motors with these names (or change them)
// see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html // see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html
leftFront = hardwareMap.get(DcMotorEx.class, "leftFront"); leftFront = hardwareMap.get(DcMotorEx.class, "leftFront");
leftBack = hardwareMap.get(DcMotorEx.class, "leftBack"); leftBack = hardwareMap.get(DcMotorEx.class, "leftBack");
@@ -237,7 +239,7 @@ public final class MecanumDrive {
// TODO: reverse motor directions if needed // TODO: reverse motor directions if needed
// leftFront.setDirection(DcMotorSimple.Direction.REVERSE); // leftFront.setDirection(DcMotorSimple.Direction.REVERSE);
// TODO: make sure your config has an IMU with this name (can be BNO or BHI) // TODO: make sure your HardwareConfig has an IMU with this name (can be BNO or BHI)
// see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html // see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html
lazyImu = new LazyHardwareMapImu(hardwareMap, "imu", new RevHubOrientationOnRobot( lazyImu = new LazyHardwareMapImu(hardwareMap, "imu", new RevHubOrientationOnRobot(
PARAMS.logoFacingDirection, PARAMS.usbFacingDirection)); PARAMS.logoFacingDirection, PARAMS.usbFacingDirection));

View File

@@ -28,7 +28,7 @@ public class OTOSLocalizer implements Localizer {
private Pose2d currentPose; private Pose2d currentPose;
public OTOSLocalizer(HardwareMap hardwareMap, Pose2d initialPose) { public OTOSLocalizer(HardwareMap hardwareMap, Pose2d initialPose) {
// TODO: make sure your config has an OTOS device with this name // TODO: make sure your HardwareConfig has an OTOS device with this name
// see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html // see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html
otos = hardwareMap.get(SparkFunOTOS.class, "sensor_otos"); otos = hardwareMap.get(SparkFunOTOS.class, "sensor_otos");
currentPose = initialPose; currentPose = initialPose;

View File

@@ -29,7 +29,7 @@ public final class PinpointLocalizer implements Localizer {
private Pose2d txPinpointRobot = new Pose2d(0, 0, 0); private Pose2d txPinpointRobot = new Pose2d(0, 0, 0);
public PinpointLocalizer(HardwareMap hardwareMap, double inPerTick, Pose2d initialPose) { public PinpointLocalizer(HardwareMap hardwareMap, double inPerTick, Pose2d initialPose) {
// TODO: make sure your config has a Pinpoint device with this name // TODO: make sure your HardwareConfig has a Pinpoint device with this name
// see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html // see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html
driver = hardwareMap.get(GoBildaPinpointDriver.class, "pinpoint"); driver = hardwareMap.get(GoBildaPinpointDriver.class, "pinpoint");

View File

@@ -232,7 +232,7 @@ public final class TankDrive {
module.setBulkCachingMode(LynxModule.BulkCachingMode.AUTO); module.setBulkCachingMode(LynxModule.BulkCachingMode.AUTO);
} }
// TODO: make sure your config has motors with these names (or change them) // TODO: make sure your HardwareConfig has motors with these names (or change them)
// add additional motors on each side if you have them // add additional motors on each side if you have them
// see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html // see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html
leftMotors = Arrays.asList(hardwareMap.get(DcMotorEx.class, "left")); leftMotors = Arrays.asList(hardwareMap.get(DcMotorEx.class, "left"));
@@ -248,7 +248,7 @@ public final class TankDrive {
// TODO: reverse motor directions if needed // TODO: reverse motor directions if needed
// leftMotors.get(0).setDirection(DcMotorSimple.Direction.REVERSE); // leftMotors.get(0).setDirection(DcMotorSimple.Direction.REVERSE);
// TODO: make sure your config has an IMU with this name (can be BNO or BHI) // TODO: make sure your HardwareConfig has an IMU with this name (can be BNO or BHI)
// see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html // see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html
lazyImu = new LazyHardwareMapImu(hardwareMap, "imu", new RevHubOrientationOnRobot( lazyImu = new LazyHardwareMapImu(hardwareMap, "imu", new RevHubOrientationOnRobot(
PARAMS.logoFacingDirection, PARAMS.usbFacingDirection)); PARAMS.logoFacingDirection, PARAMS.usbFacingDirection));

View File

@@ -37,7 +37,7 @@ public final class ThreeDeadWheelLocalizer implements Localizer {
private Pose2d pose; private Pose2d pose;
public ThreeDeadWheelLocalizer(HardwareMap hardwareMap, double inPerTick, Pose2d initialPose) { public ThreeDeadWheelLocalizer(HardwareMap hardwareMap, double inPerTick, Pose2d initialPose) {
// TODO: make sure your config has **motors** with these names (or change them) // TODO: make sure your HardwareConfig has **motors** with these names (or change them)
// the encoders should be plugged into the slot matching the named motor // the encoders should be plugged into the slot matching the named motor
// see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html // see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html
par0 = new OverflowEncoder(new RawEncoder(hardwareMap.get(DcMotorEx.class, "par0"))); par0 = new OverflowEncoder(new RawEncoder(hardwareMap.get(DcMotorEx.class, "par0")));

View File

@@ -46,7 +46,7 @@ public final class TwoDeadWheelLocalizer implements Localizer {
private Pose2d pose; private Pose2d pose;
public TwoDeadWheelLocalizer(HardwareMap hardwareMap, IMU imu, double inPerTick, Pose2d initialPose) { public TwoDeadWheelLocalizer(HardwareMap hardwareMap, IMU imu, double inPerTick, Pose2d initialPose) {
// TODO: make sure your config has **motors** with these names (or change them) // TODO: make sure your HardwareConfig has **motors** with these names (or change them)
// the encoders should be plugged into the slot matching the named motor // the encoders should be plugged into the slot matching the named motor
// see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html // see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html
par = new OverflowEncoder(new RawEncoder(hardwareMap.get(DcMotorEx.class, "par"))); par = new OverflowEncoder(new RawEncoder(hardwareMap.get(DcMotorEx.class, "par")));

View File

@@ -6,10 +6,10 @@ import com.acmerobotics.dashboard.telemetry.MultipleTelemetry;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous; import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import org.firstinspires.ftc.teamcode.variables.HardwareConfig;
import org.firstinspires.ftc.teamcode.utils.Robot; import org.firstinspires.ftc.teamcode.utils.Robot;
import org.firstinspires.ftc.teamcode.utils.subsystems.Limelight; import org.firstinspires.ftc.teamcode.utils.subsystems.Limelight;
@Autonomous @Autonomous
@Config @Config
@@ -21,12 +21,21 @@ public class LimelightTest extends LinearOpMode {
MultipleTelemetry TELE; MultipleTelemetry TELE;
Robot robot; Robot robot;
@Override @Override
public void runOpMode() throws InterruptedException { public void runOpMode() throws InterruptedException {
HardwareConfig.USING_LL= true;
robot = new Robot(hardwareMap); robot = new Robot(hardwareMap);
TELE = new MultipleTelemetry(telemetry, FtcDashboard.getInstance().getTelemetry()); TELE = new MultipleTelemetry(telemetry, FtcDashboard.getInstance().getTelemetry());
@@ -51,6 +60,7 @@ public class LimelightTest extends LinearOpMode {
TELE.update(); TELE.update();
} }
} }

View File

@@ -1,7 +1,10 @@
package org.firstinspires.ftc.teamcode.utils; package org.firstinspires.ftc.teamcode.utils;
import static org.firstinspires.ftc.teamcode.variables.HardwareConfig.*;
import com.qualcomm.hardware.limelightvision.Limelight3A; import com.qualcomm.hardware.limelightvision.Limelight3A;
import com.qualcomm.robotcore.hardware.HardwareMap; import com.qualcomm.robotcore.hardware.HardwareMap;
import com.qualcomm.robotcore.hardware.IMU;
public class Robot { public class Robot {
@@ -15,5 +18,12 @@ public class Robot {
limelight3A = hardwareMap.get(Limelight3A.class, "limelight"); limelight3A = hardwareMap.get(Limelight3A.class, "limelight");
if (USING_LL) {
limelight3A = hardwareMap.get(Limelight3A.class, "limelight");
limelight3A.start(); // This tells Limelight to start looking!
}
} }
} }

View File

@@ -1,4 +1,8 @@
package org.firstinspires.ftc.teamcode.utils.functions; package org.firstinspires.ftc.teamcode.utils.functions;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
public class DistanceToTarget { public class DistanceToTarget {
} }

View File

@@ -11,6 +11,7 @@ import org.firstinspires.ftc.robotcore.external.navigation.AngleUnit;
import org.firstinspires.ftc.robotcore.external.navigation.Pose3D; import org.firstinspires.ftc.robotcore.external.navigation.Pose3D;
import org.firstinspires.ftc.robotcore.external.navigation.Position; import org.firstinspires.ftc.robotcore.external.navigation.Position;
import org.firstinspires.ftc.robotcore.external.navigation.YawPitchRollAngles; import org.firstinspires.ftc.robotcore.external.navigation.YawPitchRollAngles;
import org.firstinspires.ftc.teamcode.variables.HardwareConfig;
import org.firstinspires.ftc.teamcode.utils.Robot; import org.firstinspires.ftc.teamcode.utils.Robot;
import org.firstinspires.ftc.teamcode.utils.Subsystem; import org.firstinspires.ftc.teamcode.utils.Subsystem;
@@ -49,6 +50,9 @@ public class Limelight implements Subsystem {
private List<LLResultTypes.ColorResult> colorResults = new ArrayList<>(); private List<LLResultTypes.ColorResult> colorResults = new ArrayList<>();
public Limelight(Robot robot, MultipleTelemetry tele) { public Limelight(Robot robot, MultipleTelemetry tele) {
HardwareConfig.USING_LL= true;
this.limelight = robot.limelight3A; this.limelight = robot.limelight3A;
this.telemetry = tele; this.telemetry = tele;
limelight.pipelineSwitch(1); limelight.pipelineSwitch(1);
@@ -65,6 +69,9 @@ public class Limelight implements Subsystem {
/** ✅ MAIN UPDATE LOOP */ /** ✅ MAIN UPDATE LOOP */
@Override @Override
public void update() { public void update() {
limelight.updateRobotOrientation();
result = limelight.getLatestResult(); result = limelight.getLatestResult();
status = limelight.getStatus(); status = limelight.getStatus();

View File

@@ -1,10 +1,12 @@
package org.firstinspires.ftc.teamcode.utils; package org.firstinspires.ftc.teamcode.variables;
import com.acmerobotics.dashboard.config.Config; import com.acmerobotics.dashboard.config.Config;
@Config @Config
public class Vars { public class HardwareConfig {
public static boolean USING_LL = false; public static boolean USING_LL = false;
} }