Skip to content

Commit

Permalink
合并拉取请求 #10
Browse files Browse the repository at this point in the history
修复 roadrunner 的软件包错误,顺便测试基于AndriodStudio的PullRequest
  • Loading branch information
6-BennyLi-9 authored Oct 20, 2024
2 parents 3689abe + afdc852 commit b743970
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.firstinspires.ftc.teamcode.roadrunner.messages;
package org.roadrunner.core.messages;

import com.acmerobotics.roadrunner.PoseVelocity2dDual;
import com.acmerobotics.roadrunner.Time;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.firstinspires.ftc.teamcode.roadrunner.messages;
package org.roadrunner.core.messages;

public final class MecanumCommandMessage {
public long timestamp;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.firstinspires.ftc.teamcode.roadrunner.messages;
package org.roadrunner.core.messages;

import com.acmerobotics.roadrunner.ftc.PositionVelocityPair;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.firstinspires.ftc.teamcode.roadrunner.messages;
package org.roadrunner.core.messages;

import com.acmerobotics.roadrunner.Pose2d;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.firstinspires.ftc.teamcode.roadrunner.messages;
package org.roadrunner.core.messages;

public final class TankCommandMessage {
public long timestamp;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.firstinspires.ftc.teamcode.roadrunner.messages;
package org.roadrunner.core.messages;

import com.acmerobotics.roadrunner.ftc.PositionVelocityPair;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.firstinspires.ftc.teamcode.roadrunner.messages;
package org.roadrunner.core.messages;

import com.acmerobotics.roadrunner.ftc.PositionVelocityPair;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.firstinspires.ftc.teamcode.roadrunner.messages;
package org.roadrunner.core.messages;

import com.acmerobotics.roadrunner.ftc.PositionVelocityPair;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.firstinspires.ftc.teamcode.roadrunner.tuning;
package org.roadrunner.core.tuning;

import com.acmerobotics.dashboard.FtcDashboard;
import com.acmerobotics.dashboard.telemetry.MultipleTelemetry;
Expand All @@ -8,9 +8,9 @@
import com.acmerobotics.roadrunner.Vector2d;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;

import org.firstinspires.ftc.teamcode.roadrunner.Drawing;
import org.firstinspires.ftc.teamcode.roadrunner.MecanumDrive;
import org.firstinspires.ftc.teamcode.roadrunner.TankDrive;
import org.roadrunner.core.Drawing;
import org.roadrunner.core.MecanumDrive;
import org.roadrunner.core.TankDrive;

public class LocalizationTest extends LinearOpMode {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
package org.firstinspires.ftc.teamcode.roadrunner.tuning;
package org.roadrunner.core.tuning;

import androidx.annotation.NonNull;

import com.acmerobotics.roadrunner.Pose2d;
import com.acmerobotics.roadrunner.ftc.Actions;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;

import org.firstinspires.ftc.teamcode.roadrunner.MecanumDrive;
import org.firstinspires.ftc.teamcode.roadrunner.TankDrive;
import org.firstinspires.ftc.teamcode.roadrunner.ThreeDeadWheelLocalizer;
import org.firstinspires.ftc.teamcode.roadrunner.TwoDeadWheelLocalizer;
import org.roadrunner.core.MecanumDrive;
import org.roadrunner.core.TankDrive;
import org.roadrunner.core.ThreeDeadWheelLocalizer;
import org.roadrunner.core.TwoDeadWheelLocalizer;

public final class ManualFeedbackTuner extends LinearOpMode {
public static double DISTANCE = 64;

@Override
public void runOpMode() throws InterruptedException {
if (TuningOpModes.DRIVE_CLASS.equals(MecanumDrive.class)) {
MecanumDrive drive = new MecanumDrive(hardwareMap, new Pose2d(0, 0, 0));

if (drive.localizer instanceof TwoDeadWheelLocalizer) {
if (TwoDeadWheelLocalizer.PARAMS.perpXTicks == 0 && TwoDeadWheelLocalizer.PARAMS.parYTicks == 0) {
throw new RuntimeException("Odometry wheel locations not set! Run AngularRampLogger to tune them.");
}
} else if (drive.localizer instanceof ThreeDeadWheelLocalizer) {
if (ThreeDeadWheelLocalizer.PARAMS.perpXTicks == 0 && ThreeDeadWheelLocalizer.PARAMS.par0YTicks == 0 && ThreeDeadWheelLocalizer.PARAMS.par1YTicks == 1) {
throw new RuntimeException("Odometry wheel locations not set! Run AngularRampLogger to tune them.");
}
}
MecanumDrive drive = getMecanumDrive();
waitForStart();

while (opModeIsActive()) {
Expand All @@ -36,17 +28,7 @@ public void runOpMode() throws InterruptedException {
.build());
}
} else if (TuningOpModes.DRIVE_CLASS.equals(TankDrive.class)) {
TankDrive drive = new TankDrive(hardwareMap, new Pose2d(0, 0, 0));

if (drive.localizer instanceof TwoDeadWheelLocalizer) {
if (TwoDeadWheelLocalizer.PARAMS.perpXTicks == 0 && TwoDeadWheelLocalizer.PARAMS.parYTicks == 0) {
throw new RuntimeException("Odometry wheel locations not set! Run AngularRampLogger to tune them.");
}
} else if (drive.localizer instanceof ThreeDeadWheelLocalizer) {
if (ThreeDeadWheelLocalizer.PARAMS.perpXTicks == 0 && ThreeDeadWheelLocalizer.PARAMS.par0YTicks == 0 && ThreeDeadWheelLocalizer.PARAMS.par1YTicks == 1) {
throw new RuntimeException("Odometry wheel locations not set! Run AngularRampLogger to tune them.");
}
}
TankDrive drive = getTankDrive();
waitForStart();

while (opModeIsActive()) {
Expand All @@ -60,4 +42,34 @@ public void runOpMode() throws InterruptedException {
throw new RuntimeException();
}
}

private @NonNull MecanumDrive getMecanumDrive() {
MecanumDrive drive = new MecanumDrive(hardwareMap, new Pose2d(0, 0, 0));

if (drive.localizer instanceof TwoDeadWheelLocalizer) {
if (TwoDeadWheelLocalizer.PARAMS.perpXTicks == 0 && TwoDeadWheelLocalizer.PARAMS.parYTicks == 0) {
throw new RuntimeException("Odometry wheel locations not set! Run AngularRampLogger to tune them.");
}
} else if (drive.localizer instanceof ThreeDeadWheelLocalizer) {
if (ThreeDeadWheelLocalizer.PARAMS.perpXTicks == 0 && ThreeDeadWheelLocalizer.PARAMS.par0YTicks == 0 && ThreeDeadWheelLocalizer.PARAMS.par1YTicks == 1) {
throw new RuntimeException("Odometry wheel locations not set! Run AngularRampLogger to tune them.");
}
}
return drive;
}

private @NonNull TankDrive getTankDrive() {
TankDrive drive = new TankDrive(hardwareMap, new Pose2d(0, 0, 0));

if (drive.localizer instanceof TwoDeadWheelLocalizer) {
if (TwoDeadWheelLocalizer.PARAMS.perpXTicks == 0 && TwoDeadWheelLocalizer.PARAMS.parYTicks == 0) {
throw new RuntimeException("Odometry wheel locations not set! Run AngularRampLogger to tune them.");
}
} else if (drive.localizer instanceof ThreeDeadWheelLocalizer) {
if (ThreeDeadWheelLocalizer.PARAMS.perpXTicks == 0 && ThreeDeadWheelLocalizer.PARAMS.par0YTicks == 0 && ThreeDeadWheelLocalizer.PARAMS.par1YTicks == 1) {
throw new RuntimeException("Odometry wheel locations not set! Run AngularRampLogger to tune them.");
}
}
return drive;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.firstinspires.ftc.teamcode.roadrunner.tuning;
package org.roadrunner.core.tuning;

import com.acmerobotics.roadrunner.Pose2d;
import com.acmerobotics.roadrunner.Vector2d;
import com.acmerobotics.roadrunner.ftc.Actions;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;

import org.firstinspires.ftc.teamcode.roadrunner.MecanumDrive;
import org.firstinspires.ftc.teamcode.roadrunner.TankDrive;
import org.roadrunner.core.MecanumDrive;
import org.roadrunner.core.TankDrive;

public final class SplineTest extends LinearOpMode {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.firstinspires.ftc.teamcode.roadrunner.tuning;
package org.roadrunner.core.tuning;

import com.acmerobotics.dashboard.FtcDashboard;
import com.acmerobotics.dashboard.config.reflection.ReflectionConfig;
Expand All @@ -22,10 +22,10 @@
import com.qualcomm.robotcore.eventloop.opmode.OpModeRegistrar;

import org.firstinspires.ftc.robotcore.internal.opmode.OpModeMeta;
import org.firstinspires.ftc.teamcode.roadrunner.MecanumDrive;
import org.firstinspires.ftc.teamcode.roadrunner.TankDrive;
import org.firstinspires.ftc.teamcode.roadrunner.ThreeDeadWheelLocalizer;
import org.firstinspires.ftc.teamcode.roadrunner.TwoDeadWheelLocalizer;
import org.roadrunner.core.MecanumDrive;
import org.roadrunner.core.TankDrive;
import org.roadrunner.core.ThreeDeadWheelLocalizer;
import org.roadrunner.core.TwoDeadWheelLocalizer;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include ':FtcRobotController'
include ':TeamCode'
include ':roadrunnerCores'
include ':FtcTeamCodeSample'

0 comments on commit b743970

Please sign in to comment.