3939import java .util .concurrent .atomic .AtomicBoolean ;
4040import java .util .concurrent .atomic .AtomicLong ;
4141import java .util .concurrent .atomic .AtomicReference ;
42+ import org .curtinfrc .frc2026 .util .Repulsor .Shooting .Constraints ;
4243import org .curtinfrc .frc2026 .util .Repulsor .Shooting .DragShotPlanner ;
44+ import org .curtinfrc .frc2026 .util .Repulsor .Shooting .GamePiecePhysics ;
45+ import org .curtinfrc .frc2026 .util .Repulsor .Shooting .OnlineSearchState ;
46+ import org .curtinfrc .frc2026 .util .Repulsor .Shooting .ShotLibrary ;
47+ import org .curtinfrc .frc2026 .util .Repulsor .Shooting .ShotLibraryBuilder ;
48+ import org .curtinfrc .frc2026 .util .Repulsor .Shooting .ShotSolution ;
4349
4450public class Setpoints {
4551
@@ -363,13 +369,13 @@ private Rebuilt2026() {}
363369 private static final double HUB_SIMPLE_RADIUS_M = 3.0 ;
364370 private static final double HUB_OBS_ENABLE_DIST_M = 2.15 ;
365371
366- private static final DragShotPlanner . GamePiecePhysics HUB_PHYSICS = loadHubPhysicsOnce ();
372+ private static final GamePiecePhysics HUB_PHYSICS = loadHubPhysicsOnce ();
367373
368- private static DragShotPlanner . GamePiecePhysics loadHubPhysicsOnce () {
374+ private static GamePiecePhysics loadHubPhysicsOnce () {
369375 try {
370376 return DragShotPlanner .loadGamePieceFromDeployYaml (GAME_PIECE_ID_FUEL );
371377 } catch (Throwable t ) {
372- return new DragShotPlanner . GamePiecePhysics () {
378+ return new GamePiecePhysics () {
373379 @ Override
374380 public double massKg () {
375381 return 0.27 ;
@@ -401,7 +407,7 @@ private static final class HubLastPoseCache {
401407 volatile int lastSolveObsHash ;
402408
403409 volatile long lastRefineNs ;
404- volatile DragShotPlanner . ShotSolution lastSolution ;
410+ volatile ShotSolution lastSolution ;
405411 }
406412
407413 private static final double [][] SIMPLE_OFFS =
@@ -523,8 +529,8 @@ private static Pose2d findFastValidPose(
523529 return safeValidFallback (targetFieldPos , halfL , halfW , obs );
524530 }
525531
526- public static final DragShotPlanner . Constraints HUB_SHOT_CONSTRAINTS =
527- new DragShotPlanner . Constraints (0 , 30 , 0 , 45.0 , DragShotPlanner . Constraints .ShotStyle .ARC );
532+ public static final Constraints HUB_SHOT_CONSTRAINTS =
533+ new Constraints (0 , 30 , 0 , 45.0 , Constraints .ShotStyle .ARC );
528534
529535 public static final int BLUE_HUB_ANCHOR_TAG_ID = 20 ;
530536 public static final int BLUE_OUTPOST_ANCHOR_TAG_ID = 13 ;
@@ -556,7 +562,7 @@ public static Translation2d hubAimpointForAlliance(Alliance alliance) {
556562 return alliance == Alliance .Red ? flipToRed (blue ) : blue ;
557563 }
558564
559- public static Optional <DragShotPlanner . ShotSolution > getHubShotSolution (SetpointContext ctx ) {
565+ public static Optional <ShotSolution > getHubShotSolution (SetpointContext ctx ) {
560566 if (ctx == null || ctx .robotPose ().isEmpty ()) {
561567 return Optional .empty ();
562568 }
@@ -586,8 +592,8 @@ private record HubShotCacheKey(
586592
587593 private static final ConcurrentHashMap <HubShotCacheKey , HubShotLibraryState > HUB_LIB_CACHE =
588594 new ConcurrentHashMap <>();
589- private static final ConcurrentHashMap <HubShotCacheKey , DragShotPlanner . OnlineSearchState >
590- HUB_ONLINE_STATE = new ConcurrentHashMap <>();
595+ private static final ConcurrentHashMap <HubShotCacheKey , OnlineSearchState > HUB_ONLINE_STATE =
596+ new ConcurrentHashMap <>();
591597 private static final ConcurrentHashMap <HubShotCacheKey , HubLastPoseCache > HUB_LAST_POSE =
592598 new ConcurrentHashMap <>();
593599
@@ -598,20 +604,20 @@ private record HubShotCacheKey(
598604
599605 private static final class HubShotLibraryState {
600606 final HubShotCacheKey key ;
601- final DragShotPlanner . GamePiecePhysics physics ;
607+ final GamePiecePhysics physics ;
602608 final Translation2d targetFieldPos ;
603609 final double releaseH ;
604610 final double halfL ;
605611 final double halfW ;
606612
607- volatile DragShotPlanner . ShotLibrary published ;
613+ volatile ShotLibrary published ;
608614 volatile boolean done ;
609615 final Object lock = new Object ();
610- DragShotPlanner . ShotLibraryBuilder builder ;
616+ ShotLibraryBuilder builder ;
611617
612618 HubShotLibraryState (
613619 HubShotCacheKey key ,
614- DragShotPlanner . GamePiecePhysics physics ,
620+ GamePiecePhysics physics ,
615621 Translation2d targetFieldPos ,
616622 double releaseH ,
617623 double halfL ,
@@ -679,7 +685,7 @@ private static void hubBackgroundTick() {
679685 double bearingStep = 12.0 ;
680686
681687 st .builder =
682- new DragShotPlanner . ShotLibraryBuilder (
688+ new ShotLibraryBuilder (
683689 st .physics ,
684690 st .targetFieldPos ,
685691 HUB_OPENING_FRONT_EDGE_HEIGHT_M ,
@@ -692,7 +698,7 @@ private static void hubBackgroundTick() {
692698 radialStep ,
693699 bearingStep );
694700 }
695- DragShotPlanner . ShotLibrary publish = st .builder .maybeStep (900_000L );
701+ ShotLibrary publish = st .builder .maybeStep (900_000L );
696702 if (publish != null ) {
697703 if (!publish .entries ().isEmpty () || publish .complete ()) {
698704 st .published = publish ;
@@ -706,8 +712,8 @@ private static void hubBackgroundTick() {
706712 }
707713 }
708714
709- private static DragShotPlanner . ShotLibrary getOrStartHubLibrary (
710- DragShotPlanner . GamePiecePhysics physics ,
715+ private static ShotLibrary getOrStartHubLibrary (
716+ GamePiecePhysics physics ,
711717 Translation2d targetFieldPos ,
712718 double releaseH ,
713719 double halfL ,
@@ -728,15 +734,14 @@ private static DragShotPlanner.ShotLibrary getOrStartHubLibrary(
728734 key ,
729735 k -> new HubShotLibraryState (k , physics , targetFieldPos , releaseH , halfL , halfW ));
730736
731- DragShotPlanner . ShotLibrary pub = st .published ;
737+ ShotLibrary pub = st .published ;
732738 if (pub != null ) return pub ;
733739 return null ;
734740 }
735741
736- private static DragShotPlanner . OnlineSearchState getOrCreateOnlineState (
742+ private static OnlineSearchState getOrCreateOnlineState (
737743 HubShotCacheKey key , Translation2d seed ) {
738- return HUB_ONLINE_STATE .computeIfAbsent (
739- key , k -> new DragShotPlanner .OnlineSearchState (seed , 0.58 ));
744+ return HUB_ONLINE_STATE .computeIfAbsent (key , k -> new OnlineSearchState (seed , 0.58 ));
740745 }
741746
742747 private static HubShotCacheKey hubKey (
@@ -902,12 +907,11 @@ private static Pose2d computeShootPose(SetpointContext ctx, Translation2d target
902907
903908 Translation2d seed = simple .getTranslation ();
904909
905- DragShotPlanner .ShotLibrary lib =
906- getOrStartHubLibrary (HUB_PHYSICS , targetFieldPos , releaseH , halfL , halfW );
910+ ShotLibrary lib = getOrStartHubLibrary (HUB_PHYSICS , targetFieldPos , releaseH , halfL , halfW );
907911
908- DragShotPlanner . ShotSolution libSol = null ;
912+ ShotSolution libSol = null ;
909913 if (lib != null && !lib .entries ().isEmpty ()) {
910- Optional <DragShotPlanner . ShotSolution > opt =
914+ Optional <ShotSolution > opt =
911915 DragShotPlanner .findBestShotFromLibrary (
912916 lib ,
913917 HUB_PHYSICS ,
@@ -925,7 +929,7 @@ private static Pose2d computeShootPose(SetpointContext ctx, Translation2d target
925929 }
926930 }
927931
928- DragShotPlanner . OnlineSearchState online = getOrCreateOnlineState (key , seed );
932+ OnlineSearchState online = getOrCreateOnlineState (key , seed );
929933
930934 int mdx = Math .abs (rxmm - state .lastSolveRobotXmm );
931935 int mdy = Math .abs (rymm - state .lastSolveRobotYmm );
@@ -950,10 +954,10 @@ private static Pose2d computeShootPose(SetpointContext ctx, Translation2d target
950954
951955 boolean allowRefine = !haveRecentSol && sinceRefine >= 120_000_000L ;
952956
953- DragShotPlanner . ShotSolution refinedSol = null ;
957+ ShotSolution refinedSol = null ;
954958 if (allowRefine ) {
955959 long refineBudgetNs = useObs ? 160_000L : 120_000L ;
956- Optional <DragShotPlanner . ShotSolution > refined =
960+ Optional <ShotSolution > refined =
957961 DragShotPlanner .findBestShotOnlineRefine (
958962 HUB_PHYSICS ,
959963 targetFieldPos ,
@@ -974,7 +978,7 @@ private static Pose2d computeShootPose(SetpointContext ctx, Translation2d target
974978 }
975979 }
976980
977- DragShotPlanner . ShotSolution sol = refinedSol != null ? refinedSol : libSol ;
981+ ShotSolution sol = refinedSol != null ? refinedSol : libSol ;
978982
979983 Pose2d out ;
980984 if (sol == null ) {
0 commit comments