Package com.googlecode.grt192.HH11.controller.autonomous

Examples of com.googlecode.grt192.HH11.controller.autonomous.HHAutonomousController


  }

  @Override
  public void switchReleased(SwitchEvent arg0) {
    SafetyEvent safetyEvent = new SafetyEvent(this, 1); // TODO magic number
    // what is 1
    for (int i = 0; i < listeners.size(); i++) {
      listeners.get(i).suspend(safetyEvent);
    }
View Full Code Here


    mechanisms = new HHMechanism[numMechs];
    controllers = new HHController[numMechs];
    for (int i = 0; i < numMechs; i++) {
      switches[i] = new HHToggleSwitch(autoButtonSim, switchSims[i]);

      mechanisms[i] = new HHMechanism(
          new ISolenoid[] { this.actuatorSims[i] }, safetyButton);
      // safetyButton.addSafetyListener(mechanisms[i]);

      controllers[i] = new HHController(mechanisms[i], switches[i],
          waitTimes[i]);
View Full Code Here

    HHController[] controllers = new HHController[NUM_MECHS];
    for (int i = 0; i < NUM_MECHS; i++) {
      switches[i] = new HHToggleSwitch(autoRPC, rpcSwitches[i]);
      switches[i].startListening();

      mechanisms[i] = new HHMechanism(new ISolenoid[] { actuators[i],
          solenoids[i] }, safety);
      mechanisms[i].startListening();

      controllers[i] = new HHController(mechanisms[i], switches[i],
          MECHANISM_WAIT_TIMES[i]);
View Full Code Here

    // this.actuatorRPCs = actuatorRPCs;
    // this.safetyButton = safetyButton;
    // this.mechanisms = mechanisms;
    // this.controllers = controllers;

    safetyButton = new HHSafety(masterButtonSim);

    switches = new IHHSwitch[numMechs];
    mechanisms = new HHMechanism[numMechs];
    controllers = new HHController[numMechs];
    for (int i = 0; i < numMechs; i++) {
View Full Code Here

    }

    /**
     * Safety
     */
    HHSafety safety = new HHSafety(masterRPC);
    safety.startListening();

    /**
     * Mechanism code
     */
    IHHSwitch[] switches = new IHHSwitch[NUM_MECHS];
View Full Code Here

    switches = new IHHSwitch[numMechs];
    mechanisms = new HHMechanism[numMechs];
    controllers = new HHController[numMechs];
    for (int i = 0; i < numMechs; i++) {
      switches[i] = new HHToggleSwitch(autoButtonSim, switchSims[i]);

      mechanisms[i] = new HHMechanism(
          new ISolenoid[] { this.actuatorSims[i] }, safetyButton);
      // safetyButton.addSafetyListener(mechanisms[i]);
View Full Code Here

    IHHSwitch[] switches = new IHHSwitch[NUM_MECHS];
    HHMechanism[] mechanisms = new HHMechanism[NUM_MECHS];

    HHController[] controllers = new HHController[NUM_MECHS];
    for (int i = 0; i < NUM_MECHS; i++) {
      switches[i] = new HHToggleSwitch(autoRPC, rpcSwitches[i]);
      switches[i].startListening();

      mechanisms[i] = new HHMechanism(new ISolenoid[] { actuators[i],
          solenoids[i] }, safety);
      mechanisms[i].startListening();
View Full Code Here

     * Master button: started and initialized
     */
    MountedPosition masterButtonPos = new MountedPosition(RootMount.get(),
        SWITCH_POSITIONS[MASTER_BUTTON][X],
        SWITCH_POSITIONS[MASTER_BUTTON][Y], 0);
    SimSwitch masterButton = new SimSwitch(switchDisplay, masterButtonPos);
    // RPCSwitch masterRPC = new RPCSwitch(usbConn,
    // BUTTON_RPC_KEYS[MASTER_BUTTON]);
    SwitchDisplay masterButtonDisplay = new SwitchDisplay(masterButton,
        masterButtonPos, MECHANISM_NAMES[MASTER_BUTTON]);

    /**
     * Auto Button: started and initialized
     */
    MountedPosition autoButtonPos = new MountedPosition(RootMount.get(),
        SWITCH_POSITIONS[AUTO_BUTTON][X],
        SWITCH_POSITIONS[AUTO_BUTTON][Y], 0);
    SimSwitch autoButton = new SimSwitch(switchDisplay, autoButtonPos);
    // RPCSwitch autoRPC = new RPCSwitch(usbConn,
    // BUTTON_RPC_KEYS[AUTO_BUTTON]);
    SwitchDisplay autoButtonDisplay = new SwitchDisplay(autoButton,
        autoButtonPos, MECHANISM_NAMES[AUTO_BUTTON]);
    // TODO RPC
    // we will need to make an array that is passed in

    /**
     * Mechanism buttons : started and initialized
     */
    MountedPosition[] buttonPositions = new MountedPosition[NUM_MECHS];
    SimSwitch[] buttons = new SimSwitch[NUM_MECHS];
    SwitchDisplay[] buttonDisplays = new SwitchDisplay[NUM_MECHS];
    for (int i = 0; i < buttonPositions.length; i++) {
      buttonPositions[i] = new MountedPosition(RootMount.get(),
          SWITCH_POSITIONS[i][X], SWITCH_POSITIONS[i][Y], 0);
      buttons[i] = new SimSwitch(switchDisplay, buttonPositions[i]);
      buttonDisplays[i] = new SwitchDisplay(buttons[i],
          buttonPositions[i], MECHANISM_NAMES[i]);
    }
    /**
     * Solenoids
 
View Full Code Here

        SWITCH_POSITIONS[MASTER_BUTTON][X],
        SWITCH_POSITIONS[MASTER_BUTTON][Y], 0);
    SimSwitch masterButton = new SimSwitch(switchDisplay, masterButtonPos);
    // RPCSwitch masterRPC = new RPCSwitch(usbConn,
    // BUTTON_RPC_KEYS[MASTER_BUTTON]);
    SwitchDisplay masterButtonDisplay = new SwitchDisplay(masterButton,
        masterButtonPos, MECHANISM_NAMES[MASTER_BUTTON]);

    /**
     * Auto Button: started and initialized
     */
    MountedPosition autoButtonPos = new MountedPosition(RootMount.get(),
        SWITCH_POSITIONS[AUTO_BUTTON][X],
        SWITCH_POSITIONS[AUTO_BUTTON][Y], 0);
    SimSwitch autoButton = new SimSwitch(switchDisplay, autoButtonPos);
    // RPCSwitch autoRPC = new RPCSwitch(usbConn,
    // BUTTON_RPC_KEYS[AUTO_BUTTON]);
    SwitchDisplay autoButtonDisplay = new SwitchDisplay(autoButton,
        autoButtonPos, MECHANISM_NAMES[AUTO_BUTTON]);
    // TODO RPC
    // we will need to make an array that is passed in

    /**
     * Mechanism buttons : started and initialized
     */
    MountedPosition[] buttonPositions = new MountedPosition[NUM_MECHS];
    SimSwitch[] buttons = new SimSwitch[NUM_MECHS];
    SwitchDisplay[] buttonDisplays = new SwitchDisplay[NUM_MECHS];
    for (int i = 0; i < buttonPositions.length; i++) {
      buttonPositions[i] = new MountedPosition(RootMount.get(),
          SWITCH_POSITIONS[i][X], SWITCH_POSITIONS[i][Y], 0);
      buttons[i] = new SimSwitch(switchDisplay, buttonPositions[i]);
      buttonDisplays[i] = new SwitchDisplay(buttons[i],
          buttonPositions[i], MECHANISM_NAMES[i]);
    }
    /**
     * Solenoids
     */
 
View Full Code Here

    MountedPosition masterButtonPos = new MountedPosition(RootMount.get(),
        BUTTON_POSITIONS[MASTER_BUTTON][X],
        BUTTON_POSITIONS[MASTER_BUTTON][Y], 0);
    RPCSwitch masterRPC = new RPCSwitch(usbConn,
        BUTTON_RPC_KEYS[MASTER_BUTTON]);
    SwitchDisplay masterButtonDisplay = new SwitchDisplay(masterRPC,
        masterButtonPos, MECHANISM_NAMES[MASTER_BUTTON]);
    masterRPC.startListening();
    masterButtonDisplay.startListening();
    switchDisplay.addDisplayable(masterButtonDisplay);

    /**
     * Auto Button: started and initialized
     */
    MountedPosition autoButtonPos = new MountedPosition(RootMount.get(),
        BUTTON_POSITIONS[AUTO_BUTTON][X],
        BUTTON_POSITIONS[AUTO_BUTTON][Y], 0);
    RPCSwitch autoRPC = new RPCSwitch(usbConn, BUTTON_RPC_KEYS[AUTO_BUTTON]);

    SwitchDisplay autoButtonDisplay = new SwitchDisplay(autoRPC,
        autoButtonPos, MECHANISM_NAMES[AUTO_BUTTON]);
    autoRPC.startListening();
    autoButtonDisplay.startListening();
    switchDisplay.addDisplayable(autoButtonDisplay);

    /**
     * RPC SWITCHES
     */
    RPCSwitch[] rpcSwitches = new RPCSwitch[NUM_MECHS];
    for (int i = 0; i < NUM_MECHS; i++) {
      rpcSwitches[i] = new RPCSwitch(usbConn, BUTTON_RPC_KEYS[i]);
      rpcSwitches[i].startListening();
    }

    /**
     * Mechanism buttons : started and initialized
     */
    MountedPosition[] buttonPositions = new MountedPosition[NUM_MECHS];
    SwitchDisplay[] buttonDisplays = new SwitchDisplay[NUM_MECHS];
    for (int i = 0; i < buttonPositions.length; i++) {
      // TODO match real positions
      // TODO labels
      buttonPositions[i] = new MountedPosition(RootMount.get(),
          BUTTON_POSITIONS[i][X], BUTTON_POSITIONS[i][Y], 0);

      // rpcSwitches[i];
      buttonDisplays[i] = new SwitchDisplay(rpcSwitches[i],
          buttonPositions[i], MECHANISM_NAMES[i]);
      buttonDisplays[i].startListening();
      switchDisplay.addDisplayable(buttonDisplays[i]);
    }

View Full Code Here

TOP

Related Classes of com.googlecode.grt192.HH11.controller.autonomous.HHAutonomousController

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.