As soon as RoboRealm starts putting values on the Network Tables, then you should see them on the SmartDashboard. Once it's displayed on the SmartDashboard, all you have to do is use this line of code:
Code:
SmartDashboard::GetNumber("YOUR_VARIABLE_NAME");
So in your case, it would probably be something like:
Code:
double distance = SmartDashboard::GetNumber("DISTANCE");