Log in

View Full Version : Getting data from RoboRealm into C++


EmmettNervend
15-02-2014, 19:16
We're trying to create a targeting program for this year's competition using RoboRealm. We have been able to create a .robo that accurately reads distance from a hot goal. It includes the Network_Tables layer and we have told it to send our value for distance to the SmartDashboard according to this guide:
http://www.roborealm.com/help/Network_Tables.php
We didn't have any success with this tutorial or any of the others we found.

Have any of you been able to get values from RoboRealm into C++ code? Are there any good tutorials out there?

bvisness
16-02-2014, 19:31
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:

SmartDashboard::GetNumber("YOUR_VARIABLE_NAME");

So in your case, it would probably be something like:

double distance = SmartDashboard::GetNumber("DISTANCE");

BradAMiller
23-02-2014, 08:56
This is for java but should be easy to translate. http://wpilib.screenstepslive.com/s/3120/m/7912/l/171861-using-networktables-with-roborealm