mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-08 16:28:07 -06:00
shooter fixes
This commit is contained in:
@@ -2,8 +2,9 @@ Distance (in) ,Hood Ext. (u) ,Drum Velocity (u/ds)
|
||||
0 ,-29.5 ,8000
|
||||
78.5 ,-29.5 ,8500
|
||||
88 ,-34.2 ,8600
|
||||
90 ,-35.47 ,9500
|
||||
99 ,-39.62 ,9500
|
||||
90 ,-36.47 ,9000
|
||||
92.2 ,-50 ,8500
|
||||
99 ,-41 ,9500
|
||||
111 ,-42 ,9500
|
||||
127.25 ,-49.12 ,9500
|
||||
141 ,-59.4 ,9900
|
||||
|
||||
|
@@ -496,7 +496,7 @@ public class RobotContainer {
|
||||
SequentialCommandGroup extendThenAimTurret() {
|
||||
return new SequentialCommandGroup(
|
||||
new ExtenderIntakeGroup(m_robotIntake, m_robotExtender),
|
||||
new RunCommandForTime(new RunCommand(() -> m_robotTurret.runShooterRotatePID(-180), m_robotTurret), 0.5, true) // TODO: optimize time
|
||||
new RunCommandForTime(new RunCommand(() -> m_robotTurret.runShooterRotatePID(-175), m_robotTurret), 0.5, true) // TODO: optimize time
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -118,19 +118,18 @@ public class TrackTarget extends CommandBase {
|
||||
// true);
|
||||
|
||||
double regressedDistance = getDistance(average.y);
|
||||
|
||||
double distAdj = SmartDashboard.getNumber("Distance Adjust", -35);
|
||||
// ! offset trig solution
|
||||
double desiredOffset = 10; // * inches
|
||||
double angleOffset = Math.toDegrees(Math.atan(desiredOffset / regressedDistance)); // * degrees
|
||||
double desiredOffset = 2; // * inches
|
||||
double angleOffset = Math.toDegrees(Math.atan(desiredOffset / (regressedDistance + distAdj))); // * degrees
|
||||
double pixelOffset = angleOffset * VisionConstants.PIXELS_PER_DEGREE;
|
||||
|
||||
double output = ((average.x + 40) - VisionConstants.LIME_HIXELS/2.d) / VisionConstants.LIME_HIXELS;
|
||||
double output = ((average.x - pixelOffset) - VisionConstants.LIME_HIXELS/2.d) / VisionConstants.LIME_HIXELS;
|
||||
output *= 2.1;
|
||||
|
||||
m_turret.runTurretWithInput(output);
|
||||
|
||||
// ! no longer a +30 lol -aarav
|
||||
double distAdj = SmartDashboard.getNumber("Distance Adjust", -35);
|
||||
velocity = m_boomBoom.getVelocity(regressedDistance + distAdj);
|
||||
hoodPosition = m_boomBoom.getHood(regressedDistance + distAdj);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user