frc-4931 / 2016-Robot

Code for the 2016 season for FRC Team 4931
MIT License
0 stars 12 forks source link

Standardized mapping of hardware and inputs #7

Closed agausmann closed 8 years ago

agausmann commented 8 years ago

Because we are building two robots, the motor controllers and sensors that we use on both may not be exactly the same. We may also want to test code on Scorpio, our old robot. Making code compatible for 3 platforms can become a bit messy. To fix this, there should be a standard interface for mapping robot-specific hardware to subsystems. That way, we can create implementations of that interface for the various platforms running the code. Swapping out a single constructor (or possibly changing a property in a file) is all we will have to do to migrate the code to another platform.

agausmann commented 8 years ago

It would be reeeeally cool if we did this: We can locate the aforementioned property in a file on the RIO, which would mean we wouldn't have to make any changes to the code (ie swapping constructors) that might turn into a commit fight.

rhauch commented 8 years ago

BTW, you should talk to the electrical team. Last I heard, their goal was to use the same motor controller for a given motor on both robots. If that's the case, then this abstraction is not needed and would likely not be worth the complexity. Keep it simple.

agausmann commented 8 years ago

If that is the case, then I don't see a reason to do it either.