Closed blu28 closed 11 months ago
Alternatively, they could be printed when they are accessed.
I pushed up a change that logs preferences at startup by reading from the network table. At the moment it only displays values for doubles and booleans since those are the types I would think we might use. I could add others (integer?) or just display the name and report value is not handled.
Fixed in commit 2bcd316b
As we adopt the practice of putting all tunable values into the Preferences table, we need a way to establish what these values are while the robot is running. We can display the table in realtime in the dashboard if we choose to, but we need to know their values when we analyze the logs. Further, we should periodically update the default values in the code to match what we actually tune the values to. The best place to put this code would be in the Datalog.java file. We need to be sure that the preferences have been read into the table before we log it, but also that we get the current values and not the values that the operator may change in the table after the robot is booted. So, the timing is important. One question is, should we just log at datalog init time automatically, or should there be a LogPref method that gets called from somewhere in the robot code. The former may be preferable, but the timing may mean the latter is required.