Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复 roadrunner 的软件包错误,顺便测试基于AndriodStudio的PullRequest #10

Merged
merged 3 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
Loading