diff --git a/.gitignore b/.gitignore index 60f00ae4..782257ad 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ /build /captures .externalNativeBuild +/node_modules + diff --git a/Path/build.gradle b/Path/build.gradle index ebd8be81..ca0b3c21 100644 --- a/Path/build.gradle +++ b/Path/build.gradle @@ -12,7 +12,7 @@ android { targetSdkVersion 28 } - compileSdkVersion 29 + compileSdkVersion 34 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -31,11 +31,9 @@ dependencies { implementation 'org.apache.commons:commons-math3:3.6.1' - - implementation 'com.acmerobotics.dashboard:dashboard:0.4.15' + implementation 'com.acmerobotics.dashboard:dashboard:0.4.16' implementation 'com.acmerobotics.roadrunner:core:0.5.6' - testImplementation(platform('org.junit:junit-bom:5.7.0')) testImplementation('org.junit.jupiter:junit-jupiter-api:5.7.0') testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.7.0') diff --git a/Path/src/main/java/com/technototes/path/subsystem/PathingMecanumDrivebaseSubsystem.java b/Path/src/main/java/com/technototes/path/subsystem/PathingMecanumDrivebaseSubsystem.java index 3b37d94d..d35fe4a2 100644 --- a/Path/src/main/java/com/technototes/path/subsystem/PathingMecanumDrivebaseSubsystem.java +++ b/Path/src/main/java/com/technototes/path/subsystem/PathingMecanumDrivebaseSubsystem.java @@ -26,7 +26,6 @@ import com.technototes.library.hardware.HardwareDevice; import com.technototes.library.hardware.motor.EncodedMotor; import com.technototes.library.hardware.sensor.IGyro; -import com.technototes.library.hardware.sensor.IMU; import com.technototes.library.subsystem.Subsystem; import com.technototes.path.subsystem.MecanumConstants.GearRatio; import com.technototes.path.subsystem.MecanumConstants.HeadPID; diff --git a/Path/src/main/java/com/technototes/path/subsystem/TankDrivebaseSubsystem.java b/Path/src/main/java/com/technototes/path/subsystem/TankDrivebaseSubsystem.java index 3c079665..07bee040 100644 --- a/Path/src/main/java/com/technototes/path/subsystem/TankDrivebaseSubsystem.java +++ b/Path/src/main/java/com/technototes/path/subsystem/TankDrivebaseSubsystem.java @@ -23,7 +23,7 @@ import com.qualcomm.robotcore.hardware.VoltageSensor; import com.technototes.library.hardware.HardwareDevice; import com.technototes.library.hardware.motor.EncodedMotor; -import com.technototes.library.hardware.sensor.IMU; +import com.technototes.library.hardware.sensor.IGyro; import com.technototes.library.subsystem.Subsystem; import com.technototes.path.subsystem.TankConstants.*; import com.technototes.path.trajectorysequence.TrajectorySequence; @@ -59,14 +59,14 @@ public class TankDrivebaseSubsystem extends TankDrive implements Subsystem { private TrajectoryFollower follower; private List> motors, leftMotors, rightMotors; - private IMU imu; + private IGyro imu; private VoltageSensor batteryVoltageSensor; public TankDrivebaseSubsystem( List> left, List> right, - IMU i, + IGyro i, TankConstants c, Localizer localizer ) { @@ -300,7 +300,7 @@ public void setMotorPowers(double v, double v1) { @Override public double getRawExternalHeading() { - return imu.getAngularOrientation(AngleUnit.RADIANS).firstAngle; + return imu.getHeading(); } @Override diff --git a/Path/src/main/java/com/technototes/path/subsystem/TwoDeadWheelLocalizer.java b/Path/src/main/java/com/technototes/path/subsystem/TwoDeadWheelLocalizer.java index 5d91cf70..1431d9ba 100644 --- a/Path/src/main/java/com/technototes/path/subsystem/TwoDeadWheelLocalizer.java +++ b/Path/src/main/java/com/technototes/path/subsystem/TwoDeadWheelLocalizer.java @@ -9,9 +9,8 @@ import androidx.annotation.NonNull; import com.acmerobotics.roadrunner.geometry.Pose2d; -import com.acmerobotics.roadrunner.localization.ThreeTrackingWheelLocalizer; import com.acmerobotics.roadrunner.localization.TwoTrackingWheelLocalizer; -import com.technototes.library.hardware.sensor.IMU; +import com.technototes.library.hardware.sensor.IGyro; import com.technototes.library.hardware.sensor.encoder.MotorEncoder; import com.technototes.library.subsystem.Subsystem; import java.util.Arrays; @@ -40,7 +39,7 @@ public class TwoDeadWheelLocalizer extends TwoTrackingWheelLocalizer implements protected boolean encoderOverflow; - public TwoDeadWheelLocalizer(IMU imu, MotorEncoder lr, MotorEncoder fb, DeadWheelConstants constants) { + public TwoDeadWheelLocalizer(IGyro imu, MotorEncoder lr, MotorEncoder fb, DeadWheelConstants constants) { super( Arrays.asList( new Pose2d(0, constants.getDouble(LateralDistance.class), 0), // left diff --git a/RobotLibrary/build.gradle b/RobotLibrary/build.gradle index 37579291..66d2bb2d 100644 --- a/RobotLibrary/build.gradle +++ b/RobotLibrary/build.gradle @@ -12,7 +12,7 @@ android { targetSdkVersion 28 } - compileSdkVersion 29 + compileSdkVersion 34 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/RobotLibrary/src/main/java/com/technototes/library/command/CycleCommandGroup.java b/RobotLibrary/src/main/java/com/technototes/library/command/CycleCommandGroup.java new file mode 100644 index 00000000..23b1f45e --- /dev/null +++ b/RobotLibrary/src/main/java/com/technototes/library/command/CycleCommandGroup.java @@ -0,0 +1,25 @@ +package com.technototes.library.command; + +/** + * Each time this command(group) is scheduled, the next one + * in the series will execute. When the last one is executed, + * it starts over at the first one. + * + * The most obvious application is for "toggle" command: + * something like this: + * clawToggle = new CycleCommandGroup(claw::open, claw::close); + */ +public class CycleCommandGroup implements Command { + protected Command[] commands; + protected int currentState = 0; + + public CycleCommandGroup(Command... commands) { + assert commands.length > 0; + this.commands = commands; + } + + public void execute() { + commands[currentState].run(); + currentState = (currentState + 1) % commands.length; + } +} diff --git a/RobotLibrary/src/main/java/com/technototes/library/command/LinearRangeCommand.java b/RobotLibrary/src/main/java/com/technototes/library/command/LinearRangeCommand.java new file mode 100644 index 00000000..5fdf83ba --- /dev/null +++ b/RobotLibrary/src/main/java/com/technototes/library/command/LinearRangeCommand.java @@ -0,0 +1,25 @@ +package com.technototes.library.command; + +import java.util.function.Consumer; + +public class LinearRangeCommand extends TimedCommand { + double startVal, endVal; + + public LinearRangeCommand(double time, double start, double end, Consumer func) { + super(time, func); + startVal = start; + endVal = end; + } + + @Override + public void execute() { + // Being explicitly pedantic about pre-algebra, here... + double M = (endVal - startVal) / startVal; + double X = getRuntime().time(); + double B = startVal; + + double Y = M * X + B; + + function.accept(Y); + } +} diff --git a/RobotLibrary/src/main/java/com/technototes/library/command/TimedCommand.java b/RobotLibrary/src/main/java/com/technototes/library/command/TimedCommand.java new file mode 100644 index 00000000..c71c7c9a --- /dev/null +++ b/RobotLibrary/src/main/java/com/technototes/library/command/TimedCommand.java @@ -0,0 +1,18 @@ +package com.technototes.library.command; + +import java.util.function.Consumer; + +public class TimedCommand extends WaitCommand { + protected double timeToRun; + protected Consumer function; + + public TimedCommand(double time, Consumer func){ + super(time); + function = func; + } + + @Override + public void execute() { + function.accept(getRuntime().time()); + } +} diff --git a/Vision/build.gradle b/Vision/build.gradle index ba187bd3..3e1bee16 100644 --- a/Vision/build.gradle +++ b/Vision/build.gradle @@ -12,7 +12,7 @@ android { targetSdkVersion 28 } - compileSdkVersion 29 + compileSdkVersion 34 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/build.dependencies.gradle b/build.dependencies.gradle index c5b19d4c..33b7894e 100644 --- a/build.dependencies.gradle +++ b/build.dependencies.gradle @@ -6,9 +6,9 @@ repositories { } dependencies { - implementation 'org.firstinspires.ftc:RobotCore:10.1.0' - implementation 'org.firstinspires.ftc:RobotServer:10.1.0' - implementation 'org.firstinspires.ftc:Hardware:10.1.0' - implementation 'org.firstinspires.ftc:FtcCommon:10.1.0' + implementation 'org.firstinspires.ftc:RobotCore:11.0.0' + implementation 'org.firstinspires.ftc:RobotServer:11.0.0' + implementation 'org.firstinspires.ftc:Hardware:11.0.0' + implementation 'org.firstinspires.ftc:FtcCommon:11.0.0' implementation 'androidx.appcompat:appcompat:1.3.1' } diff --git a/build.gradle b/build.gradle index f2d3b11e..8904ce4f 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.0' + classpath 'com.android.tools.build:gradle:8.11.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/bun.lockb b/bun.lockb index 95520927..855b4f81 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/gradle.properties b/gradle.properties index 1e0c1d3b..77487195 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,19 +1,16 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit +## For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html - +# # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx1024m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +# +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. For more details, visit +# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects +# org.gradle.parallel=true +#Sun Jul 27 08:41:53 PDT 2025 android.enableJetifier=true android.useAndroidX=true -org.gradle.jvmargs=-Xmx1536m - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true \ No newline at end of file +org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c658c7db..ad069290 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue Sep 27 22:08:26 PDT 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/package.json b/package.json index 8d83ff2d..5696321e 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "os": "bun run scripts/os.ts" }, "devDependencies": { - "@freik/workspace": "^0.6.4", + "@freik/workspace": "^0.6.5", "prettier": "3.3.3", "prettier-plugin-java": "2.6.4" },