Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   SmartDashboard Problem (http://www.chiefdelphi.com/forums/showthread.php?t=152350)

dash102 18-11-2016 23:32

SmartDashboard Problem
 
I am new to setting up a custom dashboard - right now, when I use putNumber(), where is the value I set going? I am able to retrieve it using getNumber(), but I can't get the value to display on the dashboard.

AustinShalit 19-11-2016 07:38

Re: SmartDashboard Problem
 
Hi there! Please make sure you followed all of the instructions here:

https://wpilib.screenstepslive.com/s...smartdashboard

You may also want to try to add a Connection Indicator (View -> Add... -> Connection Indicator).

euhlmann 19-11-2016 11:28

Re: SmartDashboard Problem
 
When you do this in robot code
Code:

SmartDashboard.putNumber("something", 1);
it goes on the SmartDashboard table.
So on a custom dashboard you might do (in Java)
Code:

NetworkTable sd = NetworkTable.getTable("SmartDashboard");

sd.getNumber("something"); // 1


dash102 19-11-2016 20:25

Re: SmartDashboard Problem
 
Thanks! So do I have to be connected to the robot to be able to see the dashboard? Am I able to see it disconnected, just with no values in the spaces where values are supposed to be?

euhlmann 20-11-2016 12:44

Re: SmartDashboard Problem
 
Quote:

Originally Posted by dash102 (Post 1616943)
Thanks! So do I have to be connected to the robot to be able to see the dashboard? Am I able to see it disconnected, just with no values in the spaces where values are supposed to be?

You have to be connected. If you are not connected, this (deprecated) throws an exception
Code:

NetworkTable.getTable("SmartDashboard").getNumber("something")
and this (the recommended way)
Code:

NetworkTable.getTable("SmartDashboard").getNumber("something", defaultValue)
returns defaultValue
However if you connect and then disconnect, the values returned will be the last known values.

TylerHarmon 23-11-2016 02:42

Re: SmartDashboard Problem
 
Quote:

Originally Posted by dash102 (Post 1616895)
I am new to setting up a custom dashboard - right now, when I use putNumber(), where is the value I set going? I am able to retrieve it using getNumber(), but I can't get the value to display on the dashboard.

Yep, the values go into SmartDashboard.jar. You don't need to be connected to the robot to run that, you can run it while disconnected, and the values will be blank. You can also enable the edit mode and configure the layout of the dashboard, add dials/bars/graphs, etc. In addition, check out the SmartDashboard SFX, which allows for more visual control.

Last year I used this to display, on a dial and a bar, the amount of pressure that our pneumatic system had left so that our drivers could tell if they had enough pressure to fire or not. It's a great tool that's easy to use :)

Good luck!

dash102 25-11-2016 01:59

Re: SmartDashboard Problem
 
Quote:

Originally Posted by TylerHarmon (Post 1617376)
Yep, the values go into SmartDashboard.jar. You don't need to be connected to the robot to run that, you can run it while disconnected, and the values will be blank. You can also enable the edit mode and configure the layout of the dashboard, add dials/bars/graphs, etc. In addition, check out the SmartDashboard SFX, which allows for more visual control.

Last year I used this to display, on a dial and a bar, the amount of pressure that our pneumatic system had left so that our drivers could tell if they had enough pressure to fire or not. It's a great tool that's easy to use :)

Good luck!

Thanks for the info. I don't see any blank values at all when I check SmartDashboard.jar - when I try to add preferences, the preferences box doesn't update, and when I try to use a method like putNumber(), nothing new shows up. Do you have any code examples so I can see what I'm doing wrong?


All times are GMT -5. The time now is 09:40.

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