Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angle check #881

Merged
merged 5 commits into from
Oct 24, 2024
Merged

Angle check #881

merged 5 commits into from
Oct 24, 2024

Conversation

JosephTLockwood
Copy link
Contributor

Add an angle check to prevent the following from being printed continuously (may need to be added on some other getAngle() as well.

Error at java.base/java.lang.Thread.getStackTrace(Thread.java:1619): x and y components of Rotation2d are zero

        at java.base/java.lang.Thread.getStackTrace(Thread.java:1619)
        at edu.wpi.first.math.geometry.Rotation2d.<init>(Rotation2d.java:122)
        at edu.wpi.first.math.geometry.Translation2d.getAngle(Translation2d.java:174)
        at com.pathplanner.lib.util.swerve.SwerveSetpointGenerator.generateSetpoint(SwerveSetpointGenerator.java:345)
       ....
        at com.ctre.phoenix6.swerve.SwerveDrivetrain.setControl(SwerveDrivetrain.java:413)
        at frc.robot.subsystems.drivetrain.CommandSwerveDrivetrain.lambda$14(CommandSwerveDrivetrain.java:266)
        at edu.wpi.first.wpilibj2.command.FunctionalCommand.execute(FunctionalCommand.java:57)
        at edu.wpi.first.wpilibj2.command.CommandScheduler.run(CommandScheduler.java:288)
        at frc.robot.Robot.robotPeriodic(Robot.java:27)
        at edu.wpi.first.wpilibj.IterativeRobotBase.loopFunc(IterativeRobotBase.java:400)
        at edu.wpi.first.wpilibj.TimedRobot.startCompetition(TimedRobot.java:131)
tRobot$0(RobotBase.java:418)
        at java.base/java.lang.Thread.run(Thread.java:840)

@github-actions github-actions bot added the PathPlannerLib Changes to PathPlannerLib label Oct 23, 2024
@mjansen4857
Copy link
Owner

These same checks need to be added to C++ and python as well, those don't have the setpoint generator so its only needed in the trajectory. Also, you should cache the value of wheelForces[m].getNorm() so that it doesn't need to be calculated twice.

@JosephTLockwood
Copy link
Contributor Author

@mjansen4857 Should be good to go now. I wasn't sure how to format Python, though.

@mjansen4857 mjansen4857 merged commit a60832b into mjansen4857:main Oct 24, 2024
24 checks passed
@JosephTLockwood JosephTLockwood deleted the Angle-Check branch October 24, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PathPlannerLib Changes to PathPlannerLib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants