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

feat: ValorControllers #73

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

feat: ValorControllers #73

wants to merge 1 commit into from

Conversation

mray190
Copy link
Contributor

@mray190 mray190 commented Jul 21, 2022

ValorController is an abstract class that has 2 implementations:

  • ValorNeoController
  • ValorFalconController

Each controller houses the logic required to drive either a falcon or a neo. This is useful as we forgot to call specific functions in different subsystems that are associated with those motors in the past.

For example, setting up voltage compensation will be set for every motor now by default if you use a ValorController implementation (you still have the option of turning it off though if you desire!)

Instead, all of the logic is the same for each motor but can be modified if need be. There are getters and setters for the important functions for the motors.

Another thing to note is that since ValorController is an abstract class, the implementations share the exact same function calls. Using either class, you won't have to worry about which motor is under the hood since the calls all look the same.

Most importantly, this synchronizes the units of the motors. The falcon and neo both use different units at the base level. This ValorController class now makes sure that to Valor students, both have the same units. Conversion factors can be used to change them (if degrees are needed instead of inches or meters)

ValorController is an abstract class that has 2 implementations:
* ValorNeoController
* ValorFalconController

Each controller houses the logic required to drive either a
falcon or a neo. This is useful as we forgot to call specific
functions in different subsystems that are associated with those motors.

Instead, all of the logic is the same for each motor but can be
modified if need be. There are getters and setters for the important
functions for the motors.

Another thing to note is that since ValorController is an abstract class,
the implementations share the exact same function calls. Using either class,
you won't have to worry about which motor is under the hood since the calls
all look the same.

Most importantly, this synchronizes the units of the motors. The falcon
and neo both use different units at the base level. This ValorController
class now makes sure that to Valor students, both have the same units
@mray190 mray190 added the Ready label Jul 21, 2022
@mray190 mray190 requested a review from a team July 21, 2022 00:07
@mray190
Copy link
Contributor Author

mray190 commented Jul 21, 2022

Notes for how to read this code change:

  1. Start with the header files. Specifically, go through the header files in the following order:
    1. ValorController.h
    2. ValorNeoController.h
    3. ValorFalconController.h
  2. Then review the implementation of each controller:
    1. ValorNeoController.cpp
    2. ValorFalconController.cpp
  3. Finally review the usage by going through the subsystems and seeing how those controllers were used

@AntarcticaByToto
Copy link
Contributor

TODO
-valor falcon controller -> verify unit conversion for encoders (constructor)
-set limits -> add function to set forward and reverse independently
-how to change pidf slot on neo
-check waht setRange does
-implement getCurrent function (not done yet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants