This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
Remove device object cache so there aren't CAN id conflicts #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
PR written by @rcahoon
We previously had a map from device ID to device object; the map entry is populated the first time that the device with that ID is requested. This allowed e.g.
getMotor
to be called multiple times and return the same object. This made more sense with software architecture that we used many years ago, but now we ask for each device exactly once in the appropriateMechanism
.This is now causing problems because it means we can only have one motor with each ID. We now have enough motors of different types that we're out of IDs if we can only have 64 of any motor. We would be ok if we can have 64 of each motor type, which is permitted by the FRC device ID standard.
Thus, we remove the device object maps from the Maroon Framework. The device object will be (re)created when the appropriate method of
RobotProvider
is called.How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Be detailed so that your code reviewer can understand exactly how much and what kinds of testing were done, and which might still be worthwhile to do.