Yesterday when running our code on the robot, we were randomly getting a SEGV fault on the roborio.
It also seemed to occur randomly, happening when a SmartDashboard line was added, or even when a function call was removed. The stack trace that preceded it always pointed to the line where the vision measurement is added to the pose estimation.
var vposeOpt = poseSupplier.getEstimatedGlobalPose(getPose());
if(vposeOpt.isEmpty()) return;
var vpose = vposeOpt.get();
SmartDashboard.putString("vpose", vpose.estimatedPose.toString());
//this line is what the stack trace points to \/
poseEstimator.addVisionMeasurement(vpose.estimatedPose.toPose2d(),
vpose.timestampSeconds);
visionPose= vpose.estimatedPose.toPose2d();
Surrounding that line with try/catch with Exception in the catch statement did not solve it.
The code is at code
Right now the code does not segfault but uncommenting this line
causes it to segfault.
We are also using the following software/libs
roborio@2023.1
wpilib@2023.4.2
pathplannerlib@2023.4.3
photonlib@2023.4.2
wpilibNewCommands@1
REVlib@2023.1.1
PhoenixProAnd5@23.0.4
roborio log:
hs_err_pid1682.txt (59.0 KB)