mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 00:38:05 -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
|
0 ,-29.5 ,8000
|
||||||
78.5 ,-29.5 ,8500
|
78.5 ,-29.5 ,8500
|
||||||
88 ,-34.2 ,8600
|
88 ,-34.2 ,8600
|
||||||
90 ,-35.47 ,9500
|
90 ,-36.47 ,9000
|
||||||
99 ,-39.62 ,9500
|
92.2 ,-50 ,8500
|
||||||
|
99 ,-41 ,9500
|
||||||
111 ,-42 ,9500
|
111 ,-42 ,9500
|
||||||
127.25 ,-49.12 ,9500
|
127.25 ,-49.12 ,9500
|
||||||
141 ,-59.4 ,9900
|
141 ,-59.4 ,9900
|
||||||
|
|||||||
|
@@ -496,7 +496,7 @@ public class RobotContainer {
|
|||||||
SequentialCommandGroup extendThenAimTurret() {
|
SequentialCommandGroup extendThenAimTurret() {
|
||||||
return new SequentialCommandGroup(
|
return new SequentialCommandGroup(
|
||||||
new ExtenderIntakeGroup(m_robotIntake, m_robotExtender),
|
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);
|
// true);
|
||||||
|
|
||||||
double regressedDistance = getDistance(average.y);
|
double regressedDistance = getDistance(average.y);
|
||||||
|
double distAdj = SmartDashboard.getNumber("Distance Adjust", -35);
|
||||||
// ! offset trig solution
|
// ! offset trig solution
|
||||||
double desiredOffset = 10; // * inches
|
double desiredOffset = 2; // * inches
|
||||||
double angleOffset = Math.toDegrees(Math.atan(desiredOffset / regressedDistance)); // * degrees
|
double angleOffset = Math.toDegrees(Math.atan(desiredOffset / (regressedDistance + distAdj))); // * degrees
|
||||||
double pixelOffset = angleOffset * VisionConstants.PIXELS_PER_DEGREE;
|
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;
|
output *= 2.1;
|
||||||
|
|
||||||
m_turret.runTurretWithInput(output);
|
m_turret.runTurretWithInput(output);
|
||||||
|
|
||||||
// ! no longer a +30 lol -aarav
|
// ! no longer a +30 lol -aarav
|
||||||
double distAdj = SmartDashboard.getNumber("Distance Adjust", -35);
|
|
||||||
velocity = m_boomBoom.getVelocity(regressedDistance + distAdj);
|
velocity = m_boomBoom.getVelocity(regressedDistance + distAdj);
|
||||||
hoodPosition = m_boomBoom.getHood(regressedDistance + distAdj);
|
hoodPosition = m_boomBoom.getHood(regressedDistance + distAdj);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user