frc5687 / 2018-robot

Code for 5687's 2018 competition robot Greta and Jitterbug
8 stars 2 forks source link

Intake/#248 convert to distance #268

Open JCharante opened 6 years ago

JCharante commented 6 years ago

Untested, don't merge

JibriI commented 6 years ago

Those refer to the ranges on the IR sensors, and are much easier to recognize than the model numbers in my opinion

BenBernardCIS commented 6 years ago

I agree with using the descriptions--which also happen to be how Sharp characterizes them (short range infrared sensor, medium range infrared sensor, ec). That said, it would be helpful to include in the comments (or javadoc) for each class the model number of the associated sensor.

BenBernardCIS commented 6 years ago

Short: GP2Y0A41SK0F Medium: GP2Y0A21YK Long: GP2Y0A02YK0F

JCharante commented 6 years ago

Instead of calling IRSensing.sensorShort.getDistance(), instead you should have the ir type enum as a parameter along with the port, and have IRSensing.getDistance() which uses the transform coefficient and power according to the enum that was given in the constructor.