Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   GRIP with kangaroo (http://www.chiefdelphi.com/forums/showthread.php?t=143761)

1024Programming 13-02-2016 12:19

GRIP with kangaroo
 
We are trying to use grip with a Kangaroo. We have followed the screensteps documentation but it doesn't have a lot of information about running grip on startup. We are using this code to try and send values from the kangaroo network tables to the rio network tables:
Code:

import edu.wpi.first.wpilibj.networktables.NetworkTable;

public class main {
        public static void main(String[] args){
                NetworkTable localTable;
                NetworkTable rioTable;
                while(true){
                        NetworkTable.setClientMode();
                        localTable = NetworkTable.getTable("localhost");
                        rioTable = NetworkTable.getTable("10.10.24.62");
                        double[] centerx =localTable.getNumberArray("centerX", new double[0]);
                        double[] centery =localTable.getNumberArray("centerY", new double[0]);
                        double[] area =localTable.getNumberArray("area", new double[0]);
                        double[] height =localTable.getNumberArray("height", new double[0]);
                        double[] width =localTable.getNumberArray("width", new double[0]);
                        double[] solidity =localTable.getNumberArray("solidity", new double[0]);
                        for (int i = 0; i < centerx.length; i++) {
                                rioTable.putNumber("CenterX", centerx[i]);
                        }
                        for (int i = 0; i < centery.length; i++) {
                                rioTable.putNumber("CenterY", centery[i]);
                        }
                        for (int i = 0; i < area.length; i++) {
                                rioTable.putNumber("Area", area[i]);
                        }
                        for (int i = 0; i < height.length; i++) {
                                rioTable.putNumber("Height", height[i]);
                        }
                        for (int i = 0; i < width.length; i++) {
                                rioTable.putNumber("Width", width[i]);
                        }
                        for (int i = 0; i < solidity.length; i++) {
                                rioTable.putNumber("Solidity", solidity[i]);
                        }
                }
        }
}

we get this error when compiling:
Code:

platform: /Windows/amd64/
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ntcore in java.library.path
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at edu.wpi.first.wpilibj.networktables.NetworkTablesJNI.<clinit>(NetworkTablesJNI.java:57)
        at edu.wpi.first.wpilibj.networktables.NetworkTable.initialize(NetworkTable.java:42)
        at edu.wpi.first.wpilibj.networktables.NetworkTable.getTable(NetworkTable.java:176)
        at main.main(main.java:9)

If someone knows a way to do this or a solution to our code, please let us know.

Peter Johnson 13-02-2016 13:28

Re: GRIP with kangaroo
 
You're likely using a NetworkTables jar file for the roboRio instead of for Windows. You should grab the latest -desktop.jar file from http://first.wpi.edu/FRC/roborio/mav....0.0-SNAPSHOT/

Also, I'm not sure what you're trying to accomplish with the lines localTable = NetworkTable.getTable("localhost"); rioTable = NetworkTable.getTable("10.10.24.62");. The roboRio is the server, so you just need to set the server address, upon connection, all tables will be communicated/synchronized between all clients connected to that server.


All times are GMT -5. The time now is 00:38.

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