panthertech292 / 2023_r

Main Robot Code 2023
Other
0 stars 0 forks source link

Restrict the arm from going to high. #4

Closed Derp88 closed 1 year ago

Derp88 commented 1 year ago

The arm probably needs a restriction in code to keep it from going to high, so we don't get penalties.

We could add a stop directly in the subsystem itself where the upper arm motor is controlled.

public void setUpperArmMotorSpeed(double upperarmspped){ v_upperArmSpeed = upperarmspped; UpperArmMotor.set(-v_upperArmSpeed);

This could work with having some sort of if statement to check if the lower arm is set to the up position and check the encoder position of the upper arm. If the encoder position of the upper arm is too great, we can only allow no movement or only movement in the opposite direction.

It might be a wiser idea to implement this in the commands(Manual & Control) that control the arm instead. This way the arm can still be fully moved for testing or other purposes. This is probably the better practice approach.

I'm writing this all down, because I feel too tired right now to implement this in code and have it work right.

Derp88 commented 1 year ago

Mostly done. There is probably a few edge cases left, but the most problematic cases have been solved.