We are having some problems with networking, specifically with communications between the cRIO and RoboRealm. In RoboRealm script, we do our image processing, and then use the Set Variables module to reset the FPS and IMAGE_COUNT variables to /tableName/FPS and /tableName/IMAGE_COUNT to enable use over the network. Then we use the Network_Tables module to send those two variables over the network and to receive variables written in Java, the X value of our joystick and just a static number called test. Finally we display all 4 of those variables over our image so we can compare the values we are getting. We also have the internal version of the IMAGE_COUNT variable displayed, not only the network specific one.
On the Java side, we are using the .getNumber(“name”, default_value) method to receive the IMAGE_COUNT and FPS values, and then we are using the putNumber(“name”, default_value) method to send the joystick X value and our static test variable.
We have opened a the table with the getTable(“tableName”) method, and it matches the name that we rename the variables to with the Set_Variables. We have all of our IP addresses set correctly, and there are communications.
We are getting some very interesting results. On the SmartDashboard and through TableViewer we get strange numbers. The actual IMAGE_COUNT value according to RoboRealms seems to go to the value, and the read FPS value according to RoboRealms does not directly translate to the Java-read IMAGE_COUNT. For example, if RoboRealms says the FPS is 29.4, the IMAGE_COUNT on the SmartDashboard/TableViewer will say it’s 58 or something similar. The values do not seem to be related (even though in the given example it seems to be roughly double the FPS).
We can send the test variable and have that displays the correct value in RoboRealm, but we can not get the joystick value to update, it seems to show only the last read value by the joystick before disabling.
So our question is, how do you do successfully send data between Java and RoboRealm? We can post actual code from either end if needed.
Im playing with it and its extremely buggy. IMAGE_COUNT will return the number of images processed. The variable you want is BOUNDARY_COORDINATES which is generated when using a blob_filter or a blob_replace
but the issue im currently working with is that RoboRealm only sends BOUNDAY_COORDINATES once than stops sending it.
Hey, I’m one of the Shazbots programmers. We do want IMAGE_COUNT just for testing purposes to make sure things are behaving correctly.
So by the end of the night, we found out some interesting things.
In order for things to behave correctly, you must close run the code and THEN open RoboRealm.
Almost all of the RoboRealm default variables are strings, so it sometimes breaks when you try to use getNumber(). (But it doesn’t always break.)
RoboRealm seems to have issues with variables…
Really, we had one variable switch between a String and a Decimal (defined by RoboRealm) because the variable above was a String and below was a Decimal, so it kept alternating between the two values. We don’t know why.
Has anyone else gotten this working? Or does anyone else have these problems?
I just sent the support peoples a couple PM and… well… everything works fine (Except for the error mentioned above)
make sure your “send variable type” is ALWAYS string, because if you try to set it to Automatic it will try to send strings as doubles which screws stuff up. I’ve been able to get a blob, get the corners, but when i try to send the string containing the co-ordinates it doesnt send. Make sure that your updated to 2.48.19
Hey, so it turns out that we had not updated to the newest version of RoboRealm. We are now running RoboRealm version 2.48.20 (We updated today). We have also changed the sent variable type from automatic to string, like you suggested, and it seems to work perfectly. We are now going to start sending useful things, such as the BFR Coordinates and Bounding coordinates. If we encounter any more problems, we’ll post them here. Thanks for your help. -Trent