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

✨ Motor Type Getter #723

Open
wants to merge 12 commits into
base: develop-pros-4
Choose a base branch
from

Conversation

SizzinSeal
Copy link
Contributor

Summary:

add API that gets the type of a motor

Motivation:

V5 Motors and EXP Motors have slightly different behaviour. For example, EXP motors achieve their max velocity at 8v, while V5 motors achieve their max velocity at 12v. The user may wish to handle this difference, but this requires that they know the type of the motor that's currently plugged in

Test Plan:

  • motor_get_type returns MOTOR_TYPE_V5 if a v5 motor is plugged in
  • motor_get_type returns MOTOR_TYPE_EXP if an EXP motor is plugged in
  • motor_get_type returns MOTOR_TYPE_INVALID if no motor is plugged in
  • motor_get_type returns MOTOR_TYPE_INVALID if something other than a motor is plugged in
  • above tests succeed when using Motor::get_type
  • above tests succeed when using Motor::get_type_all
  • above tests succeed when using MotorGroup::get_type
  • above tests succeed when using MotorGroup::get_type_all

src/devices/vdml_motors.c Outdated Show resolved Hide resolved
@Rocky14683
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Rocky14683
Copy link
Member

Download link

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.

2 participants