![]() |
Re: Custom Driver Station on the Field
Ours worked. You have to do a custom driver station project (from the launch screen of Labview), with a numeric selector of some sort (slider, counter, whatever). You have to build that, then take the application (under LabviewData, then builds, then FRC Driver Station), possibly transfer it to whatever computer you use as an on-field driver station if it's different than your programming computer, then edit the properties of the driver station built program in order to auto-launch the new station, as well as overwrite the old station program. Then, you have to use the "driver station get numeric value" block in your auton mode vi. After that, give the get value block the same name as you gave it on the driver station. Finally, wire that into a numeric case structure, with each numbered case being a different auton mode. When you set the number before the match, the robot should grab the value at first. I can't take a screenshot of ours right now, but if you would like, I will try to take and post one after school today.
|
Re: Custom Driver Station on the Field
Quote:
|
Re: Custom Driver Station on the Field
Quote:
We set our autonomous mode before the match starts, and it is stored in a global variable (not necessary but we have dashboard code and robot code separated in different loops in different areas, its a custom structure) on the robot, and that does the trick, as long as there is a connection to the dashboard established. This seems to be a bug with the dashboard code, and if other people are having this issue, then I would assume its a problem with the code provided in the WPIlib or the TCP just doesn't work well in certain scenarios for some reason, and I haven't found a fix yet. Its a pretty weird problem. |
Re: Custom Driver Station on the Field
Check your data types in automatous mode. The data coming from your numeric read does not match the date type that you loop is looking for causing the loop to default to zero every time you run the program.
http://puu.sh/ggnQW/e4c23b7496.png |
Re: Custom Driver Station on the Field
Yea, your data type in Autonomous is a floating point number not the integer type of the Case. The floating point number doesn't equal any of the integer cases, so it is taking the default.
The problem exists on both the Dashboard side and the robot side. You need to write/read an integer on both sides and you need to make sure the enum order matches the numbers you expect. |
Re: Custom Driver Station on the Field
Quote:
|
Re: Custom Driver Station on the Field
1 Attachment(s)
Quote:
However, LabVIEW should be (and I assume is) automatically casting the double into an integer, as shown by the red dot in this screenshot that you are referencing: http://puu.sh/ggnQW/e4c23b7496.png So technically, that part should be working fine, but it is better to cast it yourself, just as good practice. There is probably some communication issue occurring here, however, so try to recreate the problem in practice with a similar setup to how you run your robot at competition, specifically the boot order and time of connection. |
Re: Custom Driver Station on the Field
Quote:
For lack of a better way to describe what is happening, you have a namespace collision. You have the same name for the Network Table variable as you have for your numeric control. Change the name of one, but not the other. I would suggest shortening the control name to "Auto Mode", then see if you have the errant behavior. We discovered this issue in our dashboard, where we tried to pass a value to the robot by a name that was also shared by a numeric control. At first, it made sense, as the network table name was the same as what we had on our dashboard. It didn't occur to us that there would be any issue. We manually typed values into the control, and didn't notice that the sent value was not updating every time. We discovered the problem when we added a different mode to generate a sawtooth signal, passed through the same network table variable. To our surprise, the numeric control on the dashboard (which should be an input only) started to display the numbers we sent to the robot through the network table as if it was an indicator for that variable. This is not supposed to happen! This bug caused unpredictable behavior on the robot, where sometimes it did what we expected, and other times, it seemed that we couldn't override the last value that was set. We discovered that our successes had more to do with setting the control a second or third time to the desired number, as if there was a race condition of some sort. Changing the names to non-identical identifiers fixed our issue. I will note that MikeF1617 did essentially the same having "Autonomous Mode" as the name for the control, and "auto_mode" as the network table variable. |
Re: Custom Driver Station on the Field
Quote:
|
Re: Custom Driver Station on the Field
Quote:
One proven but clunky workaround is to power up the robot in queue with the DS already connected. The currently suggested procedure is to restart the robot code after the robot and DS are communicating on the field. |
Re: Custom Driver Station on the Field
2 Attachment(s)
Quote:
In the below code, if the create listener VI fails (first VI), it does not attempt to recreate this listener and the connection never occurs. Attachment 18560 The fix is below. I'd paste it as a VI snippet, but the local variable makes it not as straight forward. Attachment 18561 In both the error cases there is a simple 100ms wait. |
Re: Custom Driver Station on the Field
Quote:
Case "No Error": http://puu.sh/gmB4f/e4087185f4.png Case "Error": http://puu.sh/gmB5a/0a5d48af60.png Theoretically, couldnt I just set the timeout to -1 so it keeps waiting till it finds a connection under the TCP Wait on Listener? |
Re: Custom Driver Station on the Field
Quote:
|
| All times are GMT -5. The time now is 21:28. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi