You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When replaying a log file via AdvantageKit, a null pointer exception is generated in PathPlannerPath.precalcValues.
To Reproduce
Steps to reproduce the behavior:
Run a PathPlanner auto in simulation in a project using AdvantageKit and LocalADStarAK.java.
Load the resulting log file in AdvantageScope to prepare for replay.
Run the same project in replay mode using the log file loaded in AdvantageScope.
Expected behavior
No crash.
Versions: (please complete the following information):
OS: macOS 15.2
PPLib Version: 2025.0.0-beta-6.1
PPLib Language: Java
Additional context
This line of code is in the Robot constructor after starting AdvantageKit logger and before anything else: Pathfinding.setPathfinder(new LocalADStarAK());
The latest version of LocalADStarAK.java (from the gist) is used.
The ADStarIO class logs the x and y positions of each point but doesn't log the constraints. Therefore, during replay, the constraints instance variable is null which results in the following exception:
Error at com.pathplanner.lib.path.PathPlannerPath.precalcValues(PathPlannerPath.java:980): Unhandled exception: java.lang.NullPointerException: Cannot invoke "com.pathplanner.lib.path.PathConstraints.maxVelocityMPS()" because "point.constraints" is null
at com.pathplanner.lib.path.PathPlannerPath.precalcValues(PathPlannerPath.java:980)
at com.pathplanner.lib.path.PathPlannerPath.fromPathPoints(PathPlannerPath.java:188)
at frc.robot.LocalADStarAK.getCurrentPath(LocalADStarAK.java:56)
at com.pathplanner.lib.pathfinding.Pathfinding.getCurrentPath(Pathfinding.java:53)
at com.pathplanner.lib.commands.PathfindingCommand.execute(PathfindingCommand.java:295)
at edu.wpi.first.wpilibj2.command.SequentialCommandGroup.execute(SequentialCommandGroup.java:78)
at edu.wpi.first.wpilibj2.command.WrapperCommand.execute(WrapperCommand.java:44)
at edu.wpi.first.wpilibj2.command.CommandScheduler.run(CommandScheduler.java:288)
at frc.robot.Robot.robotPeriodic(Robot.java:176)
at edu.wpi.first.wpilibj.IterativeRobotBase.loopFunc(IterativeRobotBase.java:400)
at org.littletonrobotics.junction.LoggedRobot.startCompetition(LoggedRobot.java:116)
at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:419)
at edu.wpi.first.wpilibj.RobotBase.lambda$startRobot$1(RobotBase.java:490)
at java.base/java.lang.Thread.run(Thread.java:840)
The text was updated successfully, but these errors were encountered:
Describe the bug
When replaying a log file via AdvantageKit, a null pointer exception is generated in PathPlannerPath.precalcValues.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No crash.
Versions: (please complete the following information):
Additional context
This line of code is in the Robot constructor after starting AdvantageKit logger and before anything else:
Pathfinding.setPathfinder(new LocalADStarAK());
The latest version of LocalADStarAK.java (from the gist) is used.
The ADStarIO class logs the x and y positions of each point but doesn't log the constraints. Therefore, during replay, the constraints instance variable is null which results in the following exception:
Error at com.pathplanner.lib.path.PathPlannerPath.precalcValues(PathPlannerPath.java:980): Unhandled exception: java.lang.NullPointerException: Cannot invoke "com.pathplanner.lib.path.PathConstraints.maxVelocityMPS()" because "point.constraints" is null
at com.pathplanner.lib.path.PathPlannerPath.precalcValues(PathPlannerPath.java:980)
at com.pathplanner.lib.path.PathPlannerPath.fromPathPoints(PathPlannerPath.java:188)
at frc.robot.LocalADStarAK.getCurrentPath(LocalADStarAK.java:56)
at com.pathplanner.lib.pathfinding.Pathfinding.getCurrentPath(Pathfinding.java:53)
at com.pathplanner.lib.commands.PathfindingCommand.execute(PathfindingCommand.java:295)
at edu.wpi.first.wpilibj2.command.SequentialCommandGroup.execute(SequentialCommandGroup.java:78)
at edu.wpi.first.wpilibj2.command.WrapperCommand.execute(WrapperCommand.java:44)
at edu.wpi.first.wpilibj2.command.CommandScheduler.run(CommandScheduler.java:288)
at frc.robot.Robot.robotPeriodic(Robot.java:176)
at edu.wpi.first.wpilibj.IterativeRobotBase.loopFunc(IterativeRobotBase.java:400)
at org.littletonrobotics.junction.LoggedRobot.startCompetition(LoggedRobot.java:116)
at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:419)
at edu.wpi.first.wpilibj.RobotBase.lambda$startRobot$1(RobotBase.java:490)
at java.base/java.lang.Thread.run(Thread.java:840)
The text was updated successfully, but these errors were encountered: