Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe SwerveModule subsystem was modified to account for drive-steer wheel coupling. A new constant 🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/frc/trigon/robot/subsystems/swerve/swervemodule/SwerveModule.java (1)
131-136:⚠️ Potential issue | 🟠 MajorOdometry positions lack coupling compensation.
getDriveWheelPositionRadiansnow compensates for steer-drive coupling, butgetOdometryPositionfeeds rawlatestOdometryDrivePositionsdirectly intodriveWheelRotationsToMeterswithout any coupling adjustment. This means your high-frequency odometry updates will still include steer-induced drift, undermining the fix you applied ingetDriveWheelPositionRadians.You should apply the same coupling subtraction here, using the corresponding steer position from
latestOdometrySteerPositions:Proposed fix
public SwerveModulePosition getOdometryPosition(int odometryUpdateIndex) { + final double steerPositionRotations = latestOdometrySteerPositions[odometryUpdateIndex]; + final double coupledDrivePosition = latestOdometryDrivePositions[odometryUpdateIndex] - (steerPositionRotations * SwerveModuleConstants.COUPLED_RATIO); return new SwerveModulePosition( - driveWheelRotationsToMeters(latestOdometryDrivePositions[odometryUpdateIndex]), + driveWheelRotationsToMeters(coupledDrivePosition), Rotation2d.fromRotations(latestOdometrySteerPositions[odometryUpdateIndex]) ); }
src/main/java/frc/trigon/robot/subsystems/swerve/swervemodule/SwerveModule.java
Show resolved
Hide resolved
| import frc.trigon.robot.constants.AutonomousConstants; | ||
|
|
||
| public class SwerveModuleConstants { | ||
| static final double COUPLED_RATIO = 3; |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Add a brief comment explaining what this ratio represents.
COUPLED_RATIO is not self-evident to someone unfamiliar with the mechanical coupling between the steer and drive gears. A one-liner explaining it (e.g., the gear ratio between the steer and drive shafts that causes drive encoder drift when steering) would go a long way. Based on learnings, comments should explain "why" or non-obvious decisions.
No description provided.