Lift Controllers

There are two Uvuv Lift Controllers- A Basic one, and an Advanced one.

UvuvBasicLift

The Uvuv Basic Lift is a really basic lift controller: you can move up, move down, and use PID to rotate to a degree.

(Uvuv Comment)- There are two constructors for this class in the cpp implementation, but there is only one declaration in the header file

An Uvuv Basic Lift takes in a pointer to a Motor Group, a pointer to a PIDFeedForwardController. Optionally, it takes a pointer to a PTO controller.

UvuvBasicLift(UvuvMotorGroup* liftMotorsArg, PIDFFController* pidFFControllerArg, PTO* ptoArg = nullptr);

rotateLiftTo

Rotates the lift to a specified degree

void rotateLiftTo(float degrees);

degrees- The amount of degrees you wish to rotate the lift

rotateLiftByVoltage

Rotates the lift by a specified voltage

void rotateLiftByVoltage(float voltage)

voltage - the amount of volts you wish to power the motors to go up

setPTO

Turns the PTO on or off

void setPTO(bool state)

state - the state you wish the PTO to be in - True for on and off for false

UvuvAdvancedLift

The Uvuv Advanced Lift has more complex parameters and functionality. It can keep track of the game pieces in your lift for easy gain scheduling, and can move based on height, along with having all the functions the Uvuv Basic Lift has.

UvuvAdvancedLift(UvuvMotorGroup* liftMotorsArg, PIDFFController* pidFFControllerArg, float defaultInchesFromGround,
    float minimumHeightArg, float maximumHeightArg)

liftMotorsArg - Pointer to an UvuvMotorGroup object

pidFFControllerArg - Pointer to a PID Feed Forward Controller

defaultInchesFromGround - Default height of the lift from the ground

minimumHeightArg - The lowest your lift can possibly go

maximumHeightArg - The highest the lift can possibly go

OR

UvuvAdvancedLift(std::vector<std::pair<int, motorRotation>> motorParameters, 
        PIDFFController* pidFFControllerArg, float defaultInchesFromGround, float minimumHeightArg, float maximumHeightArg);

motorParameters - The port number and then the rotation direction of the lift motors

pidFFControllerArg - Pointer to a PID Feed Forward Controller

defaultInchesFromGround - Default height of the lift from the ground

minimumHeightArg - The lowest your lift can possibly go

maximumHeightArg - The highest the lift can possibly go

moveToMaxHeight

moves the lift to the Max Height Possible

void moveToMaxHeight()

moveToMinHeight

moves the lift to the Minimum height possible

void moveToMinimumHeight()

moveToHeight

moves the lift to the height specified

void moveToHeight(float inchesFromGround)

inchesFromGround - The amount of inches from the ground that you want the lift to be raised to

getGamepiecesHeld

Get the number of gamepieces being held

int getGamepiecesBeingHeld()

grabGamepiece

(Uvuv Comment)- It would be better if you named this function addGamepieces- Notice the plural- because you do not add only one, like your Header Doc says this does. Same applies for the one below- dropGamepieces would be a better fit. In fact - It would probably be better if you merged the two functions - changeGamepieces - because these functions do pretty much the samething already.

Add count number of Gamepieces being held

void grabGamepiece(int count)

count - The number of Gamepieces you wish to add

dropGamepiece

Subtract count number of Gamepieces being held

void dropGamepiece(int count)

count - The number of Gamepieces you wish to subtract

Last updated