![]() |
Running Smartdashboard without cRIO/robot?
Can this be done? If so, are there instructions or notes? All the WPI "getting started" samples have code which interfaces with the physical robot. Not sure I'm even looking at the right code samples since I want to experiment with Smartdashboard and not the robot.
|
Re: Running Smartdashboard without cRIO/robot?
I've never tried myself, but you should be able to pull out the SmartDashboard and NetworkTable classes from wpilib.
The source code is included in the sunspotfrcsdk folder if you have installed the FRC java plugins from 2013. Sources are zipped here on a windows machine: Code:
%HOMEPATH%\sunspotfrcsdk\lib\wpilibj.src.zipedu/wpi/first/wpilibj/smartdashboard edu/wpi/first/wpilibj/networktables/ Alternatively, you could just include the whole wpilib jar file in your java desktop application. The following should get you everything you need: Code:
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; |
Re: Running Smartdashboard without cRIO/robot?
There is a completely new version of SmartDashboard coming out this year, based on JavaFX. Everything below is based on the old SmartDashboard, but probably also applies to SmartDashboard 2.0 (or SmartDashboardFX, not sure what the correct name is).
You can start up Smartdashboard and have it connect to a different ip address by specifying it on the command line. For example: java -jar smartdashboard.jar 127.0.0.1 The robot normally functions as a Network Tables server, so you need a replacement server. Network Tables is the network library that SmartDashboard uses. You should be able to use the files in sunspotfrcsdk\desktop-lib to make a java program that runs a network tables server, although I've never done it. There are instructions for making a client program here: http://wpilib.screenstepslive.com/s/...client-pc-side You would have to extend them to make a server. If you have LabVIEW, it's really easy to make a Network Tables server, just drop the NT Server Vi on a new VI, and run. The 2014 beta java software contains a tool called Outline Viewer. It can operate as either a client or a server and lets you view and manipulate Network Tables variables. Quote:
|
Re: Running Smartdashboard without cRIO/robot?
Creating a NetworkTables server is very easy. Having a stand-alone server will let you develop SmartDashboard and sensor processing apps without the cRIO:
Code:
import edu.wpi.first.wpilibj.networktables.NetworkTable; |
Re: Running Smartdashboard without cRIO/robot?
Thanks Joe. If I run smartdashboard.jar without an IP address, what does it connect to?
Where can I get the 2014 beta? Thanks, Chris Quote:
|
Re: Running Smartdashboard without cRIO/robot?
Thanks Krieck,
Do you know of any online resources/articles which explain the code you posted? I'm as interested in understanding it as I am in getting it to work. Thanks, Chris Quote:
|
Re: Running Smartdashboard without cRIO/robot?
The first two lines of the server code do all the work. I found these lines by reading through the WPILib code. The remaining lines just put the main thread to sleep while the NetworkTable handles communications in another thread.
I highly recommend reading through the WPILib source code. It should be installed in your home directory under sunspotfrcsdk/lib/wpilibj.src.zip The only documentation I know of is at: http://wpilib.screenstepslive.com/s/...client-pc-side |
Re: Running Smartdashboard without cRIO/robot?
Quote:
Quote:
|
Re: Running Smartdashboard without cRIO/robot?
> Where can I get the 2014 beta?
For anyone who is impatient, you might run through the installation procedure and set up the latest Java, NetBeans, and the NetBeans plugins: http://wpilib.screenstepslive.com/s/...elopment-tools The "Release" versions of the WPI plugins have had some updates in the past week, so these may be pretty close to the latest code. |
Re: Running Smartdashboard without cRIO/robot?
Joe, Krieck,
The code to set up a NetworkTables server was very helpful, but how do I get SmartDashboard to use it? I ran it from the command line and tried to specify the ip as 127.0.0.1 but it still looks like it's looking for the crio. When I try to run my code I get exceptions like Code:
Caused by: java.lang.RuntimeException: NetworkTable could not be initialized: java.net.BindException: Address already in use: JVM_Bind: Address already in use: JVM_Bind |
Re: Running Smartdashboard without cRIO/robot?
Quote:
|
Re: Running Smartdashboard without cRIO/robot?
Thanks Joe,
That worked. I'm still getting that exception when I run my code though. Here's what the code looks like: Code:
import edu.wpi.first.wpilibj.networktables.NetworkTable; |
Re: Running Smartdashboard without cRIO/robot?
In your client code you should specify the IP address and also set up for client mode. Try this:
Code:
import edu.wpi.first.wpilibj.networktables.NetworkTable; |
Re: Running Smartdashboard without cRIO/robot?
Quote:
|
Re: Running Smartdashboard without cRIO/robot?
Quote:
|
| All times are GMT -5. The time now is 10:39. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi