Log in

View Full Version : Using Network Tables


Arhowk
19-01-2013, 11:45
Can I send this line

ColorImage image = camera.getImage()

to a folder on the driver station?

BradAMiller
19-01-2013, 11:53
NetworkTables doesn't send large data items like images from the robot to the laptop. However, if your goal is to process the image on the driver station computer, you can connect the camera to the switch on your robot and just open it from the laptop. There are several ways of doing that. You can write a program with RoboRealm for doing the image processing. You can write your own program using some library like OpenCV or the NIVision library, or you can make a SmartDashboard plugin that does the image processing.

If you want to do the vision processing on the robot, then there are some sample Java programs for robot-side target detection in NetBeans.

Brad

Arhowk
19-01-2013, 14:39
e/ Changing the focus of this thread!!

Whenever im using RoboRealms, I can add the Network Table widget to the current setup, set the ip to 10.16.84.2, set the default camera to none, but when i run the program its not going to the axis camera on the robot its booting my webcam!

Options>Video>Camera only has two settings, Nothing and my camera. (default to nothing)

SuperMario
19-01-2013, 15:09
I'm not sure what you are asking, but you can access the ip of the camera and see the feed from any computer.

MagiChau
19-01-2013, 16:55
e/ Changing the focus of this thread!!

Whenever im using RoboRealms, I can add the Network Table widget to the current setup, set the ip to 10.16.84.2, set the default camera to none, but when i run the program its not going to the axis camera on the robot its booting my webcam!

Options>Video>Camera only has two settings, Nothing and my camera. (default to nothing)

You have to use the AxisCamera module on RoboRealm. That is the only way I know of you are going to get a feed on RoboRealm.

Arhowk
19-01-2013, 16:56
I'm not sure what you are asking, but you can access the ip of the camera and see the feed from any computer.

k, nevermind, thread derail again... (Forgot to add the axis intenet camera module)

how do i instantiate a network table?

cameraTable = NetworkTable.getTable("RoboRealm");

gives me an error

Illegal State Exception : network table already initialized

(if i catch the error, it does nothing)

e/ nevermind.

current problem =

public void testPeriodic() {
enabledPeriodic();
NetworkTable server = NetworkTable.getTable("SmartDashboard");
try
{
System.out.println(server.getNumber("IMAGE_COUNT", -1.0));
}
catch (TableKeyNotDefinedException ex)
{
}

}
continually prints -1

my robo builder setup:

Axis_Internet_Camera 10.16.84.11
Threshhold 200-255 (sat)
Fill 500
Convex Hull
set IMAGE_COUNT = /SmartDashboad/IMAGE_COUNT
Network_Tables (port 1765, ip 10.16.84.2, send : IMAGE_COUNT)

F22Rapture
19-01-2013, 17:42
So... is there a way to have the Roborealm server process the Axis camera images, then send those images to the SmartDashboard so that we can see the processed output?

mitchellweb1
19-01-2013, 17:53
You can try using the TableViewer to ensure that the key that you are expecting is actually in NetworkTables. You can find it in C:/Users/YOURUSERNAME/sunspotfrcsdk/tools/TableViewer-VERSION.jar
This will allow you to connect to a networktables server and view the raw entries.

Arhowk
19-01-2013, 18:41
So... is there a way to have the Roborealm server process the Axis camera images, then send those images to the SmartDashboard so that we can see the processed output?

what. why would you want to do that.

(yes, just have roborealm save to a file than have smartdashboard read to file)

You can try using the TableViewer to ensure that the key that you are expecting is actually in NetworkTables. You can find it in C:/Users/YOURUSERNAME/sunspotfrcsdk/tools/TableViewer-VERSION.jar
This will allow you to connect to a networktables server and view the raw entries.

Your right... the entires arent there... but IMAGE_COUNT (in no subfolder) is

Arhowk
21-01-2013, 14:06
bump...

set IMAGE_COUNT = /SmartDashboard/IMAGE_COUNT

in RoboRealm isnt working and it keeps saving to IMAGE_COUNT. What would the proper configuration be for seting IMAGE_COUNT to /SmartDashboard/IMAGE_COUNT OR can i get IMAGE_COUNT from the crio root?

(to rehash the thread)

MagiChau
21-01-2013, 15:24
bump...

set IMAGE_COUNT = /SmartDashboard/IMAGE_COUNT

in RoboRealm isnt working and it keeps saving to IMAGE_COUNT. What would the proper configuration be for seting IMAGE_COUNT to /SmartDashboard/IMAGE_COUNT OR can i get IMAGE_COUNT from the crio root?

(to rehash the thread)

you have to set /SmartDashboard/IMAGE_COUNT = IMAGE_COUNT

The left side is for the variable you are setting. The right is for setting the value of that varaible.

Arhowk
21-01-2013, 18:02
you have to set /SmartDashboard/IMAGE_COUNT = IMAGE_COUNT

The left side is for the variable you are setting. The right is for setting the value of that varaible.

... almost there....

ok i got that. it didnt work. than i sent /SmartDashboard/IMAGE_COUNT and it *almost* worked.

It sent it once. but thats it. it will NOT overwrite the values. it will create them and send them but not overwrite

using Set_Variable, i set GG = 123
i sent GG
TableViewer says GG = 123

i set GG = 234 (in RoboRealm)
i send GG
TableViewer says GG = 123

i make a new variable GG1
i set GG1 = 234
i send GG1
TableViewer says GG1 = 234, GG = 123

Arhowk
22-01-2013, 14:24
bump

Arhowk
22-01-2013, 18:37
ok it seemed to work by installing the mid-season update but now it refuses to send arrays!

i can send whatever values i want but I put in the blob filter and tried to send BFR_COORDINATES and nothing was sent. i can swap it out for something like IMAGE_WIDTH or IMAGE_COUNT and it sends just fine but just nothing sends when i send BFR_COORDINATES

on the other hand, how do you send arrays via NetworkTable anyway...

RoboRealm
23-01-2013, 02:37
If you have trouble sending arrays you can always use the Set_Variable module and set something like

/SmartDashboard/coord1x

to

BFR_COORDINATES:0

i.e. 0 is the first value of the BFR_COORDINATES. Likewise BFR_COORDINATES:1 would be the second (coord1y) and so on. Assuming you only want to send the first 4 coordinates this is a possible way to itemize each of the array values and send them individually.

STeven.

Arhowk
23-01-2013, 15:44
If you have trouble sending arrays you can always use the Set_Variable module and set something like

/SmartDashboard/coord1x

to

BFR_COORDINATES:0

i.e. 0 is the first value of the BFR_COORDINATES. Likewise BFR_COORDINATES:1 would be the second (coord1y) and so on. Assuming you only want to send the first 4 coordinates this is a possible way to itemize each of the array values and send them individually.

STeven.

do you actually work with roborealm or is that just your name? :

E/ this isn't working, the very top value keeps being set to the very bottom value (in network tables)

So if I set sdfd = 1233, suffer = 3455, it will only update sdfd to 3455

Arhowk
23-01-2013, 20:04
do you actually work with roborealm or is that just your name? :

E/ this isn't working, the very top value keeps being set to the very bottom value (in network tables)

So if I set sdfd = 1233, suffer = 3455, it will only update sdfd to 3455

Restarting the c/rio over and over again worked.

Almost there, my problem now is that COORDINATES:6 is EVIL! whenever i try to send to COORDINATES:6, it sends it to either COORDINATES:4 or COORDINATES:5. restarting my computer, crio, my .robo file, etc. dont work