Here is a repo that provides a barebones robot simulation example with a CTRE swerve drive base, deployable intake & roller, and PhotonVision sim. Note that this is meant to be used as a reference, not as a base template for a real robot.
I want to reiterate that nothing here is novel; we’re standing on the shoulders of giants and just assembling components that others have built. Maybe the most unique thing is how we use Mechanism2d ligaments to visualize spinning rollers. It looks a bit silly but it’s functional.
I think one thing to be careful about is making sure that when updating the motor sim based on the physics sim, you’re not leaking information that would not be present on the real robot. It requires some thoughtfulness and verification to make sure that the sim matches the real robot in terms of where the zero point is on your mechanisms/motors/sensors.
Thanks for sharing this! I just wanted to mention another method I have used to visualize intake rotation in sim. It works by setting the color of the roller to a shade of red (for backward) or green (for forwards) based on the speed.