frc5687 / 2018-robot

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

Add method to convert IR readings into inches. #248

Open JCharante opened 6 years ago

BenBernardCIS commented 6 years ago

You should be able to find an example of this in Tony's code.

JCharante commented 6 years ago

I started on this in https://github.com/frc5687/2018-robot/tree/Intake/%23248-convertToDistance a couple days ago. Feel free to start from scratch, but essentially I created some enums for the different model/flavors of IR sensors we use, and then for BACK_IR & DOWN_IR in Constants where we normally put whether they're enabled or not, I added a sibling variable whose value is one of the enums, and in the method / class where we use the transform power & coefficient said values where obtained from the constants file depending on which enum was passed into the constructor.