Shenzhen-Robotics-Alliance / maple-sim

Elevating FRC Java Robot Simulations to the Next Level with Physics Engines
BSD 3-Clause "New" or "Revised" License
19 stars 11 forks source link

[BUG] Robot Movement Incorrect During Simulation #40

Open Roman-Tech-Plus opened 17 hours ago

Roman-Tech-Plus commented 17 hours ago

Bug Description

The DS console stream reports a "x and y components of Rotation2d are zero" in MapleCommonMath.getAngle() when called by SwerveDriveSimulation.simulateChassisFrictionForce() on line 163. It is possible that this is unrelated but the robot demonstrates highly erratic movement, twisting in quazi-random figure-8 patterns.

Robot Code Repository

https://github.com/BreakerBots/BRICK/tree/main/2025-beta

Steps to Reproduce

Call the SwerveDriveSimulation class's sub tick update method.

Additional Context

We are implementing this with Phoenix Swerve

catr1xLiu commented 16 hours ago

Hi, thanks for reflecting the issue!

So the Rotation2d warining is completely normal, I also get it ever since I upgrade to wpilib2025, this shouldn't be the issue.

Please wait a little. Once I have more time, I'll fork your repo to see if I can re-predocue the "highly erratic movement, twisting in quazi-random figure-8 patterns".

catr1xLiu commented 16 hours ago

Hey, can you check the visibility of your repo? It doesn't seem to be public.

image

Roman-Tech-Plus commented 7 hours ago

Apologies, it should be visible now.

The sim support is a bit messy as I put it together to debug.