pathplanner
pathplanner copied to clipboard
C++ PathPlannerLib: Pi causes issues with WPILib's Units library
Describe the bug When I try to use pi from the WPILib Units library as a double, I get errors if I include <pathplanner/lib/util/swerve/SwerveSetpointGenerator.h> or <pathplanner/lib/util/swerve/SwerveSetpoint.h> in the same file.
To Reproduce Steps to reproduce the behavior:
- #include <units/constants.h> and <pathplanner/lib/util/swerve/SwerveSetpointGenerator.h> or <pathplanner/lib/util/swerve/SwerveSetpoint.h> in the same file.
- Try to initialize a double with units::constants::pi.
Expected behavior Expected behavior is to be able to use pi from the Units library even if you include a file from PathPlanner. A behavior other than that might confuse programmers. You may want to define pi using a different method than you use now.
Screenshots
File without any PathPlanner files included:
File with PathPlanner files included:
The error message:
Versions: (please complete the following information):
- OS: [Linux Mint 22]
- GUI Version: [None]
- PPLib Version: [2025.2.7]
- PPLib Language: [C++]