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
69 stars 28 forks source link

Add tracking wheel support #21

Closed ssejrog closed 2 years ago

ssejrog commented 2 years ago

For now, just support trackers parallel to the drive wheels. Default parameter in drive constructor that can be set. Needs to support 3 wire expanders and different ticks per rotation.

ssejrog commented 2 years ago

Added two new constructors for tracking wheels (external encoders).

// Chassis constructor
drive chassis (
  // Left Chassis Ports (negative port will reverse it!)
  {-11, -5, -7}

  // Right Chassis Ports (negative port will reverse it!)
  ,{3, 2, 17}

  // IMU Port
  ,18

  // Wheel Diameter (Remember, 4" wheels are actually 4.125!)
  //    (or tracking wheel diameter)
  ,3.25

  // Cartridge RPM
  //   (pr tick per rotation if using tracking wheels)
  ,600

  // External Gear Ratio 
  //    (or gear ratio of tracking wheel)
  ,1.66666666667

  // Left Tracking Wheel Ports (negative port will reverse it!)
  ,{1, 2}

  // Right Tracking Wheel Ports (negative port will reverse it!)
  ,{3, 4}
);

and

// Chassis constructor
drive chassis (
  // Left Chassis Ports (negative port will reverse it!)
  {-11, -5, -7}

  // Right Chassis Ports (negative port will reverse it!)
  ,{3, 2, 17}

  // IMU Port
  ,18

  // Wheel Diameter (Remember, 4" wheels are actually 4.125!)
  //    (or tracking wheel diameter)
  ,3.25

  // Cartridge RPM
  //   (pr tick per rotation if using tracking wheels)
  ,600

  // External Gear Ratio 
  //    (or gear ratio of tracking wheel)
  ,1.66666666667

  // Left Tracking Wheel Ports (negative port will reverse it!)
  ,{1, 2}

  // Right Tracking Wheel Ports (negative port will reverse it!)
  ,{3, 4}

  // 3 Wire Port Expander Smart Port
  ,1
);

left_velocity() and right_velocity() don't return the velocity of the external encoders. This needs to be implemented.

ssejrog commented 2 years ago

28 adds rotation sensors

ssejrog commented 2 years ago

as we decided odom is out of scope of this project, this issue is now complete with the remaining #47 still open.