Jaci's Pathfinder, V2

I’m using VSCode (JDK 11) and have cloned Jaci’s Pathfinder v2 onto my Mac. After cloning, I went into Terminal and tried to build the library, but that didn’t work. I’m guessing that’s because Pathfinder isn’t a program you’re supposed to build, but then how do you build v2? In v1 I could just paste a link and input a VSCode command, but how does building work in v2?

I don’t think v2 is ready for use in a robot as it is still in alpha

@jreneew2 I don’t think so.

This (old) version of Pathfinder has been published for the 2019 FRC Season, if you would like to use the legacy version over the new and shiny Pathfinder v2.

But if you look at the repo for Pathfinder v2, there is no wiki nor releases which indicate that the project is not yet ready.

So we’re making a decision on what to use for pathfinding this year and were looking to do some testing. On adding the https://dev.imjac.in/maven/grpl/pathfinder/Pathfinder-latest.json vendor dep for v2, we get the following when trying to run gradle build:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':downloadDepsPreemptively'.
> Could not find Pathfinder-JNI-linuxathenadebug.jar (grpl.pathfinder:Pathfinder-JNI:2.0.0-prealpha).
  Searched in the following locations:
      https://dev.imjac.in/maven/grpl/pathfinder/Pathfinder-JNI/2.0.0-prealpha/Pathfinder-JNI-2.0.0-prealpha-linuxathenadebug.jar

@Jaci Should we just abandon v2 for the season, or is it worth considering at this point?

Are you doing this on a school/business network? Just looks like the repo URL is getting blocked since I can access it here. Try going to https://dev.imjac.in/maven/grpl/pathfinder/Pathfinder-JNI/2.0.0-prealpha/ in a web browser. If you can get to the directory, your issue is somewhere else. If you can’t, you just need an unrestricted internet connection.

Pathfinder v2 is not ready for this season. The closest thing you’ll find is 5190’s FalconLib, but you have to do some syntactical gymnastics to make it work with java instead of kotlin. If you don’t need on the fly path generation, then just go with pathfinder v1. (honestly, you probably don’t need otf pathgen quite as badly as you think you do)

1 Like

To use PF v1 or v2 you’ll need to add it as a dependency to your build.gradle.

Add the following lines:

repositories {
    maven {
        url = uri( "https://dev.imjac.in/maven/" )
    }
}

dependencies {
    // PF uses for loading native libs
    compile( "jaci.jniloader:JNILoader:1.0.1" )

    // Pathfinder V1
    compile( "jaci.pathfinder:Pathfinder-Java:2019.1.11" )
    compile( "jaci.pathfinder:Pathfinder-JNI:2019.1.11:linuxathena" )
    compile( "jaci.pathfinder:Pathfinder-CoreJNI:2019.1.11:linuxathena" )

    // Pathfinder V2
    compile( "grpl.pathfinder:Pathfinder-Java:2.0.0-prealpha" )
    compile( "grpl.pathfinder:Pathfinder-JNI:2.0.0-prealpha:linuxathena" )
}

See this comment by Jaci as to why PFv2 is not ready yet.

I can view the directory fine, the file Grade is looking for, https://dev.imjac.in/maven/grpl/pathfinder/Pathfinder-JNI/2.0.0-prealpha/Pathfinder-JNI-2.0.0-prealpha-linuxathenadebug.jar isn’t in the directory.

That’s about what I feared, but the reality is that we actually will need on the fly generation for our use case, and last I benchmarked v1 it really wasn’t suitable for that on the RoboRIO.

1 Like

So PFv2 is a little bit of a mixed bag at the moment. There are releases on maven, but they have a bug which may or may not be critical depending on how conservative you’re comfortable with setting your limits (the voltage math is incorrect, so if you’re not conservative with your max vel / max acc terms it can command the motors to ~15V or higher).

With some effort, you can make it work, but we’ve defaulted back to PFv1 since PFv2 is at this time an unknown stability on real hardware, while PFv1 is proven to work well. It’s a game of development resources, and unfortunately I’m only one person with a lot of other commitments and things that have to take priority.

4 Likes

Does this bug still exist in the current source or is it in only in the maven releases?

It is still in the current source, I haven’t quite figured it out yet, taking a raincheck until after build

Hey I’m having the same problem as you and after a quick google search I found this which is a repo with the debug jar in it. I haven’t tried it yet but presumably if you add the repo as a dependency in a similar way as mentioned before then it should work.

The maven repo you linked to is for Pathfinder v1. It doesn’t look like PFv2 has debug jars yet for some reason gradle is trying to download them.

So very long story short you have to create a local maven repo shove all the jars in there then compile the debug jar from the project and put that in the local maven repo too and then it will build. Actually running it is another situation as when the robot runs this error arises. Another long story short is essentially there’s a problem with the use of the Eigen math library and how the vectors are used that @Jaci needs to fix still. If you want I can give you the custom jar that solves most of the errors and the local maven repo in a zip, if you wanna try your hand at it.

Why do you have to create your own local maven repo? Just edit your build.gradle like I showed in my previous reply and forget about the json files.

Jaci,

I noticed that there has not been much posted about V2 in a while (GitHub says last changes were 8 months ago). Is this still an active project?

Thanks for all you do!

Chris

I’m currently on a break from FRC, including PF development, so for now the project is currently on hold

Note that WPILIB will be introducing its own Trajectory Generation API for the 2020 season. You can find details about it here in a PR on the frc-docs repository.

2 Likes

Thanks Jaci! We all know that breaks are needed as it can get downright overwhelming sometimes. :smile:

1 Like