Debugging
How to Print Pedro's states
Almost every important component of Pedro Pathing's follower has a debug string that can be logged.
The Drivetrain, Algorithm, and Localizer all have their own debug() methods that return a Map<String, Object> log of their present state.
If you are requesting Pedro Pathing troubleshooting help from others, sending a video of these messages can provide an effective way for others to diagnose your issue.
Follower Log
The Follower has a debug() method that returns a FollowerLog of its present state.
This log contains the debug maps from the Drivetrain, Algorithm, and Localizer, as well as some additional data.
You can access each individual debug Map<String, Object> with the following methods:
Map<String, Object> drivetrainLog = follower.debug().drivetrain();
Map<String, Object> algorithmLog = follower.debug().algorithm();
Map<String, Object> localizerLog = follower.debug().localizer();
Map<String, Object> followStateLog = follower.debug().followState();Debug Strings
If someone asks you to send a video of your "drivetrain string", you would do that like this:
String drivetrainString = follower.debug().drivetrain().toString();
telemetry.addLine(drivetrainString);
telemetry.update();Similarly, the "algorithm string" can be accessed with follower.debug().algorithm().toString() and the "localizer string" can be accessed with follower.debug().localizer().toString();.
Follower String
The Follower also has its own debug string for the FollowerLog that contains all the debug maps and additional data.
You may access the follower string with the follower.debug().toString() method.
Tip
You can use a Consumer<FollowerLog> to log the follower's debug information easily. See Logging for more details.
Next Steps
Feel free to continue on to any of the 'Reference' pages to learn more about specific features or aspects of Pedro Pathing.
We recommend reading the PoseFactory Reference first and then proceeding through the rest.
Last updated on