EZ-Robotics / EZ-Template

Simple plug-and-play PROS template that handles drive base functions for VEX robots.
https://ez-robotics.github.io/EZ-Template/
Mozilla Public License 2.0
70 stars 27 forks source link

Simpler Constructor that only needs wheel RPM #120

Closed ssejrog closed 2 months ago

ssejrog commented 2 months ago

Inspired by LemLib, constructors should take in wheel rpm instead of cartridge and ratio. This can be retrofitted into EZ-Template by defaulting the ratio to 1, and wheel rpm is used for cartidge rpm.

// Chassis constructor
ez::Drive chassis(
    // These are your drive motors, the first motor is used for sensing!
    {-5, -6, -7, -8},  // Left Chassis Ports (negative port will reverse it!)
    {11, 15, 16, 17},  // Right Chassis Ports (negative port will reverse it!)

    21,     // IMU Port
    4.125,  // Wheel Diameter (Remember, 4" wheels without screw holes are actually 4.125!)
    420);   // Wheel RPM

To support transmissions, a new function will need to be added to change the wheel rpm on the fly. This is already supported for changing ratio.