Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

Vertical Alignment Command #52

Open
drewwhis opened this issue Mar 9, 2020 · 0 comments
Open

Vertical Alignment Command #52

drewwhis opened this issue Mar 9, 2020 · 0 comments
Labels
software Write software

Comments

@drewwhis
Copy link
Member

drewwhis commented Mar 9, 2020

Write a command to instruct the robot to move forward or backwards depending on the value it gets for vy.

It will look very similar to the AutoDriveCommand, except we don't have to pass in any values.

In the execute, we can just say:

double vy = // Get vy from SmartDashboard
if (vy > 1) {
  // Move forward (away)
  mDrive.drive(0.25, 0, 0);
} else if (vy < -1) {
  // Move backward (toward)
  mDrive.drive(-0.25,0,0);
}

Then our isFinished could just return
vy < 1 && vy > -1

This would get us within 1 degree vertically.

We would also want to call our zeroing method in the initialize method. We may also want to add some code to determine if the target has been detected.

This assumes that vy is 0 when we're lined up.

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

No branches or pull requests

1 participant