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

PROS 4.0.1 Motors/Motor Group Design #525

Closed
Richard-Stump opened this issue Feb 10, 2023 · 2 comments
Closed

PROS 4.0.1 Motors/Motor Group Design #525

Richard-Stump opened this issue Feb 10, 2023 · 2 comments
Labels
rfc This describes a feature, enhancement, or optimization in broad terms and should be discussed

Comments

@Richard-Stump
Copy link
Contributor

Background

The current design for Motors, Motor Groups, and their relation is not well liked and goes against C++ norms. We are reverting back to the original idea since the better maintainability does not out weigh the priority of a good API.

Proposal:

Motors and motor groups inherit from a class named AbstractMotor like originally planned. This class is not constructable (as it is abstract) and contains virtual methods for functions from motors and motor groups

  • The motor's move functions. For motor groups, they tell all the motors in the group to move uniformly
  • The motor's set functions. For groups, they set the parameter for each motor uniformly
  • The motor's get functions: For groups, they get the value from the first motor
  • The motor group's get_all_* functions. For motors, they return a vector of 1.

We are also removing the OOP features from the motors/groups since they caused too many issues. The constant calls to send the parameters caused issues. We're moving the OOP reversed flag to the C api level.

Looking for any more thoughts and considerations on this.

@Richard-Stump Richard-Stump added the rfc This describes a feature, enhancement, or optimization in broad terms and should be discussed label Feb 10, 2023
@djava
Copy link
Contributor

djava commented Feb 10, 2023

This sounds much nicer, I appreciate this decision 👍👍

@WillXuCodes WillXuCodes changed the title RFC: PROS 4.0.1 Motors/Motor Group Design PROS 4.0.1 Motors/Motor Group Design Feb 15, 2023
@Richard-Stump
Copy link
Contributor Author

Closed since #532 implements this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfc This describes a feature, enhancement, or optimization in broad terms and should be discussed
Projects
None yet
Development

No branches or pull requests

2 participants