How to construct an X-drive and program an auto for DECODE season in pedro pathing
To construct an X-drive and program a DECODE autonomous routine in Pedro Pathing, you should implement a custom drivetrain class to handle the X-drive's motor vectors and use the Ivy command library to structure your autonomous pathing. This is necessary because Pedro Pathing only natively supports mecanum drives, meaning other omnidirectional configurations like X-drives require a custom implementation. According to the Pedro Pathing Custom Drivetrain documentation, you can build this by extending the Drivetrain class, keeping all motor hardware inside this class, and implementing the abstract calculateDrive and runDrive methods to translate pathing vectors into physical motor powers.
For the DECODE season, you must convert your camera or sensor coordinates to match Pedro Pathing's custom right-hand coordinate system, where the x-axis increases to the right and the y-axis increases upward. The Pedro Pathing Coordinates documentation states that you can convert DECODE-specific coordinates by taking an FTC Pose2D, converting it to a standard Pedro Pose using the inverted FTC coordinates converter, and then transforming it into Pedro's coordinate system.
To program the autonomous routine, the Pedro Pathing Example Auto documentation recommends using Ivy to define the entire auto as a single sequential command composition of follow commands, which automatically wait for the follower to finish. If you prefer not to use a command-based library, you can alternatively manage the path progression manually using a finite state machine that transitions states based on whether the follower is busy.