FalconX-Robotics / frc2018

Code for our FRC 2018 robot.
MIT License
2 stars 5 forks source link

Elevator Subsystem API #6

Open moreheadm opened 6 years ago

moreheadm commented 6 years ago

As discussed in the meeting we need the following subsystem methods:

public class Elevator extends Subsystem {

public void runMotor(double speed);

// inches 
public  double getPositionFromBottom();

public boolean hitSwitch();

public boolean hitScale();

public boolean hitBottom();
}

Here's some pseudocode for runMotor():

// eventually add extra logic to slow down if we are close to bottom / scale
if (hitBottom()) {
    // don't move
    // reset Encoder 0 point
} else if (hitScale()) {
    // don't move
    // maybe reset Encoder 0 point to encoder distance - elevator height? this is harder
} else {
    motor_variable.setSpeed(speed);
}
myahn725 commented 6 years ago

Programming was discussing having limit switches on the specific heights of the elevator and taking readings from those to determine where on the elevator we are

myahn725 commented 6 years ago

Peter also mentioned to me that how we would know where to set the heights because the scale and switch may be at different heights at different times

myahn725 commented 6 years ago

Oof, that was really confusing. What I meant was that since the scale and switch can tilt (depending on the number of cubes on each side), the height that we set the elevator may not always be the same

myahn725 commented 6 years ago

A possible solution to this problem is having the driver manually setting the elevator. That's what I want to do

moreheadm commented 6 years ago

@myahn725 you could just go to the highest position every time. Seems easier than having the driver adjust the height.

moreheadm commented 6 years ago

@myahn725 regarding limit switches, do you guys have enough limit switches? If not you have to order them ASAP. Also, I'm not sure how you add a limit switch for the switch height.