Open
Conversation
Collaborator
Author
|
i cant use my laptop and didn't configure ruff |
Collaborator
Author
|
nvm it's a conflict |
auscompgeek
reviewed
Jan 30, 2026
| DEPLOYED_ANGLE_UPPER = 3.892366 - ARM_ENCODER_OFFSET | ||
| RETRACTED_ANGLE = 4.610450 - ARM_ENCODER_OFFSET | ||
| ARM_LENGTH = 0.22 # meters | ||
| ARM_MOI = 0.181717788 |
Member
There was a problem hiding this comment.
Have you measured this from the CAD yet?
Collaborator
Author
There was a problem hiding this comment.
no because its not cadded yet
4b16689 to
907b7ad
Compare
394c1cc to
9bd6e9c
Compare
9bd6e9c to
394c1cc
Compare
b2cb3ed to
96dc64d
Compare
Collaborator
Author
|
pre-commit.ci autofix |
9a00844 to
c7f4077
Compare
Collaborator
Author
Greptile Overview
|
| Filename | Overview |
|---|---|
| components/intake.py | Added intake arm motor with Spark MAX controller, absolute encoder, PID control, and simulation constants - includes visualization ligament that isn't updated |
| physics.py | Added intake arm physics simulation using SingleJointedArmSim with gravity - converts radians to rotations for encoder |
Sequence Diagram
sequenceDiagram
participant Robot
participant IntakeComponent
participant SparkMax
participant AbsoluteEncoder
participant PhysicsEngine
participant SingleJointedArmSim
Robot->>IntakeComponent: __init__(intake_mech_root)
IntakeComponent->>SparkMax: Create arm_motor (ID 12)
IntakeComponent->>SparkMax: Configure PID (0.005, 0.0, 0.0)
IntakeComponent->>AbsoluteEncoder: Configure conversion factor
IntakeComponent->>IntakeComponent: Create intake_ligament visualization
Robot->>PhysicsEngine: __init__(robot)
PhysicsEngine->>SingleJointedArmSim: Create arm simulation
Note over SingleJointedArmSim: gear_ratio=24, MOI=0.181717788<br/>length=0.22m, with gravity
loop Every robot cycle
Robot->>IntakeComponent: execute()
IntakeComponent->>SparkMax: Apply motor commands
alt In Simulation
PhysicsEngine->>SingleJointedArmSim: update(dt)
SingleJointedArmSim->>SingleJointedArmSim: Calculate physics with gravity
SingleJointedArmSim-->>PhysicsEngine: arm angle (radians)
PhysicsEngine->>PhysicsEngine: Convert radians to rotations
PhysicsEngine->>SparkMax: setPosition(arm_angle_rot)
SparkMax->>AbsoluteEncoder: Update encoder position
end
end
Comment on lines
+34
to
+35
| self.intake_ligament = intake_mech_root.appendLigament( | ||
| "intake", length=0.25, angle=90, color=wpilib.Color8Bit(wpilib.Color.kGreen) | ||
| ) |
There was a problem hiding this comment.
consider updating intake_ligament.setAngle() in execute() to reflect the actual arm position in the Mechanism2d visualization (similar to how turret updates its sim_pointer)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: components/intake.py
Line: 34:36
Comment:
consider updating `intake_ligament.setAngle()` in `execute()` to reflect the actual arm position in the Mechanism2d visualization (similar to how turret updates its sim_pointer)
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.a2c694d to
5bbb978
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mass properties are from last yr