ERROR 1 Unhandled exception: java.lang.UnsatisfiedLinkError: org.usfirst.frc.team3630.pathfinder.PathfinderJNI.generateTrajectory(Lorg/usfirst/frc/team3630/pathfinder/Waypoint;Ljaci/pathfinder/Trajectory$FitMethod;IDDDD)Ljaci/pathfinder/Trajectory$Segment; org.usfirst.frc.team3630.pathfinder.PathfinderJNI.generateTrajectory(Native Method)
at org.usfirst.frc.team3630.pathfinder.PathfinderJNI.generateTrajectory(Native Method)
at org.usfirst.frc.team3630.pathfinder.PathfinderJNI.generateTrajectory(PathfinderJNI.java:20)
at org.usfirst.frc.team3630.pathfinder.Pathfinder.generate(Pathfinder.java:89)
at org.usfirst.frc.team3630.pathfinder.Pathfinder.initTrajectory(Pathfinder.java:33)
at org.usfirst.frc.team3630.robot.Robot.autonomousInit(Robot.java:89)
at edu.wpi.first.wpilibj.IterativeRobotBase.loopFunc(IterativeRobotBase.java:199)
at edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:41)
at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:250)
Mentioned line 20 in PathfinderJNI is returning new Trajectory. I think that this is the first time when the pathfinder library is called in the code. Teleoperated part of the code, where the pathfinder is not included is running without errors.
What I have seen in one post with a similar issue, the problem is in the build of the code. I am using the newest version of the library and I followed all installation instructions included on GitHub. I have reimaged the RIO and the problem is still there.
If you have a similar issue or any solution, please post those below.
Thanks
Are you using GradleRIO? If so, all you need to add is the one line of code into your build.gradle and it should work fine. From the error, it looks like the program cannot find the .so file that needs to be on the RoboRIO.
Then you should. Using GradleRIO will deploy your code faster, and it will make your job much easier. For example, as Prateek mentioned, adding Pathfinder to your project will be just adding the following line:
compile pathfinder()
And also, GradleRIO will be the official build system for FRC in 2019+.
For more information about GradleRIO, click here.
You’ve copied the Pathfinder java source files into your own packages, you should keep them in the jaci.pathfinder package by importing the .jar with the instructions given.
Today, we made the pathfinder run. However, when we set the first waypoint to 0, 0, 0 (x, y, angle) and the second one to 0, 0.6, 0 (x, y, angle), the code is crashing again with the following message:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xab322158, pid=4515, tid=0xb52c1470
#
# JRE version: OpenJDK Runtime Environment (8.0_131-b57) (build 1.8.0_131-b57)
# Java VM: OpenJDK Client VM (25.131-b57 mixed mode, Evaluation linux-aarch32 )
# Problematic frame:
# C [libpathfinderjava.so+0x6158] pf_trajectory_fromSecondOrderFilter+0x88
#
# Core dump written. Default location: //core or core.4515 (max size 2048 kB). To ensure a full core dump, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# //hs_err_pid4515.log
#
# If you would like to submit a bug report, please visit:
# http://www.azulsystems.com/support/
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
what does “problematic frame” mean?
I have seen similar - maybe the same - issue and the solution to that was to lower the dt variable in Trajectory.config to 0.005. However, this solution did not work for us.