Go to Post It all depends on which box your trying to think outside. - ItsPat [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-01-2017, 20:55
kmckay's Avatar
kmckay kmckay is offline
Registered User
FRC #5401 (Fightin' Robotic Owls)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Bensalem, PA
Posts: 47
kmckay will become famous soon enough
Network Tables: Please explain like I'm 5

Specifically running it outside a robot program on a Win10 laptop and on a raspberry pi.
Assume I don't know anything about Maven repositories, or native paths, or external jars... because I don't.
Reply With Quote
  #2   Spotlight this post!  
Unread 11-01-2017, 22:00
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 377
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Network Tables: Please explain like I'm 5

I can explain how to use it, if that's what you want.

1. Clone https://github.com/wpilibsuite/ntcore
2.
Code:
./gradlew :native:build -PskipArm
3. Find built desktop NetworkTables JAR (<place you cloned>/native/build/libs)
4. Use JARs in project
Code:
NetworkTable.setClientMode();
NetworkTable.setNetworkIdentity("Name of my coprocessor or DS or whatever");
NetworkTable.setTeamNumber(5401);
NetworkTable.initialize();

// now get the network table that corresponds to the SmartDashboard class of WPILib
NetworkTable smartDash = NetworkTable.getTable("SmartDashboard");

// now use table to put data
smartDash.putNumber("VisionAngle", 42.0);
For the pi, you'll need to download a pi toolchain
Then,
Code:
./gradlew :arm:build -PcompilerPrefix="C:\Path\To\RPi\Toolchain\bin\arm-linux-gnueabihf-"
Find build probably in <place you cloned>/arm/build/libs
Use JARs in code on Pi as above
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #3   Spotlight this post!  
Unread 12-01-2017, 03:48
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,106
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Network Tables: Please explain like I'm 5

I am actually working on a gradle build system to automatically set up for running on either a Raspberry Pi or a Windows desktop. You can see the example at https://github.com/wpilibsuite/Visio...ee/master/Java, and can download the zip with the entire setup at http://first.wpi.edu/FRC/roborio/cop...JavaGradle.zip.

The Readme has instructions on how to set everything up. It's built for running camera processing, but it's fairly easy to make it just do networktables, as its already setup to connect to networktables.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
Reply With Quote
  #4   Spotlight this post!  
Unread 12-01-2017, 08:38
kmckay's Avatar
kmckay kmckay is offline
Registered User
FRC #5401 (Fightin' Robotic Owls)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Bensalem, PA
Posts: 47
kmckay will become famous soon enough
Re: Network Tables: Please explain like I'm 5

Quote:
Originally Posted by Thad House View Post
I am actually working on a gradle build system to automatically set up for running on either a Raspberry Pi or a Windows desktop. You can see the example at https://github.com/wpilibsuite/Visio...ee/master/Java, and can download the zip with the entire setup at http://first.wpi.edu/FRC/roborio/cop...JavaGradle.zip.

The Readme has instructions on how to set everything up. It's built for running camera processing, but it's fairly easy to make it just do networktables, as its already setup to connect to networktables.
Conveniently, I'm trying to use it for camera processing
Will review, thanks.
Reply With Quote
  #5   Spotlight this post!  
Unread 12-01-2017, 11:15
TimO TimO is offline
Registered User
AKA: Tim Ohling
FRC #4662 (Byte Size)
Team Role: Mentor
 
Join Date: Feb 2013
Rookie Year: 2013
Location: Scappoose
Posts: 4
TimO is an unknown quantity at this point
Re: Network Tables: Please explain like I'm 5

This looks like something we can use. But:
<click on link>
Forbidden

You don't have permission to access /FRC/roborio/coprocessors/JavaGradle.zip on this server.



TimO
Reply With Quote
  #6   Spotlight this post!  
Unread 12-01-2017, 12:54
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,106
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Network Tables: Please explain like I'm 5

Quote:
Originally Posted by TimO View Post
This looks like something we can use. But:
<click on link>
Forbidden

You don't have permission to access /FRC/roborio/coprocessors/JavaGradle.zip on this server.



TimO
Hmm looks like the link is having issues. I pushed a version of it to the GitHub release page, which can be found here https://github.com/wpilibsuite/Visio...ses/tag/v0.0.1. The zip is just a zip of the repo, so you could also just clone the repo.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
Reply With Quote
  #7   Spotlight this post!  
Unread 12-01-2017, 20:41
kmckay's Avatar
kmckay kmckay is offline
Registered User
FRC #5401 (Fightin' Robotic Owls)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Bensalem, PA
Posts: 47
kmckay will become famous soon enough
Re: Network Tables: Please explain like I'm 5

Quote:
Originally Posted by Thad House View Post
I am actually working on a gradle build system to automatically set up for running on either a Raspberry Pi or a Windows desktop. You can see the example at https://github.com/wpilibsuite/Visio...ee/master/Java, and can download the zip with the entire setup at http://first.wpi.edu/FRC/roborio/cop...JavaGradle.zip.

The Readme has instructions on how to set everything up. It's built for running camera processing, but it's fairly easy to make it just do networktables, as its already setup to connect to networktables.
With the standard WPIlibraries installed, do I need to do anything to run in eclipse for testing purposes? I am getting an ntcore not found. I have the import statement, the jar's in the build path...
Reply With Quote
  #8   Spotlight this post!  
Unread 12-01-2017, 21:46
TimO TimO is offline
Registered User
AKA: Tim Ohling
FRC #4662 (Byte Size)
Team Role: Mentor
 
Join Date: Feb 2013
Rookie Year: 2013
Location: Scappoose
Posts: 4
TimO is an unknown quantity at this point
Re: Network Tables: Please explain like I'm 5

@Thad
thanks - the gradle setup works for me. Appreciate the effort setting it up.
Reply With Quote
  #9   Spotlight this post!  
Unread 12-01-2017, 23:21
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,106
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Network Tables: Please explain like I'm 5

Quote:
Originally Posted by kmckay View Post
With the standard WPIlibraries installed, do I need to do anything to run in eclipse for testing purposes? I am getting an ntcore not found. I have the import statement, the jar's in the build path...
I don't know if that project will properly import into Eclipse. Haven't built with eclipse much. Although if you're getting an ntcore not found error, you probably have the wrong version set in the build script. Make sure it's set for windows if you are trying to run it on windows.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
Reply With Quote
  #10   Spotlight this post!  
Unread 13-01-2017, 05:19
kmckay's Avatar
kmckay kmckay is offline
Registered User
FRC #5401 (Fightin' Robotic Owls)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Bensalem, PA
Posts: 47
kmckay will become famous soon enough
Re: Network Tables: Please explain like I'm 5

Quote:
Originally Posted by Thad House View Post
I don't know if that project will properly import into Eclipse. Haven't built with eclipse much. Although if you're getting an ntcore not found error, you probably have the wrong version set in the build script. Make sure it's set for windows if you are trying to run it on windows.
I wasn't specifically using your code there. I went cross-eyed at "Gradle". I will figure that out eventually but not sure that will be during build season. I know there was an online Gradle training recently but build season.

But I did read your code, and try to mimic the NT lines. I had posted a question to the GRIP gutter chat and was told the set server and set team number were unnecessary in the latest versions of nt. Not true?

I'm beating my head against a wall here. I know this is going to be the simplest, stupidest answer, and I'm 90% sure it's in my eclipse build path and not in the code. But every answer seems to require 6 more questions.
Reply With Quote
  #11   Spotlight this post!  
Unread 13-01-2017, 09:58
kmckay's Avatar
kmckay kmckay is offline
Registered User
FRC #5401 (Fightin' Robotic Owls)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Bensalem, PA
Posts: 47
kmckay will become famous soon enough
Re: Network Tables: Please explain like I'm 5

Based on the error I'm getting, its picking up the libraries just fine. Within the libraries, when it executes the System.loadlibrary(ntcore) it can't find the file. It looks like on a windows system its looking for a windows directory. Should there be an ntcore.dll somewhere in my windows directories?
Reply With Quote
  #12   Spotlight this post!  
Unread 13-01-2017, 12:12
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,106
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Network Tables: Please explain like I'm 5

Quote:
Originally Posted by kmckay View Post
Based on the error I'm getting, its picking up the libraries just fine. Within the libraries, when it executes the System.loadlibrary(ntcore) it can't find the file. It looks like on a windows system its looking for a windows directory. Should there be an ntcore.dll somewhere in my windows directories?
It should automatically be extracting the library. Which Jar are you using. There is an Arm jar, which is what you would have if you got NetworkTables from eclipse, and the is a Desktop Jar, which has all the native libraries for desktop systems. The Arm jar doesn't include any of the libraries for windows or other systems. You can get the desktop version from here. http://first.wpi.edu/FRC/roborio/mav...kTables/3.1.5/. Just download the version that ends with -desktop.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
Reply With Quote
  #13   Spotlight this post!  
Unread 13-01-2017, 12:37
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,106
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Network Tables: Please explain like I'm 5

Quote:
Originally Posted by kmckay View Post
I wasn't specifically using your code there. I went cross-eyed at "Gradle". I will figure that out eventually but not sure that will be during build season. I know there was an online Gradle training recently but build season.

But I did read your code, and try to mimic the NT lines. I had posted a question to the GRIP gutter chat and was told the set server and set team number were unnecessary in the latest versions of nt. Not true?

I'm beating my head against a wall here. I know this is going to be the simplest, stupidest answer, and I'm 90% sure it's in my eclipse build path and not in the code. But every answer seems to require 6 more questions.
If you want to run on a device other then the rio, you want to be using setClientMode() and setTeam(). That will connect to the roboRIO, since the roboRIO is by default the server.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
Reply With Quote
  #14   Spotlight this post!  
Unread 13-01-2017, 16:42
kmckay's Avatar
kmckay kmckay is offline
Registered User
FRC #5401 (Fightin' Robotic Owls)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Bensalem, PA
Posts: 47
kmckay will become famous soon enough
Re: Network Tables: Please explain like I'm 5

Quote:
Originally Posted by Thad House View Post
It should automatically be extracting the library. Which Jar are you using. There is an Arm jar, which is what you would have if you got NetworkTables from eclipse, and the is a Desktop Jar, which has all the native libraries for desktop systems. The Arm jar doesn't include any of the libraries for windows or other systems. You can get the desktop version from here. http://first.wpi.edu/FRC/roborio/mav...kTables/3.1.5/. Just download the version that ends with -desktop.
WORKED!! Thank you! On to the Pi!

And I'm happy to include the server commands, but if that's in the screensteps, I missed it. I asked about it because I stumbled on it in the 2013 screensteps on a google search.

Thank you much. Hopefully I won't be back shortly with Pi problems.
Reply With Quote
  #15   Spotlight this post!  
Unread 13-01-2017, 18:12
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,106
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Network Tables: Please explain like I'm 5

Quote:
Originally Posted by kmckay View Post
WORKED!! Thank you! On to the Pi!

And I'm happy to include the server commands, but if that's in the screensteps, I missed it. I asked about it because I stumbled on it in the 2013 screensteps on a google search.

Thank you much. Hopefully I won't be back shortly with Pi problems.
With pi, instead of downloading that desktop artifact, download the arm-raspbian one. That should be the only thing needed to make it work.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
Reply With Quote
Reply


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 12:33.

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