purduesigbots / pros

Source code for PROS kernel: open source C/C++ development for the VEX V5 microcontroller
https://pros.cs.purdue.edu
Other
259 stars 76 forks source link

Fix motor groups not properly setting motor gearing/encoder units #610

Closed SprintKeyz closed 11 months ago

SprintKeyz commented 11 months ago

Summary:

Appended _all to the set_gearing and set_encoder_units calls in the motor group constructor.

Motivation:

After testing, it seems that when creating a motor group, the gearing you provide to the constructor only applies to the first motor in the group. Previously, the constructor would call set_gearing and pass in only the gearset, which would result in the index argument defaulting to 0 and therefore only applying to the first motor. The same is true with the existing set_encoder_units call. Changing these to their _all variants means all motors in the group will get the proper gearing and encoder units.

Example:

pros::MotorGroup motors({1, 2}, pros::MotorGears::blue); will only set the first motor to blue.

Test Plan:

SprintKeyz commented 11 months ago

Fixed in #611