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:
Create a motor group, being sure to specify a gearing and encoder units
Call get_gearing_all on the motor group and print the values to verify the gearing is correct
Similarly, call get_encoder_units_all on the motor group and print the values to verify the encoder units are correct
Summary:
Appended _all to the
set_gearing
andset_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 theindex
argument defaulting to 0 and therefore only applying to the first motor. The same is true with the existingset_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:
get_gearing_all
on the motor group and print the values to verify the gearing is correctget_encoder_units_all
on the motor group and print the values to verify the encoder units are correct