You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a feature we would like to implement in PROS4; however, MotorGroups have yet to be added to Pros 4, so they cannot be implemented to Pros 4. Since this feature is a small one that could be very useful for MotorGroups, it can be implemented into Pros 3 and easily ported into Pros 4. This would be fine to do since it is a small quality of life improvement, and we have #449 to push out when we get that fixed.
The gist of this feature is that if the user has a MotorGroup, they should be able to treat it like an array of motors:
pros::MotorGroup group({12, 13, -2, 3});
pros::Motor& motorA = group[3]; // motorA now references the last motor in the group.
pros::Motor& motorB = group[0]; // motorB mow references the first motor in the group.
The index passed should simply index into the list of motors that the motor groups.
Additionally, MotorGroups should have a method, size() which returns the number of motors in the group.
These features would allow for easy iteration over a motor group with a standard for loop, and without having to use many vectors for each of the properties needed.
for(int i = 0; i < group.size(); i++) {
group[i].set_reversed(true);
group[i].set_velocity(12);
}
This is redundant to be used like this, but this could maybe be used in more useful ways.
The text was updated successfully, but these errors were encountered:
This is a feature we would like to implement in PROS4; however, MotorGroups have yet to be added to Pros 4, so they cannot be implemented to Pros 4. Since this feature is a small one that could be very useful for MotorGroups, it can be implemented into Pros 3 and easily ported into Pros 4. This would be fine to do since it is a small quality of life improvement, and we have #449 to push out when we get that fixed.
The gist of this feature is that if the user has a MotorGroup, they should be able to treat it like an array of motors:
The index passed should simply index into the list of motors that the motor groups.
Additionally, MotorGroups should have a method,
size()
which returns the number of motors in the group.These features would allow for easy iteration over a motor group with a standard for loop, and without having to use many vectors for each of the properties needed.
This is redundant to be used like this, but this could maybe be used in more useful ways.
The text was updated successfully, but these errors were encountered: