Write me a swerve drive code and explain to me why everyone tells me it's hard to code. Isnt it like mecanum drie, where the code/formulas are public?
Swerve drive is significantly more complex to program than mecanum drive because it requires coordinating both the steering angle and the drive velocity of independent modules, rather than just adjusting the speeds of fixed wheels. Game Manual 0 explains that kinematics applies geometry to control robot mechanisms, and while it provides the formulas for mecanum drive, it notes that swerve kinematics derivations are found in external resources like "Controls Engineering in the FIRST Robotics Competition" and "Mobile Robot Kinematics for FTC" .
For implementing swerve drive code, FTCLib provides dedicated libraries for WPILib-style kinematics and odometry, which are covered in the restricted sections FTCLib Swerve Drive Kinematics (https://docs.ftclib.org/kinematics/wpilib-kinematics/swerve-drive-kinematics) and FTCLib Swerve Drive Odometry (https://docs.ftclib.org/kinematics/wpilib-kinematics/swerve-drive-odometry) .
Additionally, hardware-specific programming and calibration are required. For example, REV Robotics provides guides on programming and calibrating MAXSwerve modules, which can be found in the restricted sections Programming MAXSwerve (https://docs.revrobotics.com/ion-build/motion/maxswerve/programming-maxswerve) and Swerve Calibration (https://docs.revrobotics.com/rev-hardware-client-2/guides/swerve-calibration) .
The provided documentation does not contain the actual swerve drive code because the relevant programming and kinematics sections are restricted.