even more updates
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
package org.firstinspires.ftc.teamcode.constants;
|
||||
|
||||
public class blank {
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.firstinspires.ftc.teamcode.libs.RR;
|
||||
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.acmerobotics.dashboard.canvas.Canvas;
|
||||
@@ -211,6 +212,7 @@ public final class MecanumDrive {
|
||||
headingDelta
|
||||
));
|
||||
|
||||
|
||||
return twist.velocity().value();
|
||||
}
|
||||
}
|
||||
@@ -222,7 +224,7 @@ public final class MecanumDrive {
|
||||
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
|
||||
leftFront = hardwareMap.get(DcMotorEx.class, "leftFront");
|
||||
leftBack = hardwareMap.get(DcMotorEx.class, "leftBack");
|
||||
@@ -237,7 +239,7 @@ public final class MecanumDrive {
|
||||
// TODO: reverse motor directions if needed
|
||||
// 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
|
||||
lazyImu = new LazyHardwareMapImu(hardwareMap, "imu", new RevHubOrientationOnRobot(
|
||||
PARAMS.logoFacingDirection, PARAMS.usbFacingDirection));
|
||||
|
||||
@@ -28,7 +28,7 @@ public class OTOSLocalizer implements Localizer {
|
||||
private Pose2d currentPose;
|
||||
|
||||
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
|
||||
otos = hardwareMap.get(SparkFunOTOS.class, "sensor_otos");
|
||||
currentPose = initialPose;
|
||||
|
||||
@@ -29,7 +29,7 @@ public final class PinpointLocalizer implements Localizer {
|
||||
private Pose2d txPinpointRobot = new Pose2d(0, 0, 0);
|
||||
|
||||
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
|
||||
driver = hardwareMap.get(GoBildaPinpointDriver.class, "pinpoint");
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ public final class TankDrive {
|
||||
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
|
||||
// see https://ftc-docs.firstinspires.org/en/latest/hardware_and_software_configuration/configuring/index.html
|
||||
leftMotors = Arrays.asList(hardwareMap.get(DcMotorEx.class, "left"));
|
||||
@@ -248,7 +248,7 @@ public final class TankDrive {
|
||||
// TODO: reverse motor directions if needed
|
||||
// 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
|
||||
lazyImu = new LazyHardwareMapImu(hardwareMap, "imu", new RevHubOrientationOnRobot(
|
||||
PARAMS.logoFacingDirection, PARAMS.usbFacingDirection));
|
||||
|
||||
@@ -37,7 +37,7 @@ public final class ThreeDeadWheelLocalizer implements Localizer {
|
||||
private Pose2d pose;
|
||||
|
||||
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
|
||||
// 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")));
|
||||
|
||||
@@ -46,7 +46,7 @@ public final class TwoDeadWheelLocalizer implements Localizer {
|
||||
private Pose2d pose;
|
||||
|
||||
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
|
||||
// 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")));
|
||||
|
||||
@@ -6,10 +6,10 @@ import com.acmerobotics.dashboard.telemetry.MultipleTelemetry;
|
||||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
||||
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.subsystems.Limelight;
|
||||
|
||||
|
||||
@Autonomous
|
||||
@Config
|
||||
|
||||
@@ -21,12 +21,21 @@ public class LimelightTest extends LinearOpMode {
|
||||
|
||||
MultipleTelemetry TELE;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Robot robot;
|
||||
|
||||
@Override
|
||||
public void runOpMode() throws InterruptedException {
|
||||
|
||||
|
||||
|
||||
HardwareConfig.USING_LL= true;
|
||||
|
||||
|
||||
robot = new Robot(hardwareMap);
|
||||
|
||||
TELE = new MultipleTelemetry(telemetry, FtcDashboard.getInstance().getTelemetry());
|
||||
@@ -51,6 +60,7 @@ public class LimelightTest extends LinearOpMode {
|
||||
|
||||
TELE.update();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package org.firstinspires.ftc.teamcode.utils;
|
||||
|
||||
import static org.firstinspires.ftc.teamcode.variables.HardwareConfig.*;
|
||||
|
||||
import com.qualcomm.hardware.limelightvision.Limelight3A;
|
||||
import com.qualcomm.robotcore.hardware.HardwareMap;
|
||||
import com.qualcomm.robotcore.hardware.IMU;
|
||||
|
||||
public class Robot {
|
||||
|
||||
@@ -15,5 +18,12 @@ public class Robot {
|
||||
|
||||
limelight3A = hardwareMap.get(Limelight3A.class, "limelight");
|
||||
|
||||
if (USING_LL) {
|
||||
limelight3A = hardwareMap.get(Limelight3A.class, "limelight");
|
||||
limelight3A.start(); // This tells Limelight to start looking!
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
package org.firstinspires.ftc.teamcode.utils.functions;
|
||||
|
||||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
|
||||
|
||||
public class DistanceToTarget {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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.Position;
|
||||
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.Subsystem;
|
||||
|
||||
@@ -49,6 +50,9 @@ public class Limelight implements Subsystem {
|
||||
private List<LLResultTypes.ColorResult> colorResults = new ArrayList<>();
|
||||
|
||||
public Limelight(Robot robot, MultipleTelemetry tele) {
|
||||
|
||||
HardwareConfig.USING_LL= true;
|
||||
|
||||
this.limelight = robot.limelight3A;
|
||||
this.telemetry = tele;
|
||||
limelight.pipelineSwitch(1);
|
||||
@@ -65,6 +69,9 @@ public class Limelight implements Subsystem {
|
||||
/** ✅ MAIN UPDATE LOOP */
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
limelight.updateRobotOrientation();
|
||||
|
||||
result = limelight.getLatestResult();
|
||||
status = limelight.getStatus();
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package org.firstinspires.ftc.teamcode.utils;
|
||||
package org.firstinspires.ftc.teamcode.variables;
|
||||
|
||||
|
||||
import com.acmerobotics.dashboard.config.Config;
|
||||
|
||||
@Config
|
||||
public class Vars {
|
||||
public class HardwareConfig {
|
||||
|
||||
public static boolean USING_LL = false;
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user