I already am implementing struct serializable and have a struct in the class, this was working great up till now and am now getting this error, “ava.nio.BufferOverflowException
at java.base/java.nio.Buffer.nextPutIndex(Buffer.java:730)
at java.base/java.nio.DirectByteBuffer.putDouble(DirectByteBuffer.java:1023)
at com.team254.lib.geometry.Rotation2dStruct.pack(Rotation2dStruct.java:38)
at com.team254.lib.geometry.Rotation2dStruct.pack(Rotation2dStruct.java:1)
at edu.wpi.first.util.struct.StructBuffer.write(StructBuffer.java:73)
at org.littletonrobotics.junction.LogTable.put(LogTable.java:519)
at org.littletonrobotics.junction.LogTable.put(LogTable.java:645)
at org.littletonrobotics.junction.Logger.recordOutput(Logger.java:1094)
at com.team5817.lib.drivers.Pigeon.getYaw(Pigeon.java:52)
at com.team5817.frc2024.subsystems.WheelTracker$OdometryThread.run(WheelTracker.java:97)” Thank You!
I would recommend reading through this documentation page on multithreading in AdvantageKit. Note that logging methods like recordOutput
are not thread-safe, and are synchronized to the main loop cycle anyway.
2 Likes