Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Sending SmartDashboard Data to cRIO without pressing [ENTER] key (http://www.chiefdelphi.com/forums/showthread.php?t=101268)

dkearle 27-01-2012 10:52

Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
Hi,

Our team is attempting to tune a PID controller using the SendablePIDController and corresponding widget on the SmartDashboard. We ran into a little problem last night. We successfully displayed the widget on the dashboard. With our robot enabled, we typed in a new P constant on the SmartDashboard and then hit the [ENTER] key, which immediately disabled our robot.

Last year on the driver station the space bar was used to disable the robot. This year it is the [ENTER] key.

Does anyone have a solution on how I can enter data into the SmartDashboard triggering the SmartDashboard to recognize the new data and send it to the robot, without me using the [ENTER] key on the driver station? I don't want to keep inadvertently disabling my robot when I'm trying to see the effect of a new P constant in my PID controller.

Thank you!
Dianne

Sunstroke 28-01-2012 00:49

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
<removed>

PranavSathy 28-01-2012 09:41

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
I have no personal experience with SmartDashboard, but since last year my team uses the UDP on port 1140 (if I recall right?) to communicate with a custom dashboard we make in C#, and if you check out the Team Update on the 24th of January, I believe the port for Dashboard to Robot communications is UDP 1150, you can, without much effort, create a C# dashboard to communicate with the robot using UDP :).

I know my answer is not 100% relevant, but if you do not manage to find your answer than I hope this is of help to you. Good luck!!

sircedric4 09-02-2012 08:53

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
Since this thread is about SendablePIDController and the original poster seems to have figured it out, can you help us please?

We are using the IterativeRobot instead of the CommandRobot and we are trying to get the SendablePIDController to work on our Smartdashboard so that we can tune our speed encoder on our shooter.

We started yesterday by putting this in our class init:

Code:

SendablePIDController *speedControl;
Then in our constructor we put:

Code:

speedControl = new SendablePIDController(0.0,0.0004,0.0, speedEncoder, shooterMotor1);
This worked fine as a PID controlled system, our shooter is obviously under control, we just want to tune the system real time. How do we get the SendablePID menu to show up on the dashboard? I know it has something to do with PutData() but nothing I try compiles. I have tried this so far in the constructor:

Code:

SmartDashboard::GetInstance()->PutData("SendablePIDController",SendablePIDController::GetInstance());
I have never gotten the hang of all the "->" and "::" with C++, I am a visual basic pro hacking C++ so make no assumptions of what I know.

Thanks

jwakeman 09-02-2012 15:07

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
Quote:

Originally Posted by dkearle (Post 1114583)
Hi,

Our team is attempting to tune a PID controller using the SendablePIDController and corresponding widget on the SmartDashboard. We ran into a little problem last night. We successfully displayed the widget on the dashboard. With our robot enabled, we typed in a new P constant on the SmartDashboard and then hit the [ENTER] key, which immediately disabled our robot.

Last year on the driver station the space bar was used to disable the robot. This year it is the [ENTER] key.

Does anyone have a solution on how I can enter data into the SmartDashboard triggering the SmartDashboard to recognize the new data and send it to the robot, without me using the [ENTER] key on the driver station? I don't want to keep inadvertently disabling my robot when I'm trying to see the effect of a new P constant in my PID controller.

Thank you!
Dianne

I entered a bug report for this (http://firstforge.wpi.edu/sf/go/proj...d/tracker.bugs) on the FIRST Forge project site for the Smartdashboard. I was able to get around this problem by running the driver's station on one laptop and the smart dashboard on a second laptop. However, it still didn't really work out for me because there was still something funky going on with the PID tuning. Whenever i tried to set the setpoint for the PID it would go to zero. Not sure if this was a side effect of running in the two laptops configuration.

jwakeman 09-02-2012 15:11

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
Quote:

Originally Posted by sircedric4 (Post 1123000)

Code:

speedControl = new SendablePIDController(0.0,0.0004,0.0, speedEncoder, shooterMotor1);
Code:

SmartDashboard::GetInstance()->PutData("SendablePIDController",SendablePIDController::GetInstance());

It should be:

Code:

SmartDashboard::GetInstance()->PutData("SendablePIDController",speedControl);

sircedric4 09-02-2012 15:33

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
Quote:

Originally Posted by jwakeman (Post 1123169)
It should be:

Code:

SmartDashboard::GetInstance()->PutData("SendablePIDController",speedControl);

Thank you, that compiled! We'll give it a try tonight or tomorrow night to make sure it works at runtime.

otherguy 18-02-2012 02:29

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
bump bump bump

Has anyone found an acceptable workaround for the Enter = disabled bot issue?

We don't want to have to use two laptops at every match... I'm hoping I don't have to dig through the smartdashboard code to make a fix myself. Anyone?

agartner01 18-02-2012 11:35

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
Yeah, big problem for me too... A fix would be much appreciated (even if it is quite hackish...)

rbmj 20-02-2012 12:58

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
Quote:

Originally Posted by jwakeman (Post 1123169)
It should be:

Code:

SmartDashboard::GetInstance()->PutData("SendablePIDController",speedControl);

So you were able to get this to work? Even with the new WPILib we still got a crash at runtime. Don't know what the problem is. I didn't *see* any SmartDashboard initialization or anything we needed to do...

otherguy 20-02-2012 20:40

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
For any teams looking for a solution to the treads original problem, it looks like Team 694 developed a solution in their bug report:
Quote:

At the moment, the only way to commit a change made in a text field of the SmartDashboard back to the robot via the
NetworkTable is by typing in the new value and hitting <Enter>. However, this also happens to be the key binding for
disabling the robot in the 2012 Driver Station, thereby making it inconvenient to use the SmartDashboard's capability
for sending data to the robot.

Our team's solution is to update over the NetworkTable if the Text Box loses focus; in other words, the robot gets the
field's new value after the user inputs data and either clicks outside of the SmartDashboard's Text Box or presses <TAB> .
See their bug report on the SmartDashboard First Forge page for the diff attachment

Sunstroke 15-03-2012 14:57

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
1 Attachment(s)
Alright, I've created an extension which will simulate the enter key being pressed on the SmartDashboard when you push a button.

To use it, download the attached .zip, pull the .jar out of it and put it into "\Program Files\SmartDashboard\Extensions", then run the SmartDashboard.

Select "View/Add.../Enter Key" and there will be a button you can use.

agartner01 15-03-2012 22:37

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
Quote:

Originally Posted by Sunstroke (Post 1144640)
Alright, I've created an extension which will simulate the enter key being pressed on the SmartDashboard when you push a button.

To use it, download the attached .zip, pull the .jar out of it and put it into "\Program Files\SmartDashboard\Extensions", then run the SmartDashboard.

Select "View/Add.../Enter Key" and there will be a button you can use.

Oh wow, that's awesome! I thought I was totally out of luck, but I guess not. :cool:

Suppose you've tried binding this action to a key? Because that would make it even more awesome.

agartner01 15-03-2012 22:56

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
Quote:

Originally Posted by otherguy (Post 1131245)
For any teams looking for a solution to the treads original problem, it looks like Team 694 developed a solution in their bug report:


See their bug report on the SmartDashboard First Forge page for the diff attachment

And then I noticed this. I'll try that now.

agartner01 16-03-2012 16:09

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
1 Attachment(s)
Alright. So I patched the dashboard, but I don't have a robot I can use. Can someone test the file for me?

GrimmReaper 09-01-2013 13:22

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
I was just testing last night with the 2013 SmartDashboard and it seems like i still have this problem? I couldn't seem to get a new value in a text field to the robot without pressing enter. Has anyone else tried this yet? is there another way to get the value to update? I would LOVE to be able to run both smartDashboard and the driver station on one computer AND update values without disabling the robot :-)

Let me know if there's a solution i'm not aware of,
thanks!

BradAMiller 09-01-2013 15:35

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
For the Enter key problem, if you select another text field with the mouse, it will commit the value in the text field you just changed. So type in the numbers, don't hit enter, instead click with the mouse in another field.

That will commit the change to the field.

Brad

mikets 16-01-2013 04:23

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
Instead of using the Dashboard to send data to the cRIO, we use the debug console instead. Our FRC library has a module that enables us to interact with the cRIO using the debug console. Basically, the cRIO program provides a command line interface printing a command line prompt on the debug console. Then the user can type the command to be executed with command line parameters. For example, the following shows an excerpt on what the debug console looks like:
Code:

Console-> help
q      - Exit console mode
help    - List commands and info about them
listobj - List registered command objects
listvar - List variables and info about them
get    - Get the value of a variable
 
Console-> get DriveBase.DriveKp
Kp = 0.5
 
Console-> set DriveBase.DriveKp 0.55
 
Console->


Joe Ross 18-01-2013 17:09

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
According to the Software Notes the version of SmartDashboard released today (in the C++ and Java updates) will commit values when you tab.

BradAMiller 18-01-2013 19:49

Re: Sending SmartDashboard Data to cRIO without pressing [ENTER] key
 
Yup, it was a bug where it was working in the LiveWindow (test mode) but not in the regular SmartDashboard widgets. Should be fixed now, so just click in another field or otherwise get the modified field to lose focus and the value will commit.

Also, notice that we'll automatically register all your actuators and sensors for test mode so that you can see values and manipulate them without having to write any other code.

Brad


All times are GMT -5. The time now is 14:24.

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