Skip to content

Commit

Permalink
Initial switch from Pathfinder to WPILib splines (#147)
Browse files Browse the repository at this point in the history
* Massive PathWeaver refactor - intended for initial review

What is not done:
-Comments or documentation

What is changed:
-The Spline interface has been refined, and an AbstractSpline class has been added to aid implementors
-SplineSegment aids drag and drop, a benefit of the old intrusive spline system
-One spline is now created for each trajectory (path the robot follows), instead of a Spline being created between every 2 Waypoints
-Waypoints no longer stores any references to Path or Spline
-Waypoints are held in an ArrayList instead of an intrusive linked list
-GitHub issues #140 and #142 are closed, with around 10 more issues being resolved or being able to be resolved with these changes
-Pathfinder has been superseded by WpiLib splines, but may be reimplemented if interest exists
-The faster rendering nature of WpiLib splines allows for an accurate spline to be continuously rendered, instead of swapping to a fake spline (aided by the skipping of time parameterization)
-Various code-quality/modularity improvements

To-Do:
-Fully evaluate the new series of abstract classes in regards to an spline implementation backend by writing some implementations
-Currently, the tangent lines exposed in PathWeaver are being set as the control vectors manually (see @gftabor), this should be replaced with WpiLib methods when those are complete
-Path serialization currently only serializes waypoints - we are blocking on further allwpilib work as well as bikeshedding

* Fix bugs found in inital refactor

What is changed:
-Removal of square scaling for tangent lines
-Refactor the angle heading optimization out from Path into Wpilib Path
and PathUtil
-Fixing out of bounds bugs

To-Do:
-Work on getting the square root scaling working with the tangent path optimization
-Get a proper change-log and to-do list up

* Add JavaDoc to pertinent files

What is changed:
-Javadoc is added to pertinent user-facing classes and important internal ones
-Gradle now errors on JavaDoc errors, and all existing errors have been fixed

* Really fix #142

What is changed:
-Actually show the alert box, as well as add error-handling to the right class. Also made alert boxes always on top.

* Dummy commit to rerun builds
  • Loading branch information
carbotaniuman authored and gftabor committed Oct 26, 2019
1 parent 655cb16 commit a54cc1d
Show file tree
Hide file tree
Showing 45 changed files with 1,499 additions and 1,732 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ out/
# Important that this is above the inclusion of the gradle-wrapper.jar
*.jar

!Pathfinder-Java.jar
!gradle-wrapper.jar

# Ignore Gradle GUI config
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Build Status](https://dev.azure.com/wpilib/DesktopTools/_apis/build/status/wpilibsuite.PathWeaver)](https://dev.azure.com/wpilib/DesktopTools/_build/latest?definitionId=10)
# PathWeaver

PathWeaver is a front end motion planning program. It is primarily designed for FRC teams using [Pathfinder](https://github.com/JacisNonsense/Pathfinder). For more instructions on using PathWeaver, refer to the [WPILib instructions](https://wpilib.screenstepslive.com/s/currentCS/m/84338).
PathWeaver is a front end motion planning program. It is primarily designed for FRC teams using WPILib's trajectories and splines. For more instructions on using PathWeaver, refer to the [WPILib instructions](https://wpilib.screenstepslive.com/s/currentCS/m/84338).

## Commenting
For bugs or feature suggestions, make a github issue.
Expand Down
113 changes: 37 additions & 76 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import org.gradle.api.Project
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.jvm.tasks.Jar
import org.gradle.testing.jacoco.tasks.JacocoReport
Expand All @@ -17,22 +16,21 @@ plugins {
`maven-publish`
jacoco
java
checkstyle
application
pmd
application
id("edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin") version "4.0.1"
id("edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin") version "2020.1"
id("com.jfrog.artifactory") version "4.9.8"
id("com.github.johnrengelman.shadow") version "4.0.3"
id("com.diffplug.gradle.spotless") version "3.13.0"
id("com.diffplug.gradle.spotless") version "3.25.0"
}

if (hasProperty("buildServer")) {
wpilibVersioning.setBuildServerMode(true)
wpilibVersioning.isBuildServerMode = true
}

if (hasProperty("releaseMode")) {
wpilibVersioning.setReleaseMode(true)
wpilibVersioning.isReleaseMode = true
}

repositories {
Expand All @@ -49,10 +47,13 @@ repositories {
maven {
url = uri("https://dev.imjac.in/maven/")
}
maven {
url = uri("https://first.wpi.edu/FRC/roborio/maven/release/")
}
}

wpilibVersioning.getVersion().finalizeValue()
version = wpilibVersioning.getVersion().get()
wpilibVersioning.version.finalizeValue()
version = wpilibVersioning.version.get()

if (System.getenv()["RUN_AZURE_ARTIFACTORY_RELEASE"] != null) {
artifactory {
Expand All @@ -72,7 +73,7 @@ if (System.getenv()["RUN_AZURE_ARTIFACTORY_RELEASE"] != null) {
invokeMethod("publications", "app")
})
})
clientConfig.info.setBuildName("PathWeaver")
clientConfig.info.buildName = "PathWeaver"
}

tasks.named("publish") {
Expand All @@ -96,8 +97,11 @@ application {

// Spotless is used to lint and reformat source files.
spotless {
java {
removeUnusedImports()
}
kotlinGradle {
ktlint("0.24.0")
ktlint("0.33.0")
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
Expand All @@ -113,24 +117,22 @@ spotless {
createNativeConfigurations()

dependencies {
// JavaFX dependencies
javafx("base")
javafx("controls")
javafx("fxml")
javafx("graphics")

compile("org.apache.commons", "commons-csv", "1.5")
compile("javax.measure", "unit-api", "1.0")
compile("si.uom", "si-units", "0.9")
compile("systems.uom", "systems-common", "0.8")
compile("com.google.code.gson", "gson", "2.8.5")
javafx(name = "base")
javafx(name = "controls")
javafx(name = "fxml")
javafx(name = "graphics")
compile(group = "org.fxmisc.easybind", name = "easybind", version = "1.0.3")
compile("jaci.pathfinder", "Pathfinder-Java", "2019.1.10")
compile("jaci.jniloader", "JNILoader", "1.0.1")
forEachPlatform {
add(it, "jaci.pathfinder:Pathfinder-JNI:2019.1.10:${wpilibClassifier(it)}")
add(it, "jaci.pathfinder:Pathfinder-CoreJNI:2019.1.10:${wpilibClassifier(it)}")
}

compile(group = "javax.measure", name = "unit-api", version = "1.0")
compile(group = "si.uom", name = "si-units", version = "0.9")
compile(group = "systems.uom", name = "systems-common", version = "0.8")

compile(group = "com.google.code.gson", name = "gson", version = "2.8.5")
compile(group = "org.apache.commons", name = "commons-csv", version = "1.5")

compile(group = "org.ejml", name = "ejml-simple", version = "0.38")
compile(group = "edu.wpi.first.wpiutil", name = "wpiutil-java", version = "2020.+")
compile(group = "edu.wpi.first.wpilibj", name = "wpilibj-java", version = "2020.+")

fun junitJupiter(name: String, version: String = "5.2.0") =
create(group = "org.junit.jupiter", name = name, version = version)
Expand All @@ -148,18 +150,6 @@ dependencies {
testRuntime(group = "org.junit.platform", name = "junit-platform-launcher", version = "1.0.0")
}

checkstyle {
toolVersion = "8.12"
}

pmd {
toolVersion = "6.8.0"
isConsoleOutput = true
reportsDir = file("${project.buildDir}/reports/pmd")
ruleSetFiles = files(file("$rootDir/pmd-ruleset.xml"))
ruleSets = emptyList()
}

tasks.withType<JavaCompile>().configureEach {
// UTF-8 characters are used in menus
options.encoding = "UTF-8"
Expand All @@ -171,6 +161,14 @@ jacoco {
toolVersion = "0.8.2"
}

extensions.getByType<PmdExtension>().apply {
toolVersion = "6.8.0"
isConsoleOutput = true
reportsDir = file("${project.buildDir}/reports/pmd")
ruleSetFiles = files(file("$rootDir/pmd-ruleset.xml"))
ruleSets = emptyList()
}

tasks.withType<JacocoReport>().configureEach {
reports {
xml.isEnabled = true
Expand All @@ -188,10 +186,6 @@ tasks.withType<Test>().configureEach {
}
}

tasks.withType<Javadoc>().configureEach {
isFailOnError = false
}

val nativeShadowTasks = NativePlatforms.values().map { platform ->
tasks.create<ShadowJar>("shadowJar-${platform.platformName}") {
classifier = platform.platformName
Expand Down Expand Up @@ -233,36 +227,3 @@ publishing {
tasks.withType<Wrapper>().configureEach {
gradleVersion = "5.0"
}

/**
* Retrieves the [java][org.gradle.api.plugins.JavaPluginConvention] project convention.
*/
val Project.`java`: org.gradle.api.plugins.JavaPluginConvention
get() =
convention.getPluginByName("java")

/**
* Retrieves the [checkstyle][org.gradle.api.plugins.quality.CheckstyleExtension] project extension.
*/
val Project.`checkstyle`: org.gradle.api.plugins.quality.CheckstyleExtension
get() =
extensions.getByName("checkstyle") as org.gradle.api.plugins.quality.CheckstyleExtension

/**
* Configures the [checkstyle][org.gradle.api.plugins.quality.CheckstyleExtension] project extension.
*/
fun Project.`checkstyle`(configure: org.gradle.api.plugins.quality.CheckstyleExtension.() -> Unit) =
extensions.configure("checkstyle", configure)

/**
* Retrieves the [pmd][org.gradle.api.plugins.quality.PmdExtension] project extension.
*/
val Project.`pmd`: org.gradle.api.plugins.quality.PmdExtension
get() =
extensions.getByName("pmd") as org.gradle.api.plugins.quality.PmdExtension

/**
* Configures the [pmd][org.gradle.api.plugins.quality.PmdExtension] project extension.
*/
fun Project.`pmd`(configure: org.gradle.api.plugins.quality.PmdExtension.() -> Unit) =
extensions.configure("pmd", configure)
122 changes: 0 additions & 122 deletions src/main/java/edu/wpi/first/pathweaver/DragHandler.java

This file was deleted.

Loading

0 comments on commit a54cc1d

Please sign in to comment.