I would highly recommend you take a look at the work done in YAGSL .
It seems you may be missing some critical hardware pieces as well. You will need 4 absolute encoders otherwise you will lose your wheel orientation measurements every time the robot powers off. This is generally done with CANCODERs. The built in encoders in falcons / neos don’t retain their position when the power is removed so you’d never know what your wheels are doing accurately. The absolute encoders are used to set the internal encoders on the turning motors. Additionally you do need a gyro ( there is a few you can use , some better than others ). The YAGSL library has a few you can use out of the box.
The YAGSL library should be pretty plug and play. You simply tell it what hardware you have in the config files found in the deploy folder.
The original post can be found here : Yet Another Generic Swerve Library (YAGSL) Beta
YAGSL Example Project - https://github.com/BroncBotz3481/YAGSL-Example