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

Tail subsystem and commands #3

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Tail subsystem and commands #3

wants to merge 6 commits into from

Conversation

Onkornix
Copy link

@Onkornix Onkornix commented Dec 6, 2024

need guidance on the tail commands whether to use a relative or absolute encoder, or if my method is ok. also if I did the PID loops correctly.

@Onkornix Onkornix requested a review from fruzzmuffin December 6, 2024 01:42
Copy link
Contributor

@fruzzmuffin fruzzmuffin Dec 6, 2024

Choose a reason for hiding this comment

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

TailUpCommand and TailDownCommand can be one file with the setpoint as an initializing argument

Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are using a relative encoder instead of an absolute encoder, we should probably have a function that resets the encoder to a certain value. Since we don't have a feedforward here the literal value isn't needed, so I would just set it to zero.

}

override fun isFinished(): Boolean {
return tailPid.atSetpoint()
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should end this command. If the command ends after it hits the setpoint, then after it hits its setpoint it will go limp (with braking mode but still). I don't believe braking mode is enough to pull totes on its own. You can just make this return false and let the next command to the tail cancel this one through the default behavior of subsystem requirements.

Copy link
Contributor

Choose a reason for hiding this comment

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

it's either that or make the defaultCommand of Tail be a version of this command with a goal that keeps it at its current location

@Onkornix
Copy link
Author

Onkornix commented Dec 6, 2024

Alright I'll try to be there tomorrow and implement this stuff. Thanks!

@Onkornix
Copy link
Author

  • I changed it to one command that takes the setpoint as an argument
  • i removed the constant in the subsystem
  • made a default command for TailSubsystem that holds the motor still (I think)
  • made the encoder's position be set to pi/2 if the tail was in the lowered position when the motor is shut off

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

Successfully merging this pull request may close these issues.

3 participants