From 4502b0370c0afe114b6002bb635292bb7a46f34c Mon Sep 17 00:00:00 2001 From: dandeduck Date: Mon, 30 Aug 2021 19:52:05 +0300 Subject: [PATCH 1/8] added un implemented classes --- .project | 28 +++++++++++++++ .settings/org.eclipse.buildship.core.prefs | 13 +++++++ examples/.project | 28 +++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ examples/robot/.project | 28 +++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ examples/robot/basic-robot/.classpath | 12 +++++++ examples/robot/basic-robot/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ examples/robot/basic-trigger/.classpath | 12 +++++++ examples/robot/basic-trigger/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ examples/robot/pnuematics-system/.classpath | 12 +++++++ examples/robot/pnuematics-system/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ .../robot-manual-mode-control/.classpath | 12 +++++++ .../robot/robot-manual-mode-control/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ examples/robot/tankdrive-modes/.classpath | 12 +++++++ examples/robot/tankdrive-modes/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ .../robot/tankdrive-system-custom/.classpath | 12 +++++++ .../robot/tankdrive-system-custom/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ .../robot/tankdrive-system-xbox/.classpath | 12 +++++++ examples/robot/tankdrive-system-xbox/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ examples/robot/tankdrive-system/.classpath | 12 +++++++ examples/robot/tankdrive-system/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ examples/robot/tankdrive/.classpath | 12 +++++++ examples/robot/tankdrive/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ examples/vision/.project | 28 +++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ examples/vision/basic-vision/.classpath | 12 +++++++ examples/vision/basic-vision/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ examples/vision/cv-2020-vision/.classpath | 12 +++++++ examples/vision/cv-2020-vision/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ examples/vision/cv-colorfilter/.classpath | 12 +++++++ examples/vision/cv-colorfilter/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ examples/vision/vision-control/.classpath | 12 +++++++ examples/vision/vision-control/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ .../robot/systems/drive/PidSwerveWheel.java | 22 ++++++++++++ .../systems/drive/SwerveDriveSystem.java | 0 .../robot/systems/drive/SwerveWheel.java | 7 ++++ flashlib.vision.cv/.classpath | 12 +++++++ flashlib.vision.cv/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ .../.settings/org.eclipse.jdt.core.prefs | 4 +++ 54 files changed, 836 insertions(+) create mode 100644 .project create mode 100644 .settings/org.eclipse.buildship.core.prefs create mode 100644 examples/.project create mode 100644 examples/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/robot/.project create mode 100644 examples/robot/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/robot/basic-robot/.classpath create mode 100644 examples/robot/basic-robot/.project create mode 100644 examples/robot/basic-robot/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/robot/basic-trigger/.classpath create mode 100644 examples/robot/basic-trigger/.project create mode 100644 examples/robot/basic-trigger/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/robot/pnuematics-system/.classpath create mode 100644 examples/robot/pnuematics-system/.project create mode 100644 examples/robot/pnuematics-system/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/robot/robot-manual-mode-control/.classpath create mode 100644 examples/robot/robot-manual-mode-control/.project create mode 100644 examples/robot/robot-manual-mode-control/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/robot/tankdrive-modes/.classpath create mode 100644 examples/robot/tankdrive-modes/.project create mode 100644 examples/robot/tankdrive-modes/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/robot/tankdrive-system-custom/.classpath create mode 100644 examples/robot/tankdrive-system-custom/.project create mode 100644 examples/robot/tankdrive-system-custom/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/robot/tankdrive-system-xbox/.classpath create mode 100644 examples/robot/tankdrive-system-xbox/.project create mode 100644 examples/robot/tankdrive-system-xbox/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/robot/tankdrive-system/.classpath create mode 100644 examples/robot/tankdrive-system/.project create mode 100644 examples/robot/tankdrive-system/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/robot/tankdrive/.classpath create mode 100644 examples/robot/tankdrive/.project create mode 100644 examples/robot/tankdrive/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/vision/.project create mode 100644 examples/vision/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/vision/basic-vision/.classpath create mode 100644 examples/vision/basic-vision/.project create mode 100644 examples/vision/basic-vision/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/vision/cv-2020-vision/.classpath create mode 100644 examples/vision/cv-2020-vision/.project create mode 100644 examples/vision/cv-2020-vision/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/vision/cv-colorfilter/.classpath create mode 100644 examples/vision/cv-colorfilter/.project create mode 100644 examples/vision/cv-colorfilter/.settings/org.eclipse.buildship.core.prefs create mode 100644 examples/vision/vision-control/.classpath create mode 100644 examples/vision/vision-control/.project create mode 100644 examples/vision/vision-control/.settings/org.eclipse.buildship.core.prefs create mode 100644 flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java create mode 100644 flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java create mode 100644 flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveWheel.java create mode 100644 flashlib.vision.cv/.classpath create mode 100644 flashlib.vision.cv/.project create mode 100644 flashlib.vision.cv/.settings/org.eclipse.buildship.core.prefs create mode 100644 flashlib.vision.cv/.settings/org.eclipse.jdt.core.prefs diff --git a/.project b/.project new file mode 100644 index 000000000..942d0a243 --- /dev/null +++ b/.project @@ -0,0 +1,28 @@ + + + flashlib + Project FlashLib created by Buildship. + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.buildship.core.gradleprojectnature + + + + 0 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98515123a --- /dev/null +++ b/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,13 @@ +arguments= +auto.sync=false +build.scans.enabled=false +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) +connection.project.dir= +eclipse.preferences.version=1 +gradle.user.home= +java.home=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home +jvm.arguments= +offline.mode=false +override.workspace.settings=true +show.console.view=true +show.executions.view=true diff --git a/examples/.project b/examples/.project new file mode 100644 index 000000000..221b96355 --- /dev/null +++ b/examples/.project @@ -0,0 +1,28 @@ + + + examples + Project examples created by Buildship. + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970516 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/.settings/org.eclipse.buildship.core.prefs b/examples/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..b1886adb4 --- /dev/null +++ b/examples/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=.. +eclipse.preferences.version=1 diff --git a/examples/robot/.project b/examples/robot/.project new file mode 100644 index 000000000..c63595136 --- /dev/null +++ b/examples/robot/.project @@ -0,0 +1,28 @@ + + + robot + Project robot created by Buildship. + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970545 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/robot/.settings/org.eclipse.buildship.core.prefs b/examples/robot/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..62e3e7e80 --- /dev/null +++ b/examples/robot/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../.. +eclipse.preferences.version=1 diff --git a/examples/robot/basic-robot/.classpath b/examples/robot/basic-robot/.classpath new file mode 100644 index 000000000..e16509f76 --- /dev/null +++ b/examples/robot/basic-robot/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/examples/robot/basic-robot/.project b/examples/robot/basic-robot/.project new file mode 100644 index 000000000..45634bf52 --- /dev/null +++ b/examples/robot/basic-robot/.project @@ -0,0 +1,34 @@ + + + basic-robot + Project basic-robot created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970497 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/robot/basic-robot/.settings/org.eclipse.buildship.core.prefs b/examples/robot/basic-robot/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98da5219f --- /dev/null +++ b/examples/robot/basic-robot/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../.. +eclipse.preferences.version=1 diff --git a/examples/robot/basic-trigger/.classpath b/examples/robot/basic-trigger/.classpath new file mode 100644 index 000000000..e16509f76 --- /dev/null +++ b/examples/robot/basic-trigger/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/examples/robot/basic-trigger/.project b/examples/robot/basic-trigger/.project new file mode 100644 index 000000000..8057b846d --- /dev/null +++ b/examples/robot/basic-trigger/.project @@ -0,0 +1,34 @@ + + + basic-trigger + Project basic-trigger created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970503 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/robot/basic-trigger/.settings/org.eclipse.buildship.core.prefs b/examples/robot/basic-trigger/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98da5219f --- /dev/null +++ b/examples/robot/basic-trigger/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../.. +eclipse.preferences.version=1 diff --git a/examples/robot/pnuematics-system/.classpath b/examples/robot/pnuematics-system/.classpath new file mode 100644 index 000000000..e16509f76 --- /dev/null +++ b/examples/robot/pnuematics-system/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/examples/robot/pnuematics-system/.project b/examples/robot/pnuematics-system/.project new file mode 100644 index 000000000..67d4ab04f --- /dev/null +++ b/examples/robot/pnuematics-system/.project @@ -0,0 +1,34 @@ + + + pnuematics-system + Project pnuematics-system created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970540 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/robot/pnuematics-system/.settings/org.eclipse.buildship.core.prefs b/examples/robot/pnuematics-system/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98da5219f --- /dev/null +++ b/examples/robot/pnuematics-system/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../.. +eclipse.preferences.version=1 diff --git a/examples/robot/robot-manual-mode-control/.classpath b/examples/robot/robot-manual-mode-control/.classpath new file mode 100644 index 000000000..e16509f76 --- /dev/null +++ b/examples/robot/robot-manual-mode-control/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/examples/robot/robot-manual-mode-control/.project b/examples/robot/robot-manual-mode-control/.project new file mode 100644 index 000000000..fd7ba89bc --- /dev/null +++ b/examples/robot/robot-manual-mode-control/.project @@ -0,0 +1,34 @@ + + + robot-manual-mode-control + Project robot-manual-mode-control created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970546 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/robot/robot-manual-mode-control/.settings/org.eclipse.buildship.core.prefs b/examples/robot/robot-manual-mode-control/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98da5219f --- /dev/null +++ b/examples/robot/robot-manual-mode-control/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../.. +eclipse.preferences.version=1 diff --git a/examples/robot/tankdrive-modes/.classpath b/examples/robot/tankdrive-modes/.classpath new file mode 100644 index 000000000..e16509f76 --- /dev/null +++ b/examples/robot/tankdrive-modes/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/examples/robot/tankdrive-modes/.project b/examples/robot/tankdrive-modes/.project new file mode 100644 index 000000000..5548d5427 --- /dev/null +++ b/examples/robot/tankdrive-modes/.project @@ -0,0 +1,34 @@ + + + tankdrive-modes + Project tankdrive-modes created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970549 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/robot/tankdrive-modes/.settings/org.eclipse.buildship.core.prefs b/examples/robot/tankdrive-modes/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98da5219f --- /dev/null +++ b/examples/robot/tankdrive-modes/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../.. +eclipse.preferences.version=1 diff --git a/examples/robot/tankdrive-system-custom/.classpath b/examples/robot/tankdrive-system-custom/.classpath new file mode 100644 index 000000000..e16509f76 --- /dev/null +++ b/examples/robot/tankdrive-system-custom/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/examples/robot/tankdrive-system-custom/.project b/examples/robot/tankdrive-system-custom/.project new file mode 100644 index 000000000..6fbeb1ee9 --- /dev/null +++ b/examples/robot/tankdrive-system-custom/.project @@ -0,0 +1,34 @@ + + + tankdrive-system-custom + Project tankdrive-system-custom created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970551 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/robot/tankdrive-system-custom/.settings/org.eclipse.buildship.core.prefs b/examples/robot/tankdrive-system-custom/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98da5219f --- /dev/null +++ b/examples/robot/tankdrive-system-custom/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../.. +eclipse.preferences.version=1 diff --git a/examples/robot/tankdrive-system-xbox/.classpath b/examples/robot/tankdrive-system-xbox/.classpath new file mode 100644 index 000000000..e16509f76 --- /dev/null +++ b/examples/robot/tankdrive-system-xbox/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/examples/robot/tankdrive-system-xbox/.project b/examples/robot/tankdrive-system-xbox/.project new file mode 100644 index 000000000..a84fe6693 --- /dev/null +++ b/examples/robot/tankdrive-system-xbox/.project @@ -0,0 +1,34 @@ + + + tankdrive-system-xbox + Project tankdrive-system-xbox created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970553 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/robot/tankdrive-system-xbox/.settings/org.eclipse.buildship.core.prefs b/examples/robot/tankdrive-system-xbox/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98da5219f --- /dev/null +++ b/examples/robot/tankdrive-system-xbox/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../.. +eclipse.preferences.version=1 diff --git a/examples/robot/tankdrive-system/.classpath b/examples/robot/tankdrive-system/.classpath new file mode 100644 index 000000000..e16509f76 --- /dev/null +++ b/examples/robot/tankdrive-system/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/examples/robot/tankdrive-system/.project b/examples/robot/tankdrive-system/.project new file mode 100644 index 000000000..1b70342ce --- /dev/null +++ b/examples/robot/tankdrive-system/.project @@ -0,0 +1,34 @@ + + + tankdrive-system + Project tankdrive-system created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970550 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/robot/tankdrive-system/.settings/org.eclipse.buildship.core.prefs b/examples/robot/tankdrive-system/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98da5219f --- /dev/null +++ b/examples/robot/tankdrive-system/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../.. +eclipse.preferences.version=1 diff --git a/examples/robot/tankdrive/.classpath b/examples/robot/tankdrive/.classpath new file mode 100644 index 000000000..e16509f76 --- /dev/null +++ b/examples/robot/tankdrive/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/examples/robot/tankdrive/.project b/examples/robot/tankdrive/.project new file mode 100644 index 000000000..2e6ef9b9b --- /dev/null +++ b/examples/robot/tankdrive/.project @@ -0,0 +1,34 @@ + + + tankdrive + Project tankdrive created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970548 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/robot/tankdrive/.settings/org.eclipse.buildship.core.prefs b/examples/robot/tankdrive/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98da5219f --- /dev/null +++ b/examples/robot/tankdrive/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../.. +eclipse.preferences.version=1 diff --git a/examples/vision/.project b/examples/vision/.project new file mode 100644 index 000000000..b5636535d --- /dev/null +++ b/examples/vision/.project @@ -0,0 +1,28 @@ + + + vision + Project vision created by Buildship. + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970556 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/vision/.settings/org.eclipse.buildship.core.prefs b/examples/vision/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..62e3e7e80 --- /dev/null +++ b/examples/vision/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../.. +eclipse.preferences.version=1 diff --git a/examples/vision/basic-vision/.classpath b/examples/vision/basic-vision/.classpath new file mode 100644 index 000000000..e16509f76 --- /dev/null +++ b/examples/vision/basic-vision/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/examples/vision/basic-vision/.project b/examples/vision/basic-vision/.project new file mode 100644 index 000000000..a0cad86a6 --- /dev/null +++ b/examples/vision/basic-vision/.project @@ -0,0 +1,34 @@ + + + basic-vision + Project basic-vision created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970507 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/vision/basic-vision/.settings/org.eclipse.buildship.core.prefs b/examples/vision/basic-vision/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98da5219f --- /dev/null +++ b/examples/vision/basic-vision/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../.. +eclipse.preferences.version=1 diff --git a/examples/vision/cv-2020-vision/.classpath b/examples/vision/cv-2020-vision/.classpath new file mode 100644 index 000000000..e16509f76 --- /dev/null +++ b/examples/vision/cv-2020-vision/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/examples/vision/cv-2020-vision/.project b/examples/vision/cv-2020-vision/.project new file mode 100644 index 000000000..958c65998 --- /dev/null +++ b/examples/vision/cv-2020-vision/.project @@ -0,0 +1,34 @@ + + + cv-2020-vision + Project cv-2020-vision created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970511 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/vision/cv-2020-vision/.settings/org.eclipse.buildship.core.prefs b/examples/vision/cv-2020-vision/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98da5219f --- /dev/null +++ b/examples/vision/cv-2020-vision/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../.. +eclipse.preferences.version=1 diff --git a/examples/vision/cv-colorfilter/.classpath b/examples/vision/cv-colorfilter/.classpath new file mode 100644 index 000000000..e16509f76 --- /dev/null +++ b/examples/vision/cv-colorfilter/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/examples/vision/cv-colorfilter/.project b/examples/vision/cv-colorfilter/.project new file mode 100644 index 000000000..6f8f36a96 --- /dev/null +++ b/examples/vision/cv-colorfilter/.project @@ -0,0 +1,34 @@ + + + cv-colorfilter + Project cv-colorfilter created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970514 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/vision/cv-colorfilter/.settings/org.eclipse.buildship.core.prefs b/examples/vision/cv-colorfilter/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98da5219f --- /dev/null +++ b/examples/vision/cv-colorfilter/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../.. +eclipse.preferences.version=1 diff --git a/examples/vision/vision-control/.classpath b/examples/vision/vision-control/.classpath new file mode 100644 index 000000000..e16509f76 --- /dev/null +++ b/examples/vision/vision-control/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/examples/vision/vision-control/.project b/examples/vision/vision-control/.project new file mode 100644 index 000000000..3628ae3e1 --- /dev/null +++ b/examples/vision/vision-control/.project @@ -0,0 +1,34 @@ + + + vision-control + Project vision-control created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970557 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/examples/vision/vision-control/.settings/org.eclipse.buildship.core.prefs b/examples/vision/vision-control/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..98da5219f --- /dev/null +++ b/examples/vision/vision-control/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=../../.. +eclipse.preferences.version=1 diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java new file mode 100644 index 000000000..db8d347ba --- /dev/null +++ b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java @@ -0,0 +1,22 @@ +package com.flash3388.flashlib.robot.systems.drive; + +public class PidSwerveWheel implements SwerveWheel { + + @Override + public void move(double speed) { + // TODO Auto-generated method stub + + } + + @Override + public void rotate(double speed) { + // TODO Auto-generated method stub + + } + + @Override + public void stop() { + // TODO Auto-generated method stub + + } +} diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java new file mode 100644 index 000000000..e69de29bb diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveWheel.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveWheel.java new file mode 100644 index 000000000..8cbaf9934 --- /dev/null +++ b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveWheel.java @@ -0,0 +1,7 @@ +package com.flash3388.flashlib.robot.systems.drive; + +import com.flash3388.flashlib.robot.motion.Movable; +import com.flash3388.flashlib.robot.motion.Rotatable; + +public interface SwerveWheel extends Movable, Rotatable { +} diff --git a/flashlib.vision.cv/.classpath b/flashlib.vision.cv/.classpath new file mode 100644 index 000000000..3fc9021f9 --- /dev/null +++ b/flashlib.vision.cv/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/flashlib.vision.cv/.project b/flashlib.vision.cv/.project new file mode 100644 index 000000000..315ebc9e3 --- /dev/null +++ b/flashlib.vision.cv/.project @@ -0,0 +1,34 @@ + + + flashlib.vision.cv + Project flashlib.vision.cv created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1630341970538 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/flashlib.vision.cv/.settings/org.eclipse.buildship.core.prefs b/flashlib.vision.cv/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..b1886adb4 --- /dev/null +++ b/flashlib.vision.cv/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=.. +eclipse.preferences.version=1 diff --git a/flashlib.vision.cv/.settings/org.eclipse.jdt.core.prefs b/flashlib.vision.cv/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..35068d95f --- /dev/null +++ b/flashlib.vision.cv/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.source=1.8 From 141858dc463368bf9844dca38b4d362e2012199b Mon Sep 17 00:00:00 2001 From: dandeduck Date: Mon, 30 Aug 2021 20:29:23 +0300 Subject: [PATCH 2/8] implemented pid swerve wheel --- .../robot/systems/drive/PidSwerveWheel.java | 69 ++++++++++++++++--- .../systems/drive/SwerveDriveSystem.java | 36 ++++++++++ .../robot/systems/drive/SwerveWheel.java | 3 +- 3 files changed, 99 insertions(+), 9 deletions(-) diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java index db8d347ba..672e88ef1 100644 --- a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java +++ b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java @@ -1,22 +1,75 @@ package com.flash3388.flashlib.robot.systems.drive; +import java.util.function.DoubleSupplier; +import java.util.function.Supplier; + +import com.flash3388.flashlib.io.devices.SpeedController; +import com.flash3388.flashlib.robot.control.PidController; +import com.flash3388.flashlib.robot.motion.Rotatable; +import com.jmath.ExtendedMath; +import com.jmath.units.Angle; +import com.jmath.units.AngleUnit; +import com.jmath.vectors.Vector2; +import com.jmath.vectors.Vectors; + public class PidSwerveWheel implements SwerveWheel { + private final PidController mPidController; + private final SpeedController mForwardController; + private final SpeedController mRotationController; + private final DoubleSupplier mAngleDegreeSupplier; + + public PidSwerveWheel(PidController pidController, SpeedController forwardController, + SpeedController rotationController, DoubleSupplier angleDegreeSupplier) { + mPidController = pidController; + mForwardController = forwardController; + mRotationController = rotationController; + mAngleDegreeSupplier = angleDegreeSupplier; + + resetPid(); + } + + public PidSwerveWheel(SpeedController forwardController, SpeedController rotationController, + DoubleSupplier angleDegreeSupplier, double kp, double ki, double kd, double kf) { + this(new PidController(kp, kd, kd, kf), forwardController, rotationController, angleDegreeSupplier); + } + + public void resetPid() { + mPidController.reset(); + } + @Override - public void move(double speed) { - // TODO Auto-generated method stub - + public void move(Vector2 motionVector) { + double targetAngle = motionVector.angle(); + double currentAngle = convertAngle(mAngleDegreeSupplier.getAsDouble()); + + double nextAngle = calcNextAngle(targetAngle, currentAngle); + double pidOut = mPidController.applyAsDouble(currentAngle, nextAngle); + + rotate(pidOut); + move(pidOut); } - + @Override public void rotate(double speed) { - // TODO Auto-generated method stub - + mRotationController.set(speed); } @Override public void stop() { - // TODO Auto-generated method stub - + mForwardController.stop(); + mRotationController.stop(); + } + + private double calcNextAngle(double targetAngle, double currentAngle) { + targetAngle = convertAngle(targetAngle); + currentAngle = convertAngle(currentAngle); + double distance = (targetAngle - currentAngle + 180 ) % 360 - 180; + + return currentAngle + distance; + } + + private double convertAngle(double angle) { + return angle < 0 ? 360 + angle : angle; } } diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java index e69de29bb..e51245edd 100644 --- a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java +++ b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java @@ -0,0 +1,36 @@ +package com.flash3388.flashlib.robot.systems.drive; + +import com.jmath.vectors.Vector2; + +public class SwerveDriveSystem implements HolonomicDrive { + @Override + public void stop() { + // TODO Auto-generated method stub + + } + + @Override + public void move(Vector2 motionVector) { + // TODO Auto-generated method stub + + } + + @Override + public void rotate(double speed) { + // TODO Auto-generated method stub + + } + + @Override + public void holonomicPolar(double magnitude, double direction, double rotation) { + // TODO Auto-generated method stub + + } + + @Override + public void holonomicCartesian(double y, double x, double rotation) { + // TODO Auto-generated method stub + + } + +} diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveWheel.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveWheel.java index 8cbaf9934..eddf201ab 100644 --- a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveWheel.java +++ b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveWheel.java @@ -1,7 +1,8 @@ package com.flash3388.flashlib.robot.systems.drive; import com.flash3388.flashlib.robot.motion.Movable; +import com.flash3388.flashlib.robot.motion.Movable2d; import com.flash3388.flashlib.robot.motion.Rotatable; -public interface SwerveWheel extends Movable, Rotatable { +public interface SwerveWheel extends Movable2d, Rotatable { } From 971d84bad28ec9b9d66d265a02ccbaed7ecea70c Mon Sep 17 00:00:00 2001 From: dandeduck Date: Mon, 30 Aug 2021 20:56:26 +0300 Subject: [PATCH 3/8] implemted swerve drive system --- .../systems/drive/DrivetrainProperties.java | 26 +++++++ .../robot/systems/drive/PidSwerveWheel.java | 18 ++--- .../systems/drive/SwerveDriveSystem.java | 74 +++++++++++++++---- 3 files changed, 92 insertions(+), 26 deletions(-) create mode 100644 flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/DrivetrainProperties.java diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/DrivetrainProperties.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/DrivetrainProperties.java new file mode 100644 index 000000000..ba4320b65 --- /dev/null +++ b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/DrivetrainProperties.java @@ -0,0 +1,26 @@ +package com.flash3388.flashlib.robot.systems.drive; + +public class DrivetrainProperties { + private final double mLength; + private final double mWidth; + private final double mDiagonal; + + public DrivetrainProperties(double length, double width) { + mLength = length; + mWidth = width; + + mDiagonal = Math.sqrt(width * width + length * length); + } + + public double getDiagonal() { + return mDiagonal; + } + + public double getWidth() { + return mWidth; + } + + public double getLength() { + return mLength; + } +} diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java index 672e88ef1..9ecd919f1 100644 --- a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java +++ b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java @@ -1,16 +1,10 @@ package com.flash3388.flashlib.robot.systems.drive; import java.util.function.DoubleSupplier; -import java.util.function.Supplier; import com.flash3388.flashlib.io.devices.SpeedController; import com.flash3388.flashlib.robot.control.PidController; -import com.flash3388.flashlib.robot.motion.Rotatable; -import com.jmath.ExtendedMath; -import com.jmath.units.Angle; -import com.jmath.units.AngleUnit; import com.jmath.vectors.Vector2; -import com.jmath.vectors.Vectors; public class PidSwerveWheel implements SwerveWheel { @@ -34,12 +28,18 @@ public PidSwerveWheel(SpeedController forwardController, SpeedController rotatio this(new PidController(kp, kd, kd, kf), forwardController, rotationController, angleDegreeSupplier); } + //this is bad, but I assume there is something built in, so I will wait for the PR on this one + public static double convertAngle(double angle) { + return angle < 0 ? 360 + angle : angle; + } + public void resetPid() { mPidController.reset(); } @Override public void move(Vector2 motionVector) { + double forwardSpeed = motionVector.magnitude(); double targetAngle = motionVector.angle(); double currentAngle = convertAngle(mAngleDegreeSupplier.getAsDouble()); @@ -47,7 +47,7 @@ public void move(Vector2 motionVector) { double pidOut = mPidController.applyAsDouble(currentAngle, nextAngle); rotate(pidOut); - move(pidOut); + move(forwardSpeed); } @Override @@ -68,8 +68,4 @@ private double calcNextAngle(double targetAngle, double currentAngle) { return currentAngle + distance; } - - private double convertAngle(double angle) { - return angle < 0 ? 360 + angle : angle; - } } diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java index e51245edd..5f5a55a2d 100644 --- a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java +++ b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java @@ -3,34 +3,78 @@ import com.jmath.vectors.Vector2; public class SwerveDriveSystem implements HolonomicDrive { - @Override - public void stop() { - // TODO Auto-generated method stub - + + private final DrivetrainProperties mDrivetrain; + private final SwerveWheel mFrontRightWheel; + private final SwerveWheel mFrontLeftWheel; + private final SwerveWheel mRearRightWheel; + private final SwerveWheel mRearLeftWheel; + + public SwerveDriveSystem(DrivetrainProperties drivetrain, SwerveWheel frontRightWheel, + SwerveWheel frontLeftWheel, SwerveWheel rearRightWheel, SwerveWheel rearLeftWheel) { + mDrivetrain = drivetrain; + mFrontRightWheel = frontRightWheel; + mFrontLeftWheel = frontLeftWheel; + mRearRightWheel = rearRightWheel; + mRearLeftWheel = rearLeftWheel; + } + + public SwerveDriveSystem(SwerveWheel frontRightWheel,SwerveWheel frontLeftWheel, + SwerveWheel rearRightWheel, SwerveWheel rearLeftWheel, double drivetrainWidth, + double drivetrainLength) { + this(new DrivetrainProperties(drivetrainWidth, drivetrainLength), + frontRightWheel, frontLeftWheel, rearRightWheel, rearLeftWheel); } + //for user friendlyness + public void drive(double x, double y, double rotation) { + holonomicCartesian(y, x, rotation); + } + @Override public void move(Vector2 motionVector) { - // TODO Auto-generated method stub - + holonomicCartesian(motionVector.y(), motionVector.x(), 0); } - + @Override public void rotate(double speed) { - // TODO Auto-generated method stub - + holonomicCartesian(0, 0, speed); } - + @Override public void holonomicPolar(double magnitude, double direction, double rotation) { - // TODO Auto-generated method stub - + Vector2 motionVector = Vector2.polar(magnitude, direction); + holonomicCartesian(motionVector.y(), motionVector.x(), rotation); } - + @Override - public void holonomicCartesian(double y, double x, double rotation) { - // TODO Auto-generated method stub + public void holonomicCartesian(double y, double x, double rotation) {//maths + double a = x - rotation * (mDrivetrain.getLength() / mDrivetrain.getDiagonal()); + double b = x + rotation * (mDrivetrain.getLength() / mDrivetrain.getDiagonal()); + double c = y - rotation * (mDrivetrain.getWidth() / mDrivetrain.getDiagonal()); + double d = y + rotation * (mDrivetrain.getWidth() / mDrivetrain.getDiagonal()); + + double frontRightSpeed = Math.sqrt((b * b) + (d * d)); + double frontLeftSpeed = Math.sqrt((b * b) + (c * c)); + double rearRightSpeed = Math.sqrt((a * a) + (d * d)); + double rearLeftSpeed = Math.sqrt((a * a) + (c * c)); + + double frontRightAngle = PidSwerveWheel.convertAngle(Math.toDegrees(Math.atan2(b, d))); + double frontLeftAngle = PidSwerveWheel.convertAngle(Math.toDegrees(Math.atan2(b, c))); + double rearRightAngle = PidSwerveWheel.convertAngle(Math.toDegrees(Math.atan2(a, d))); + double rearLeftAngle = PidSwerveWheel.convertAngle(Math.toDegrees(Math.atan2(a, c))); + mFrontRightWheel.move(Vector2.polar(frontRightSpeed, frontRightAngle)); + mFrontLeftWheel.move(Vector2.polar(frontLeftSpeed, frontLeftAngle)); + mRearRightWheel.move(Vector2.polar(rearRightSpeed, rearRightAngle)); + mRearLeftWheel.move(Vector2.polar(rearLeftSpeed, rearLeftAngle)); } + @Override + public void stop() { + mFrontLeftWheel.stop(); + mFrontRightWheel.stop(); + mRearRightWheel.stop(); + mRearLeftWheel.stop(); + } } From c38cef0294417c61fcd54b9f5ac188aafb2785cf Mon Sep 17 00:00:00 2001 From: dandeduck Date: Mon, 30 Aug 2021 21:06:36 +0300 Subject: [PATCH 4/8] Implement Field Centric Drive --- .../robot/systems/drive/SwerveDriveSystem.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java index 5f5a55a2d..be919f0c5 100644 --- a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java +++ b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java @@ -1,8 +1,9 @@ package com.flash3388.flashlib.robot.systems.drive; +import com.flash3388.flashlib.scheduling.Subsystem; import com.jmath.vectors.Vector2; -public class SwerveDriveSystem implements HolonomicDrive { +public class SwerveDriveSystem extends Subsystem implements HolonomicDrive { private final DrivetrainProperties mDrivetrain; private final SwerveWheel mFrontRightWheel; @@ -26,6 +27,14 @@ public SwerveDriveSystem(SwerveWheel frontRightWheel,SwerveWheel frontLeftWheel, frontRightWheel, frontLeftWheel, rearRightWheel, rearLeftWheel); } + public void fieldCentricDrive(double x, double y, double rotation, double gyroDegrees) { //put in another system? with gyro supp? + gyroDegrees = Math.toRadians(gyroDegrees); //hmmmm + rotation = -y * Math.sin(gyroDegrees) + rotation * Math.cos(gyroDegrees); + y = y * Math.cos(gyroDegrees) + rotation * Math.sin(gyroDegrees); + + drive(x, y, rotation); + }//also this needs to be tested... + //for user friendlyness public void drive(double x, double y, double rotation) { holonomicCartesian(y, x, rotation); From 2031ca088a7c7476338ea75c3c1edb5b691be10e Mon Sep 17 00:00:00 2001 From: dandeduck Date: Mon, 30 Aug 2021 21:07:26 +0300 Subject: [PATCH 5/8] lol --- .../flashlib/robot/systems/drive/SwerveDriveSystem.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java index be919f0c5..2c18ac987 100644 --- a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java +++ b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java @@ -27,10 +27,9 @@ public SwerveDriveSystem(SwerveWheel frontRightWheel,SwerveWheel frontLeftWheel, frontRightWheel, frontLeftWheel, rearRightWheel, rearLeftWheel); } - public void fieldCentricDrive(double x, double y, double rotation, double gyroDegrees) { //put in another system? with gyro supp? - gyroDegrees = Math.toRadians(gyroDegrees); //hmmmm - rotation = -y * Math.sin(gyroDegrees) + rotation * Math.cos(gyroDegrees); - y = y * Math.cos(gyroDegrees) + rotation * Math.sin(gyroDegrees); + public void fieldCentricDrive(double x, double y, double rotation, double gyroRadians) { //put in another system? with gyro supp? + rotation = -y * Math.sin(gyroRadians) + rotation * Math.cos(gyroRadians); + y = y * Math.cos(gyroRadians) + rotation * Math.sin(gyroRadians); drive(x, y, rotation); }//also this needs to be tested... From 3057c2e67427afff7bd4513f96ceba676a2abec8 Mon Sep 17 00:00:00 2001 From: dandeduck Date: Thu, 2 Sep 2021 21:10:07 +0300 Subject: [PATCH 6/8] updated gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index ea4719288..ba03f9607 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ /build/ /.idea/ bin/ + +*.project +/.settings/ +*.classpath \ No newline at end of file From 9ca44e3c2fe22b6581ab3feca25b6c5594541454 Mon Sep 17 00:00:00 2001 From: dandeduck Date: Thu, 2 Sep 2021 21:11:37 +0300 Subject: [PATCH 7/8] removed ignored files --- .project | 28 --------------- .settings/org.eclipse.buildship.core.prefs | 13 ------- examples/.project | 28 --------------- examples/robot/.project | 28 --------------- examples/robot/basic-robot/.classpath | 12 ------- examples/robot/basic-robot/.project | 34 ------------------- examples/robot/basic-trigger/.classpath | 12 ------- examples/robot/basic-trigger/.project | 34 ------------------- examples/robot/pnuematics-system/.classpath | 12 ------- examples/robot/pnuematics-system/.project | 34 ------------------- .../robot-manual-mode-control/.classpath | 12 ------- .../robot/robot-manual-mode-control/.project | 34 ------------------- examples/robot/tankdrive-modes/.classpath | 12 ------- examples/robot/tankdrive-modes/.project | 34 ------------------- .../robot/tankdrive-system-custom/.classpath | 12 ------- .../robot/tankdrive-system-custom/.project | 34 ------------------- .../robot/tankdrive-system-xbox/.classpath | 12 ------- examples/robot/tankdrive-system-xbox/.project | 34 ------------------- examples/robot/tankdrive-system/.classpath | 12 ------- examples/robot/tankdrive-system/.project | 34 ------------------- examples/robot/tankdrive/.classpath | 12 ------- examples/robot/tankdrive/.project | 34 ------------------- examples/vision/.project | 28 --------------- examples/vision/basic-vision/.classpath | 12 ------- examples/vision/basic-vision/.project | 34 ------------------- examples/vision/cv-2020-vision/.classpath | 12 ------- examples/vision/cv-2020-vision/.project | 34 ------------------- examples/vision/cv-colorfilter/.classpath | 12 ------- examples/vision/cv-colorfilter/.project | 34 ------------------- examples/vision/vision-control/.classpath | 12 ------- examples/vision/vision-control/.project | 34 ------------------- flashlib.vision.cv/.classpath | 12 ------- flashlib.vision.cv/.project | 34 ------------------- 33 files changed, 769 deletions(-) delete mode 100644 .project delete mode 100644 .settings/org.eclipse.buildship.core.prefs delete mode 100644 examples/.project delete mode 100644 examples/robot/.project delete mode 100644 examples/robot/basic-robot/.classpath delete mode 100644 examples/robot/basic-robot/.project delete mode 100644 examples/robot/basic-trigger/.classpath delete mode 100644 examples/robot/basic-trigger/.project delete mode 100644 examples/robot/pnuematics-system/.classpath delete mode 100644 examples/robot/pnuematics-system/.project delete mode 100644 examples/robot/robot-manual-mode-control/.classpath delete mode 100644 examples/robot/robot-manual-mode-control/.project delete mode 100644 examples/robot/tankdrive-modes/.classpath delete mode 100644 examples/robot/tankdrive-modes/.project delete mode 100644 examples/robot/tankdrive-system-custom/.classpath delete mode 100644 examples/robot/tankdrive-system-custom/.project delete mode 100644 examples/robot/tankdrive-system-xbox/.classpath delete mode 100644 examples/robot/tankdrive-system-xbox/.project delete mode 100644 examples/robot/tankdrive-system/.classpath delete mode 100644 examples/robot/tankdrive-system/.project delete mode 100644 examples/robot/tankdrive/.classpath delete mode 100644 examples/robot/tankdrive/.project delete mode 100644 examples/vision/.project delete mode 100644 examples/vision/basic-vision/.classpath delete mode 100644 examples/vision/basic-vision/.project delete mode 100644 examples/vision/cv-2020-vision/.classpath delete mode 100644 examples/vision/cv-2020-vision/.project delete mode 100644 examples/vision/cv-colorfilter/.classpath delete mode 100644 examples/vision/cv-colorfilter/.project delete mode 100644 examples/vision/vision-control/.classpath delete mode 100644 examples/vision/vision-control/.project delete mode 100644 flashlib.vision.cv/.classpath delete mode 100644 flashlib.vision.cv/.project diff --git a/.project b/.project deleted file mode 100644 index 942d0a243..000000000 --- a/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - flashlib - Project FlashLib created by Buildship. - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.buildship.core.gradleprojectnature - - - - 0 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs deleted file mode 100644 index 98515123a..000000000 --- a/.settings/org.eclipse.buildship.core.prefs +++ /dev/null @@ -1,13 +0,0 @@ -arguments= -auto.sync=false -build.scans.enabled=false -connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) -connection.project.dir= -eclipse.preferences.version=1 -gradle.user.home= -java.home=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home -jvm.arguments= -offline.mode=false -override.workspace.settings=true -show.console.view=true -show.executions.view=true diff --git a/examples/.project b/examples/.project deleted file mode 100644 index 221b96355..000000000 --- a/examples/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - examples - Project examples created by Buildship. - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970516 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/robot/.project b/examples/robot/.project deleted file mode 100644 index c63595136..000000000 --- a/examples/robot/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - robot - Project robot created by Buildship. - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970545 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/robot/basic-robot/.classpath b/examples/robot/basic-robot/.classpath deleted file mode 100644 index e16509f76..000000000 --- a/examples/robot/basic-robot/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/robot/basic-robot/.project b/examples/robot/basic-robot/.project deleted file mode 100644 index 45634bf52..000000000 --- a/examples/robot/basic-robot/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - basic-robot - Project basic-robot created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970497 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/robot/basic-trigger/.classpath b/examples/robot/basic-trigger/.classpath deleted file mode 100644 index e16509f76..000000000 --- a/examples/robot/basic-trigger/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/robot/basic-trigger/.project b/examples/robot/basic-trigger/.project deleted file mode 100644 index 8057b846d..000000000 --- a/examples/robot/basic-trigger/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - basic-trigger - Project basic-trigger created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970503 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/robot/pnuematics-system/.classpath b/examples/robot/pnuematics-system/.classpath deleted file mode 100644 index e16509f76..000000000 --- a/examples/robot/pnuematics-system/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/robot/pnuematics-system/.project b/examples/robot/pnuematics-system/.project deleted file mode 100644 index 67d4ab04f..000000000 --- a/examples/robot/pnuematics-system/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - pnuematics-system - Project pnuematics-system created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970540 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/robot/robot-manual-mode-control/.classpath b/examples/robot/robot-manual-mode-control/.classpath deleted file mode 100644 index e16509f76..000000000 --- a/examples/robot/robot-manual-mode-control/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/robot/robot-manual-mode-control/.project b/examples/robot/robot-manual-mode-control/.project deleted file mode 100644 index fd7ba89bc..000000000 --- a/examples/robot/robot-manual-mode-control/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - robot-manual-mode-control - Project robot-manual-mode-control created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970546 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/robot/tankdrive-modes/.classpath b/examples/robot/tankdrive-modes/.classpath deleted file mode 100644 index e16509f76..000000000 --- a/examples/robot/tankdrive-modes/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/robot/tankdrive-modes/.project b/examples/robot/tankdrive-modes/.project deleted file mode 100644 index 5548d5427..000000000 --- a/examples/robot/tankdrive-modes/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - tankdrive-modes - Project tankdrive-modes created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970549 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/robot/tankdrive-system-custom/.classpath b/examples/robot/tankdrive-system-custom/.classpath deleted file mode 100644 index e16509f76..000000000 --- a/examples/robot/tankdrive-system-custom/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/robot/tankdrive-system-custom/.project b/examples/robot/tankdrive-system-custom/.project deleted file mode 100644 index 6fbeb1ee9..000000000 --- a/examples/robot/tankdrive-system-custom/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - tankdrive-system-custom - Project tankdrive-system-custom created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970551 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/robot/tankdrive-system-xbox/.classpath b/examples/robot/tankdrive-system-xbox/.classpath deleted file mode 100644 index e16509f76..000000000 --- a/examples/robot/tankdrive-system-xbox/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/robot/tankdrive-system-xbox/.project b/examples/robot/tankdrive-system-xbox/.project deleted file mode 100644 index a84fe6693..000000000 --- a/examples/robot/tankdrive-system-xbox/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - tankdrive-system-xbox - Project tankdrive-system-xbox created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970553 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/robot/tankdrive-system/.classpath b/examples/robot/tankdrive-system/.classpath deleted file mode 100644 index e16509f76..000000000 --- a/examples/robot/tankdrive-system/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/robot/tankdrive-system/.project b/examples/robot/tankdrive-system/.project deleted file mode 100644 index 1b70342ce..000000000 --- a/examples/robot/tankdrive-system/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - tankdrive-system - Project tankdrive-system created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970550 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/robot/tankdrive/.classpath b/examples/robot/tankdrive/.classpath deleted file mode 100644 index e16509f76..000000000 --- a/examples/robot/tankdrive/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/robot/tankdrive/.project b/examples/robot/tankdrive/.project deleted file mode 100644 index 2e6ef9b9b..000000000 --- a/examples/robot/tankdrive/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - tankdrive - Project tankdrive created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970548 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/vision/.project b/examples/vision/.project deleted file mode 100644 index b5636535d..000000000 --- a/examples/vision/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - vision - Project vision created by Buildship. - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970556 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/vision/basic-vision/.classpath b/examples/vision/basic-vision/.classpath deleted file mode 100644 index e16509f76..000000000 --- a/examples/vision/basic-vision/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/vision/basic-vision/.project b/examples/vision/basic-vision/.project deleted file mode 100644 index a0cad86a6..000000000 --- a/examples/vision/basic-vision/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - basic-vision - Project basic-vision created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970507 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/vision/cv-2020-vision/.classpath b/examples/vision/cv-2020-vision/.classpath deleted file mode 100644 index e16509f76..000000000 --- a/examples/vision/cv-2020-vision/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/vision/cv-2020-vision/.project b/examples/vision/cv-2020-vision/.project deleted file mode 100644 index 958c65998..000000000 --- a/examples/vision/cv-2020-vision/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - cv-2020-vision - Project cv-2020-vision created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970511 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/vision/cv-colorfilter/.classpath b/examples/vision/cv-colorfilter/.classpath deleted file mode 100644 index e16509f76..000000000 --- a/examples/vision/cv-colorfilter/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/vision/cv-colorfilter/.project b/examples/vision/cv-colorfilter/.project deleted file mode 100644 index 6f8f36a96..000000000 --- a/examples/vision/cv-colorfilter/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - cv-colorfilter - Project cv-colorfilter created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970514 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/examples/vision/vision-control/.classpath b/examples/vision/vision-control/.classpath deleted file mode 100644 index e16509f76..000000000 --- a/examples/vision/vision-control/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/examples/vision/vision-control/.project b/examples/vision/vision-control/.project deleted file mode 100644 index 3628ae3e1..000000000 --- a/examples/vision/vision-control/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - vision-control - Project vision-control created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970557 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/flashlib.vision.cv/.classpath b/flashlib.vision.cv/.classpath deleted file mode 100644 index 3fc9021f9..000000000 --- a/flashlib.vision.cv/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/flashlib.vision.cv/.project b/flashlib.vision.cv/.project deleted file mode 100644 index 315ebc9e3..000000000 --- a/flashlib.vision.cv/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - flashlib.vision.cv - Project flashlib.vision.cv created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1630341970538 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - From 5f68f5e300eb95f5c5459baba577bf5ad1c34846 Mon Sep 17 00:00:00 2001 From: dandeduck Date: Thu, 2 Sep 2021 21:16:29 +0300 Subject: [PATCH 8/8] removed bad function --- .../robot/systems/drive/PidSwerveWheel.java | 12 ++++-------- .../robot/systems/drive/SwerveDriveSystem.java | 16 ++++++++-------- .../robot/systems/drive/SwerveWheel.java | 1 - 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java index 9ecd919f1..2ec80f5b4 100644 --- a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java +++ b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/PidSwerveWheel.java @@ -3,6 +3,7 @@ import java.util.function.DoubleSupplier; import com.flash3388.flashlib.io.devices.SpeedController; +import com.flash3388.flashlib.math.Mathf; import com.flash3388.flashlib.robot.control.PidController; import com.jmath.vectors.Vector2; @@ -28,11 +29,6 @@ public PidSwerveWheel(SpeedController forwardController, SpeedController rotatio this(new PidController(kp, kd, kd, kf), forwardController, rotationController, angleDegreeSupplier); } - //this is bad, but I assume there is something built in, so I will wait for the PR on this one - public static double convertAngle(double angle) { - return angle < 0 ? 360 + angle : angle; - } - public void resetPid() { mPidController.reset(); } @@ -41,7 +37,7 @@ public void resetPid() { public void move(Vector2 motionVector) { double forwardSpeed = motionVector.magnitude(); double targetAngle = motionVector.angle(); - double currentAngle = convertAngle(mAngleDegreeSupplier.getAsDouble()); + double currentAngle = Mathf.translateAngle(mAngleDegreeSupplier.getAsDouble()); double nextAngle = calcNextAngle(targetAngle, currentAngle); double pidOut = mPidController.applyAsDouble(currentAngle, nextAngle); @@ -62,8 +58,8 @@ public void stop() { } private double calcNextAngle(double targetAngle, double currentAngle) { - targetAngle = convertAngle(targetAngle); - currentAngle = convertAngle(currentAngle); + targetAngle = Mathf.translateAngle(targetAngle); + currentAngle = Mathf.translateAngle(currentAngle); double distance = (targetAngle - currentAngle + 180 ) % 360 - 180; return currentAngle + distance; diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java index 2c18ac987..ce732c36c 100644 --- a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java +++ b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveDriveSystem.java @@ -1,5 +1,6 @@ package com.flash3388.flashlib.robot.systems.drive; +import com.flash3388.flashlib.math.Mathf; import com.flash3388.flashlib.scheduling.Subsystem; import com.jmath.vectors.Vector2; @@ -27,14 +28,13 @@ public SwerveDriveSystem(SwerveWheel frontRightWheel,SwerveWheel frontLeftWheel, frontRightWheel, frontLeftWheel, rearRightWheel, rearLeftWheel); } - public void fieldCentricDrive(double x, double y, double rotation, double gyroRadians) { //put in another system? with gyro supp? + public void fieldCentricDrive(double x, double y, double rotation, double gyroRadians) { rotation = -y * Math.sin(gyroRadians) + rotation * Math.cos(gyroRadians); y = y * Math.cos(gyroRadians) + rotation * Math.sin(gyroRadians); drive(x, y, rotation); - }//also this needs to be tested... + } - //for user friendlyness public void drive(double x, double y, double rotation) { holonomicCartesian(y, x, rotation); } @@ -56,7 +56,7 @@ public void holonomicPolar(double magnitude, double direction, double rotation) } @Override - public void holonomicCartesian(double y, double x, double rotation) {//maths + public void holonomicCartesian(double y, double x, double rotation) { double a = x - rotation * (mDrivetrain.getLength() / mDrivetrain.getDiagonal()); double b = x + rotation * (mDrivetrain.getLength() / mDrivetrain.getDiagonal()); double c = y - rotation * (mDrivetrain.getWidth() / mDrivetrain.getDiagonal()); @@ -67,10 +67,10 @@ public void holonomicCartesian(double y, double x, double rotation) {//maths double rearRightSpeed = Math.sqrt((a * a) + (d * d)); double rearLeftSpeed = Math.sqrt((a * a) + (c * c)); - double frontRightAngle = PidSwerveWheel.convertAngle(Math.toDegrees(Math.atan2(b, d))); - double frontLeftAngle = PidSwerveWheel.convertAngle(Math.toDegrees(Math.atan2(b, c))); - double rearRightAngle = PidSwerveWheel.convertAngle(Math.toDegrees(Math.atan2(a, d))); - double rearLeftAngle = PidSwerveWheel.convertAngle(Math.toDegrees(Math.atan2(a, c))); + double frontRightAngle = Mathf.translateAngle(Math.toDegrees(Math.atan2(b, d))); + double frontLeftAngle = Mathf.translateAngle(Math.toDegrees(Math.atan2(b, c))); + double rearRightAngle = Mathf.translateAngle(Math.toDegrees(Math.atan2(a, d))); + double rearLeftAngle = Mathf.translateAngle(Math.toDegrees(Math.atan2(a, c))); mFrontRightWheel.move(Vector2.polar(frontRightSpeed, frontRightAngle)); mFrontLeftWheel.move(Vector2.polar(frontLeftSpeed, frontLeftAngle)); diff --git a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveWheel.java b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveWheel.java index eddf201ab..bc18d5e11 100644 --- a/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveWheel.java +++ b/flashlib.core.robot/src/main/java/com/flash3388/flashlib/robot/systems/drive/SwerveWheel.java @@ -1,6 +1,5 @@ package com.flash3388.flashlib.robot.systems.drive; -import com.flash3388.flashlib.robot.motion.Movable; import com.flash3388.flashlib.robot.motion.Movable2d; import com.flash3388.flashlib.robot.motion.Rotatable;