Using Limelight To Detect Distance and/or Follow Path (Java)

Hello, I was wondering if anyone has figured out how to accurately calculate distance using Limelight 2 and create a path to get to the loading station/cargo ship/rocket. We have tried using width of the threshold in pixels and inches as a ratio to the width of the entire camera view and then applied a little bit of geometry to receive the distance (camera resolution to inches / 2tan(27)), but have not been able to take into account the skew and align the robot parallel to the loading station/cargo ship/rocket. To follow up with that, is there a way to generate a motion profile or a spline for the drive train to follow based on vision input?

Thanks, Maanit