TeamCode/src/main/java/org/firstinspires/ftc/teamcode/util/RingPickupPathGenerator.java
/**
     * Define a line segment from the current robot position to shooting position, select
     * the rings that are close to this line segment.  If ring is too close to the wall, add
     * distance adjustment to that ring before ranking
     * @return selected rings
     */
Define a line segment from the current robot position to shooting position, select
the rings that are close to this line segment.  If ring is too close to the wall, add
distance adjustment to that ring before ranking
@return selected rings
Define a line segment from the current robot position to shooting position select the rings that are close to this line segment . If ring is too close to the wall add distance adjustment to that ring before ranking @return selected rings
ArrayList<Vector2d> selectRings(ArrayList<Vector2d> rings) {
        Line segLine = new Line(new Vector2D(startPose.getX(), startPose.getY()), new Vector2D(endPose.getX(), endPose.getY()), 0);
        Segment seg = new Segment(new Vector2D(startPose.getX(), startPose.getY()), new Vector2D(endPose.getX(), endPose.getY()), segLine);
        DistToSeg comp = new DistToSeg(walls, seg);
        ArrayList<Vector2d> tmp = new ArrayList<Vector2d>(rings);
        tmp.sort(comp);
        ArrayList<Vector2d> resp = new ArrayList<Vector2d>();
        for(int i=0; i<Math.min(6, tmp.size()); i++) {
            resp.add(tmp.get(i));
        }
        return resp;
    }
ArrayList < Vector2d > selectRings ( ArrayList < Vector2d > rings ) { Line segLine = new Line ( new Vector2D ( startPose . getX ( ) , startPose . getY ( ) ) , new Vector2D ( endPose . getX ( ) , endPose . getY ( ) ) , 0 ) ; Segment seg = new Segment ( new Vector2D ( startPose . getX ( ) , startPose . getY ( ) ) , new Vector2D ( endPose . getX ( ) , endPose . getY ( ) ) , segLine ) ; DistToSeg comp = new DistToSeg ( walls , seg ) ; ArrayList < Vector2d > tmp = new ArrayList < Vector2d > ( rings ) ; tmp . sort ( comp ) ; ArrayList < Vector2d > resp = new ArrayList < Vector2d > ( ) ; for ( int i = 0 ; i < Math . min ( 6 , tmp . size ( ) ) ; i ++ ) { resp . add ( tmp . get ( i ) ) ; } return resp ; }
Define a line segment from the current robot position to shooting position, select
 the rings that are close to this line segment.
Define a line segment from the current robot position to shooting position select the rings that are close to this line segment .
// sort the rings by their distance to the segment