Jaci's Pathfinder in Command Based Robot

Hi. I’m trying to use Jaci’s pathfinder this year for programming but there is very little (if any) documentation on using it with command based programming. I’m using it in a command called ScoreHatch, which calculates the distance from the target (and inputs it for X) as well as the distance that we are offset (which it puts into Y). It also passes limelight.getAngleOffset() for the angle part of the waypoint. The rest of my program works fine but when I try to run this command it crashes the robot, indicating a red light on driver station under Robot Code before it resets after a few seconds. The error I’m getting shows up in rioLog and is as follows:

  • A fatal error has been detected by the Java Runtime Environment:

  • SIGSEGV (0xb) at pc=0xabec8558, pid=2452, tid=2455

  • JRE version: OpenJDK Runtime Environment (11.0.1.13) (build 11.0.1.13-frc+0-2019-11.0.1u13-1)

  • Java VM: OpenJDK Client VM (11.0.1.13-frc+0-2019-11.0.1u13-1, mixed mode, serial gc, linux-)

  • Problematic frame:

  • C [libpathfinderjni.so+0x4558] pf_trajectory_fromSecondOrderFilter+0x2c8

  • No core dump will be written. Core dumps have been disabled. To enable core dumping, try “ulimit -c unlimited” before starting Java again

  • An error report file with more information is saved as:

  • /tmp/hs_err_pid2452.log

  • If you would like to submit a bug report, please visit:

  • http://bugreport.java.com/bugreport/crash.jsp

  • The crash happened outside the Java Virtual Machine in native code.

  • See problematic frame for where to report the bug.

Our code can be found here: https://github.com/Tiki-Techs/FRC-2019-Java

When you ssh into the RoboRIO, do the paths exist? They’ll be in /lvuser/deploy/paths/

Make sure the path CSV files are being copied. In your source code, the default folder for paths to be deployed is src/main/deploy.

I don’t have access to the bot right now but I’ll check that out tomorrow. Is there anything you need to do to set up pathfinder 1.0 besides copying the JSON file into the online vendor library import?

Your build.gradle should find the Pathfinder dependencies from the JSON when it imports new changes.

I need to add that myself?

You only need to add the JSON file https://dev.imjac.in/maven/jaci/pathfinder/PathfinderOLD-latest.json. (the build.gradle file is generated when you create a new robot program using the template so you should already have one).

Okay. That’s what I thought. Do you have any other idea as to why the program crashes then?

Did you check that the CSV path files were being copied over correctly? And the paths you are using to reference the paths are correct in your program?

There is no /paths directory when I go into /lvuser/deploy/paths. So it isn’t building correctly? How can I make sure that the files are transferred over?

In your project, the file structure should look somewhat similar to this:

PathWeaver will copy over the paths in the src/main/deploy/paths/ directory. You’ll want to copy the CSV files generated by PathWeaver/Pathfinder in here. If you’re using PathWeaver, you can set the build location to the /paths directory.

I’m trying to use Jaci’s pathfinder, not pathweaver. I don’t have a paths folder in deploy. Do I need to specify a build location for pathfinder?

Sorry about that, my previous help was for PathWeaver use. In your ScoreHatch command, I see that you create an array of waypoints with only one waypoint. If I remember correctly from last year, Pathfinder needs at least two waypoints to create path. The other waypoint would be your current robot position.

    Waypoint[] goal = new Waypoint[]{
        new Waypoint(waypointX, waypointY, Robot.limelight.getAngleOffset())
    };

Oh okay. So if we’re creating a trajectory relative to the robot position, then the first waypoint is (0,0,0)?

Yes.

So my team just finally got Jacis Pathfinder to follow a path we made in PathWeaver. Now is the time where we go and make a ton of paths. Can Jacis pathfinder account for paths that switch which direction the robot is traveling mid path?

No, but there is essentially no difference between reversing direction mid path or creating another path which starts from the final position of the previous one.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.