public MainWindow() { InitializeComponent(); ArduMan = ArduinoManager.Instance; ArduMan.findArduinos(); handDuino = ArduMan.getHandArduino(); handDuino.Data_Received += handDuino_Data_Received; armDuino = ArduMan.getArmArduino(); armDuino.Data_Received += armDuino_Data_Received; Console.SetOut(consoleViz.getStreamLink()); //Show console output in gui Console.WriteLine("***Arm Control Booted***"); xboxController = new XboxController.XboxController(); armInput = armInputManager.getInstance(xboxController); armTransmitter = new localArmCommandTransmitter(armDuino, handDuino, armInput); xboxControllerMonitor.xboxController = xboxController; armSideView.armInputManager = armInput; armTopView.armInputManager = armInput; Console.WriteLine("***XBOX CONTROLLER CONNECTED***"); wristComponent._xboxController = xboxController; }
public MainWindow() { InitializeComponent(); palmVidWindow = new videoWindow(35003, videoWindow.monitors.secondMonitor,"Palm Cam Window"); palmVidWindow.Show(); humerusVidWindow = new videoWindow(35005, videoWindow.monitors.thirdMonitor, "Humerus Cam Window"); humerusVidWindow.Show(); inputOnlineInd.setIndicatorState(toggleIndicator.indicatorState.Red); xboxController = new XboxController.XboxController(); comSock = new commSockReceiver(35002); comSock.IncomingLine += comSock_IncomingLine; comSock.newConnection += comSock_newConnection; comSock.connectionLost += comSock_connectionLost; comSock.beginAccept(); armInputMan = armInputManager.getInstance(xboxController,comSock); armInputMan.InputUnlockedEvent += inputUnlocked; macros.newMacroData += macros_newMacroData; armTransmit = new armCommandTransmitter(armInputMan, comSock); xboxControlMonitor.xboxController = xboxController; armSideView.armInputManager = armInputMan; armTopView.armInputManager = armInputMan; wristVisualizer.armInput = armInputMan; }
public localArmCommandTransmitter(Arduino _armArduino , armInputManager _armInput) { armArduino = _armArduino; armInput = _armInput; armInput.targetElbowChanged += armInput_targetElbowChanged; armInput.targetShoulderChanged += armInput_targetShoulderChanged; armInput.targetTurnTableChanged += armInput_targetTurnTableChanged; elbowTimer = new Timer(elbowTimerCallback, null, 0, delay); shoulderTimer = new Timer(shoulderTimerCallback, null, 0, delay); turnTableTimer = new Timer(turnTableTimerCallback, null, 0, delay); }
public localArmCommandTransmitter(Arduino _armArduino, Arduino _handArduino, armInputManager _armInput) { armArduino = _armArduino; armInput = _armInput; handArduino = _handArduino; armInput.targetElbowChanged += armInput_targetElbowChanged; armInput.targetShoulderChanged += armInput_targetShoulderChanged; armInput.targetTurnTableChanged += armInput_targetTurnTableChanged; armInput.targetWristChanged += armInput_targetWristChanged; armInput.targetGripperChanged += armInput_targetGripperChanged; armInput.EmergencyStop = emerStop; elbowTimer = new Timer(elbowTimerCallback, null, 0, delay); shoulderTimer = new Timer(shoulderTimerCallback, null, 0, delay); turnTableTimer = new Timer(turnTableTimerCallback, null, 0, delay); wristTimer = new Timer(wristTimerCallback, null, 0, delay); gripperTimer = new Timer(gripperTimerCallback, null, 0, delay); }
public static armInputManager getInstance(XboxController.XboxController _xboxController) { if (actualInstance != null) { return actualInstance; } else { actualInstance = new armInputManager(_xboxController); return actualInstance; } }
public static armInputManager getInstance(XboxController.XboxController _xboxController, commSockReceiver _armCommSock) { if (actualInstance != null) { return actualInstance; } else { actualInstance = new armInputManager(_xboxController, _armCommSock); return actualInstance; } }
public armCommandTransmitter(armInputManager _armInput, commSockReceiver _CSR) { armInput = _armInput; CSR = _CSR; armInput.EmergencyStop += emergencyStop; armInput.targetTurnTableChanged += armInput_targetTurnTableChanged; armInput.targetShoulderChanged += armInput_targetShoulderChanged; armInput.targetElbowChanged += armInput_targetElbowChanged; armInput.targetGripperChanged += armInput_targetGripperChanged; armInput.targetWristChanged += armInput_targetWristChanged; wristTimer = new Timer(wristTimerCallback,null,200,200); //transmits 5 times per second turnTableTimer = new Timer(turnTableTimerCallback, null, 190, 200); shoulderTimer = new Timer(shoulderTimerCallback, null, 180, 200); elbowTimer = new Timer(elbowTimerCallback, null, 170, 200); gripperTimer = new Timer(gripperTimerCallback, null, 160, 200); }
private armMacroExecutor(armInputManager _armIn) { armIn = _armIn; armIn.EmergencyStop += emergencyStopHandler; stepTimer = new Timer(stepCallback, null, Timeout.Infinite, Timeout.Infinite); //////////TEST BEGIN testDance.Enqueue(new armMovement(5000, 54, armConstants.armActuatorID.shoulder)); testDance.Enqueue(new armMovement(5000, 130, armConstants.armActuatorID.turnTable)); testDance.Enqueue(new armMovement(5000, 55, armConstants.armActuatorID.elbow)); //////////TEST END }
public Queue<armMovement> testDance = new Queue<armMovement>(); //TODO: THIS IS FOR TESTING! KILL IT LATER! public static armMacroExecutor getInstance(armInputManager _armIn) { if (Instance == null) { Instance = new armMacroExecutor(_armIn); } return Instance; }