Skip to content

Turn to target#14

Draft
EJainDev wants to merge 11 commits intomainfrom
TurnToTarget
Draft

Turn to target#14
EJainDev wants to merge 11 commits intomainfrom
TurnToTarget

Conversation

@EJainDev
Copy link
Copy Markdown
Member

This is to turn the robot to an April Tag. The constant in drive is very badly named…

@EJainDev EJainDev marked this pull request as draft October 28, 2025 00:52
@EJainDev EJainDev marked this pull request as ready for review October 28, 2025 01:46
@EJainDev EJainDev requested a review from Copilot October 28, 2025 01:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements functionality to turn the robot toward an April Tag using vision feedback. The implementation introduces a new RobotState singleton to share vision yaw data between subsystems and adds commands to coordinate vision updates with drive rotation.

  • Introduces RobotState singleton for sharing vision yaw data across subsystems
  • Adds rotateToTag() command chain from Orchestrator through Drive and Vision subsystems
  • Configures closed-loop control on drive motors with PID tuning placeholders

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
RobotState.java New singleton class to store shared vision yaw data
Vision.java Adds updateYaw() command to update RobotState with current yaw
Drive.java Adds toAprilTag() command to execute rotation via IO layer
DriveIO.java Adds rotateToTag() interface method for implementations
DriveIOSparkMax.java Implements rotateToTag() with velocity control and configures PID
DriveConstants.java Adds RPM_PER_RAD conversion constant
Orchestrator.java Adds rotateToTag() command combining vision update and drive rotation
RobotContainer.java Wires up orchestrator with vision/drive subsystems and binds X button
ShooterIOSparkMax.java Adds unused import for SparkClosedLoopController

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

EJainDev and others added 6 commits October 27, 2025 21:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ShayanHasNo ShayanHasNo marked this pull request as draft October 30, 2025 14:10
Copy link
Copy Markdown
Contributor

@ShayanHasNo ShayanHasNo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check all comments

@Override
public void rotateToTag() {
var newVelocity = pidController.calculate(RobotState.get().visionYaw, 0);
leftLeader.set(newVelocity);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’re going to have to figure out a constant that turns the degree value into a range of -1 and 1 as motor.set only accepts that range. Multiple the constant and the PID output to get your ‘velocity’

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just clamped it for now, I think we'll need to create a function for PID to properly work. I'll work on that.

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

Successfully merging this pull request may close these issues.

3 participants