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

<removed>

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!!

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:

SendablePIDController *speedControl;

Then in our constructor we put:

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:

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

I entered a bug report for this (http://firstforge.wpi.edu/sf/go/projects.smartdashboard/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.

It should be:

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.

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?

Yeah, big problem for me too… A fix would be much appreciated (even if it is quite hackish…)

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…

For any teams looking for a solution to the treads original problem, it looks like Team 694 developed a solution in their bug report:

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

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.

EnterKey.jar.zip (1.74 KB)


EnterKey.jar.zip (1.74 KB)

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.

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

Alright. So I patched the dashboard, but I don’t have a robot I can use. Can someone test the file for me?

SmartDashboard.zip (1.74 MB)


SmartDashboard.zip (1.74 MB)

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 :slight_smile:

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

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

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:


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->

According to the Software Notes the version of SmartDashboard released today (in the C++ and Java updates) will commit values when you tab.

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