
04-03-2015, 15:55
|
|
Registered User
 FRC #4471 (Spartrons)
Team Role: Programmer
|
|
Join Date: Jan 2015
Rookie Year: 2013
Location: Florida
Posts: 24
|
|
|
Re: Custom Driver Station on the Field
Quote:
Originally Posted by Levansic
I see the problem!
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.
|
I will definately try that, but I am still a bit skeptical because it did work when we went to the practice field and tried changing the autonomous mode around. Only when we went for an actual match was it not getting the right value.
|