-
Notifications
You must be signed in to change notification settings - Fork 0
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
Using Elbow IMU #33
base: main
Are you sure you want to change the base?
Using Elbow IMU #33
Conversation
RobotMap.leftElbowMotor.set(TalonFXControlMode.Position, elbow); | ||
|
||
// TODO: figure out if reading pitch or roll | ||
elbowCommand = controller.calculate(RobotMap.elbowIMU.getRoll(), elbow); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not going to work. Previously we were sending down a target to the motor PID and the Motor PID was calculating the motor output every loop. Now we need to do this calculation loop ourselves. This function should only set the target of the PID, and then the PID calculation needs to occur every loop. Best way I can see of doing this is to make a periodic function in this class and call it in the overall robot periodic function. Also I am not sure how follower mode works, but we might need to set the power for both elbow motors instead of just one.
Math.abs(RobotMap.leftElbowMotor.getSelectedSensorPosition() - elbowTarget) <= Math.abs(allowance)) { | ||
public static Boolean getArrived(double shoulderAllowance, double elbowAllowance, double time) { | ||
if (Math.abs(RobotMap.leftShoulderMotor.getSelectedSensorPosition() - shoulderTarget) <= Math.abs(shoulderAllowance) && | ||
Math.abs(RobotMap.leftElbowMotor.getSelectedSensorPosition() - elbowTarget) <= Math.abs(elbowAllowance)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not using the internal motor encoder for position anymore, we are using the gyro. The sensor reading call needs to reflect that.
RobotMap.leftElbowMotor.set(TalonFXControlMode.Position, Constants.ELBOW_IDLE.ELBOW_POSITION); | ||
|
||
// TODO: figure out if reading pitch or roll | ||
elbowCommand = controller.calculate(RobotMap.elbowIMU.getRoll(), Constants.ELBOW_IDLE.ELBOW_POSITION); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the function below
No description provided.