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

Turn-To-Target with Limelight #3

Open
samneff72 opened this issue Nov 3, 2019 · 2 comments
Open

Turn-To-Target with Limelight #3

samneff72 opened this issue Nov 3, 2019 · 2 comments

Comments

@samneff72
Copy link
Collaborator

The Limelight connected to Asteria Deluxe publishes the coordinates of detected targets in relation to the crosshair in the middle of the Limelight.

Therefore, we can write code that will direct the robot to turn to face the target.

The function should live in the Drivetrain object, and be called by holding a button on the driver's controller.

When the 'x' value published to NetworkTables is above a certain value, the robot should turn in a direction. When it is below a certain value, it should turn the other. When it is between the values, the robot should not turn, but instead move forward or backwards at the rate of the throttle.

For extra credit, try making the rate of turning be controlled by the rate of the throttle application.

@samneff72
Copy link
Collaborator Author

There's example code for this in the 2017 Robot code, in the Drivetrain object.

@samneff72
Copy link
Collaborator Author

samneff72 commented Nov 5, 2019

Yesterday we implemented a bang-bang algorithm, using the same general method as 2017 Robot Code.

The constants used should be moved into c.java

Feature requests:
-Proportional rather than bang-bang control
-Move forward when the robot is on center
-Move forward/(backward?) proportional to throttle when robot is on center
-Print an error or light an indicator on the robot dashboard when the button is pressed but there is no target in view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant