Go to Post DONT USE ROBOTS FOR EVIL!!! - Cooley744 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2016, 12:19
1024Programming 1024Programming is offline
Registered User
FRC #1024
 
Join Date: Jan 2014
Location: Indiana
Posts: 43
1024Programming is an unknown quantity at this point
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.
  #2   Spotlight this post!  
Unread 13-02-2016, 13:28
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 254
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
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.
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)

Last edited by Peter Johnson : 13-02-2016 at 13:40.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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