Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

Made commands to change the elevator pitch position using encoder and… #62

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

Conversation

NadavZiri
Copy link
Contributor

… locking it in place when doing nothing.

Copy link
Contributor

@SaarYogev SaarYogev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are the changes. Just remember this is still work in progress, so you need to test it on the robot too.


// Called just before this Command runs the first time
protected void initialize() {
Robot.m_elevatorPitch.resetEncoders();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never reset the encoders in the ElevatorPitch. you need to keep track of your absolute position.


// Called repeatedly when this Command is scheduled to run
protected void execute() {
Robot.m_elevatorPitch.setPitchSetpoint(Robot.m_elevatorPitch.getPosition());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will change as the ElevatorPitch falls, and will efectivally do nothing. Use ChangePitchPositionUsingEncoder with Robot.m_elevatorPitch.getPosition() as your setpoint, similar to how the LockDrive command is built.

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

Successfully merging this pull request may close these issues.

2 participants