Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Using Network Tables (http://www.chiefdelphi.com/forums/showthread.php?t=111591)

Arhowk 19-01-2013 11:45

Using Network Tables
 
Can I send this line

ColorImage image = camera.getImage()

to a folder on the driver station?

BradAMiller 19-01-2013 11:53

Re: Using Network Tables
 
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

Re: Using Network Tables
 
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

Re: Using Network Tables
 
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

Re: Using Network Tables
 
Quote:

Originally Posted by Arhowk (Post 1218611)
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

Re: Using Network Tables
 
Quote:

Originally Posted by SuperMario (Post 1218631)
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 =

Code:

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

Re: Using Network Tables
 
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

Re: Using Network Tables
 
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

Re: Using Network Tables
 
Quote:

Originally Posted by F22Rapture (Post 1218729)
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)

Quote:

Originally Posted by mitchellweb1 (Post 1218737)
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

Re: Using Network Tables
 
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

Re: Using Network Tables
 
Quote:

Originally Posted by Arhowk (Post 1219511)
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

Re: Using Network Tables
 
Quote:

Originally Posted by MagiChau (Post 1219563)
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

Re: Using Network Tables
 
bump

Arhowk 22-01-2013 18:37

Re: Using Network Tables
 
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

Re: Using Network Tables
 
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.


All times are GMT -5. The time now is 10:08.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi