Skip to content

Java Example: Custom Logging

Michael Jansen edited this page Nov 17, 2023 · 2 revisions

PathPlannerLib provides the ability to set custom logging callbacks that will be called when the built in path following commands are running. You can set these callbacks through the PathPlannerLogging class.

// Logging callback for current robot pose
PathPlannerLogging.setLogCurrentPoseCallback((pose) -> {
    // Do whatever you want with the pose here
});

// Logging callback for target robot pose
PathPlannerLogging.setLogTargetPoseCallback((pose) -> {
    // Do whatever you want with the pose here
});

// Logging callback for the active path, this is sent as a list of poses
PathPlannerLogging.setLogActivePathCallback((poses) -> {
    // Do whatever you want with the poses here
});
Clone this wiki locally