Log in

View Full Version : Can't figure out Roborealm. Need distance variable


l0stboy
28-01-2013, 22:35
Hello. I'm completely new to Roborealm, but I know my way around the WPI Java stuff. I'm having a hard time understanding the Roborealm tutorial. I have the given sequence of modules given here :http://www.roborealm.com/FRC2013/slide060.php

However, when I try to use Network Tables, I can't seem to find the option to send the distance variables or have anything with "SmartDashboard" show up as it has it here: http://www.roborealm.com/help/Network_Tables.php


My end goal is to have Roborealm process the image in order to send over the distance variable to the cRIO for shooting processing.

Also, what would I use the SmartDashboard to do with the camera. I'm also having trouble getting the camera image showing up on the Driver Station.

Help would be very much appreciated.

~Cory~
28-01-2013, 23:06
Use a "Set Variable" module to rename the variable
13709

l0stboy
30-01-2013, 21:00
So would the pane on the left be what we want to call the variable in Java and then the right is what the variable is in Roborealm?

RoboRealm
01-02-2013, 15:40
Pedro,

The left is what exists in the network tables system, and the right is what exists in RoboRealm. So, yes, if you are using Java to access the network tables system then that would be the variable that you need to query i.e. /SmartDashboard/Distance. The reason for the /SmartDashboard/ prefix is so that it also shows up in the SmartDashboard app which uses that prefix as its namespace.

Note that we updated the robofile in

http://www.roborealm.com/FRC2013/slide060.php

to include the network tables module with the Set_Variable module to rename them into the SDB namespace.

STeven.

l0stboy
03-02-2013, 23:11
Ah, I get it now. So would my code look like this to get the distance value out of RoboRealm and into the cRIO?

NetworkTable server = NetworkTable.getTable("SmartDashboard");
try
{
System.out.println(server.getNumber("Distance", 0.0));
}
catch (TableKeyNotDefinedException ex)
{
}

RoboRealm
04-02-2013, 02:09
Yup, that's right. That's why you need to rename or call the variable with the /SmartDashboard/ prefix in it. The call to getTable needs that.

STeven.