View Single Post
  #36   Spotlight this post!  
Unread 16-05-2015, 16:48
Pault's Avatar
Pault Pault is offline
Registered User
FRC #0246 (Overclocked)
Team Role: College Student
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Boston
Posts: 618
Pault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond repute
Re: Best Sensor for Unlimited Rotation Swerve

Quote:
Originally Posted by Joe Johnson View Post
I like this approach. If you have to zero something, having the ability to set the values in code without having to redownload code is always nice.

Even so, it isn't that bad to have magic numbers in the code if you code in such a way that the magic numbers are easily modified.

One approach is possible with the current FIRST control system is to keep these magic values in a text file on the PC, the have bit of code on the PC that communicates to the code running on the robot that sends the magic values to the robot upon request (RoboRIO sends a UDP message "please send me MagicNoXXX" Code on PC opens text file, finds MagicNoXXX, replies with UDP message "MagicNoXXX=1234"). It even works in combination with the button idea as well. Humans put robot into known location, hits RememberTheseMagicNumbers Button on the robot, RoboRIO sends UDP message "MagicNo001=1000, MagicNo002=2000, ...", Code on PC then openes text file and updates or adds the values to the list and replies to RobioRIO via UDP "as you wish")

Seems like a system that could work. (note to PaulT what do you think, should we do this? Seems like our "play sound X code" could do this as a side business without breaking sweat)

Dr. Joe J.
Definitely seems like something that we should do. I have actually been thinking about doing a similar system for a while, but I never though of using it to zero potentiometers. This could have saved us a lot of time.

Only thing is that we should keep the text file in the roboRIO's file system, not on the laptop. Seems like that will cut out a lot of complexity in the system, prevent any problems switching between laptops, and allow us to use different constants for a practice robot/chassis.