Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from
Closed

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

wants to merge 1 commit into from

Conversation

SprintKeyz
Copy link

@SprintKeyz SprintKeyz commented Oct 19, 2023

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:

  • 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

@SprintKeyz
Copy link
Author

Fixed in #611

@SprintKeyz SprintKeyz closed this Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant