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

Latest commit

 

History

History
42 lines (39 loc) · 821 Bytes

TELESCOP.md

File metadata and controls

42 lines (39 loc) · 821 Bytes

CANBUS: rio

public enum TelescopicState {
    /* neutral - in brake */
    HOLD,
    /* open loop control */
    OPEN_LOOP,
    /* closed-loop motion magic */
    CLIMB,
    /* stop motors */
    STOP,
  }

2 separate states for left and right telescopics:

switch (leftState) {
      case HOLD:
        m_left_motor.setControl(new NeutralOut());
        break;
      case OPEN_LOOP:
        setLeftOutput();
        break;
      default:
        stopLeft();
        break;
    }

switch (rightState) {
      case HOLD:
        m_right_motor.setControl(new NeutralOut());
        break;
      case OPEN_LOOP:
        setRightOutput();
        break;
      default:
        stopRight();
        break;
    }