Hello I’m new to coding robots in java I’ve mainly used block code and that was with FTC and I’m having issues with trying to learn the syntax for swerve drive in a FRC robot I already know how to use packages update libraries etc I’m just trying to figure out how to make a teleop, auto, read robot data such as the telemetry, encoder offset and other things, if possible could someone point me in the right direction
Swerve drive is a serious undertaking programming wise, if you intend to program it fully on your own. Unless you are willing to continuously maintenance it, often it’s a good idea to not fully create everything from scratch itself.
With that out of the way, plenty of code examples live online like WPILib’s example, BaseTalonFXSwerve, our own swerve template from 2022, and YAGSL’s example using the library of the same name. Searching GitHub can also result in a ton of others as well, especially in Java.
I would highly recommend YAGSL. Their documentation site has some good explanations of the hood how swerve drives are controlled in code. The library itself also simplifies the process of creating swerve drives and also provides a bunch of cool features for the users to take advantage of. It is also maintained and regularly updated as well. Maintainers are also quite active on CD and quite timely to responding to questions.