Skip to content

Python Example: Custom Logging

Michael Jansen edited this page Dec 7, 2023 · 1 revision

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.

from pathplannerlib.logging import PathPlannerLogging

# Logging callback for current robot pose
PathPlannerLogging.setLogCurrentPoseCallback(lambda pose: print(pose))

# Logging callback for target robot pose
PathPlannerLogging.setLogTargetPoseCallback(lambda pose: print(pose))

# Logging callback for the active path, this is sent as a list of poses
PathPlannerLogging.setLogActivePathCallback(lambda poses: print(poses))
Clone this wiki locally