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

Camera assisted intaking #53

Closed
jonahsnider opened this issue Oct 8, 2024 · 2 comments
Closed

Camera assisted intaking #53

jonahsnider opened this issue Oct 8, 2024 · 2 comments
Assignees

Comments

@jonahsnider
Copy link
Member

Use a note tracking Limelight to have driver assist features when intaking notes.

@jonahsnider jonahsnider converted this from a draft issue Oct 8, 2024
@jonahsnider jonahsnider added this to the Madtown Throwdown 2024 milestone Oct 8, 2024
@saikiranra
Copy link
Contributor

We need to split this behavior up into auto behavior and teleop behavior.

For teleop, we will want to do something simple, where

intake_v = speed robot is moving in the direction of the intake
tx = note tx angle, which is angle from the center

robot_translate_v = p * intake_v * tx

Where p is tuned and robot_translate is added to the commanded robot translate.

@saikiranra
Copy link
Contributor

I think the implementation we should try out is when we are in assisted intake mode, we get the requested vector of movement relative to the field and compare it to the angle the note is from the robot with tx. We subtract the two angles, multiply it by p and find the new x y speeds with the previous magnitude and the new angle. The angular change should be clamped to some tuned amount (35 degrees seems good for now).

Translation2d requested_field_relative_drive = whatever the driver requests
Rotation2d note_angle_relative_to_field = robot angle + note tx (might be minus, you need to thinf this through)
Float angle_error = requested_field_relative_drive.rotateBy(note_angle_relative_to_field).degrees()
Float angle_change = max(-35, min(35, angle_error * p))
Translation2d new_drive_request = requested_field_relative_drive.rotateBy(rotation2d.fromDegrees(angle_change))

@saikiranra saikiranra linked a pull request Oct 18, 2024 that will close this issue
@saikiranra saikiranra removed a link to a pull request Oct 18, 2024
@jonahsnider jonahsnider moved this from Todo to In progress in 2024 off season Oct 18, 2024
This was referenced Oct 14, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in 2024 off season Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants