34 constants switching depending on target chassis#36
34 constants switching depending on target chassis#36PillageDev wants to merge 2 commits intodevelopfrom
Conversation
bjmcternan
left a comment
There was a problem hiding this comment.
This seems like a bit much for what we may need to do. I suspect both chassis should use the same motors and likely don't need all this abstraction. Let's discuss the intention before moving forward. We need to keep in mind maintainability and developers that are going to come after us.
afranchuk
left a comment
There was a problem hiding this comment.
This works, but when I first heard discussion of this desired feature, I was hoping for build-system configuration rather than runtime configuration (e.g., configuration that would allow selecting the target chassis in the IDE). That could also avoid the runtime reflection needed with this approach, and allow proper type checking at compile time.
|
|
||
| ; | ||
|
|
||
| private static CommandSwerveDrivetrain instance; |
There was a problem hiding this comment.
This should not be static. Though, in practice, we won't be hot-swapping (only one call to createDrivetrain()), so it would work.
Allows us to switch constants depending on the drive train we are running code on. This is useful so we can drive multiple robots with the same code. This will still work even if the mechanisms aren't on one of them.