Skip to content

turret: add pose-supplier, targeting helpers, and default command#14

Merged
smoser-frc merged 5 commits intomainfrom
solomon/moreTurret
Feb 4, 2026
Merged

turret: add pose-supplier, targeting helpers, and default command#14
smoser-frc merged 5 commits intomainfrom
solomon/moreTurret

Conversation

@karmikhael
Copy link
Contributor

Add Turret(Supplier) constructor and default ctor; store pose supplier for odometry-based targeting.

Implement getRobotRelativeAngle() which uses TurretHelpers.getTarget/getFieldRelativeAngle/getRobotRelative to compute the desired robot-relative turret angle. Record the last chosen Translation2d target and expose getLastTarget() for dashboarding.

Add setTurretSetpoint() stub and getLastSetpoint() for future motor control.

Add TurretDefaultCommand which calls turret.getRobotRelativeAngle(), publishes the target and setpoint, and set it as the turret default command in RobotContainer.

Wire Turret instantiation in RobotContainer (pass drivebase::getPose).

Add Turret(Supplier<Pose2d>) constructor and default ctor; store pose supplier for odometry-based targeting.

Implement getRobotRelativeAngle() which uses TurretHelpers.getTarget/getFieldRelativeAngle/getRobotRelative to compute the desired robot-relative turret angle. Record the last chosen Translation2d target and expose getLastTarget() for dashboarding.

Add setTurretSetpoint() stub and getLastSetpoint() for future motor control.

Add TurretDefaultCommand which calls turret.getRobotRelativeAngle(), publishes the target and setpoint, and set it as the turret default command in RobotContainer.

Wire Turret instantiation in RobotContainer (pass drivebase::getPose).
return swerveDrive.getPose();
}

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

drop this change, it is not related.

Copy link
Contributor Author

@karmikhael karmikhael left a comment

Choose a reason for hiding this comment

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

Removed it

Removed unused getPositionTranslation2d method.
Removed outdated documentation for robot translation accessor.
Removed unnecessary blank lines in getPose method.
Copy link
Contributor Author

@karmikhael karmikhael left a comment

Choose a reason for hiding this comment

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

Removed changes in swerve subsystem

@smoser-frc smoser-frc merged commit 97e8381 into main Feb 4, 2026
1 check passed
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.

2 participants