RobotCasserole1736 / RobotCasserole2022

RobotCasserole team 1736 Rapid React 2022 software
MIT License
4 stars 2 forks source link

Add Intake/Singulator control Class #28

Open gerth2 opened 2 years ago

gerth2 commented 2 years ago

image

Add a class to control the intake and the singulator motors.


// Possible states we could want the elevator to be running in
// STOP: don't move
// INTAKE: move cargo into and through the singulator into the elevator
// EJECT: move cargo toward the intake 
public enum intakeCmdState{
    STOP,
    INTAKE,
    EJECT
}

public void setCmd(intakeCmdStatecmd_in){

}

public void update(){

}

Assume at least one DoubleSolenoid is being used to control a pneumatic cylinder which extends and retracts the intatake. To start, assume in non-stopped states, the intake solenoid needs to extend, and otherwise retract. However, this is a key requirement to discuss with the intake team, we don't actually know for sure how to control it.

Assume the non-smart motors are connected to a Victor SPX motor controller, and only has voltage control desired (no closed-loop speed control).

Calibrations should be present for the voltage or speed to use one each set of motors in the INTAKE and EJECT modes.

Work with the intake team to understand how the singulator and intake work together. You can start with the assumption that the singulator motors need to run in specific speeds/directions while the intake is intaking, but can stop when the intake stops. However, depending on physical design, we may need an additional SINGULATE state command which only runs the singulator.

Integrate the code into robot.java. Hardcode different commands in teleop, and run in simulation to be sure you see the motor controllers show up and see its command change, and the cylender extends/retracts in simulation.