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 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(); xboxController = new XboxController.XboxController(); pilotPreferences.xboxController = xboxController; comSock = new commSockReceiver(35000); comSock.IncomingLine += comSock_IncomingLine; comSock.newConnection += comSock_newConnection; comSock.connectionLost += comSock_connectionLost; comSock.beginAccept(); driveInputMan = new driveInputManager(xboxController); driveTransmit = new driveTransmitter(driveInputMan, comSock); try { orientation = OculusOrientation.getInstance(); ptTransmitter = new OculusTransmitter(comSock, orientation); } catch (Exception e) { MessageBox.Show("WARNING! Oculus offline (probably not plugged in). ERROR: " + e.Message); } pilotPreferences.topSpeedChanged += pilotPreferences_topSpeedChanged; }
static void Main(string[] args) { XboxController.XboxController xboxController = new XboxController.XboxController(); armInputManager testManager = armInputManager.getInstance(xboxController); testManager.targetElbowChanged+=testManager_targetElbowChanged; testManager.targetShoulderChanged += testManager_targetShoulderChanged; testManager.targetTurnTableChanged += testManager_targetTurnTableChanged; }
public MainWindow() { InitializeComponent(); gShoulderSlider.ValueChanged += updateGShoulder; gElbowSlider.ValueChanged += updateGElbow; aShoulderSlider.ValueChanged += updateAShoulder; aElbowSlider.ValueChanged += updateAElbow; xboxController = new XboxController.XboxController(); testSideView.XboxController = xboxController; }
public MainWindow() { InitializeComponent(); xboxController = new XboxController.XboxController(); armTopTest.XboxController = xboxController; gAngleSlider.ValueChanged += updateGArmAngle; gLengthSlider.ValueChanged += updateGArmLength; aAngleSlider.ValueChanged += updateAArmAngle; aLengthSlider.ValueChanged += updateAArmLength; }
public MainWindow() { InitializeComponent(); pilotPrefComp.deadZoneLeftSensitivityChanged +=pilotPrefComp_deadZoneLeftSensitivityChanged; pilotPrefComp.deadZoneRightSensitivityChanged += pilotPrefComp_deadZoneRightSensitivityChanged; pilotPrefComp.deadZoneLeftMinChanged += pilotPrefComp_deadZoneLeftMinChanged; pilotPrefComp.deadZoneLeftMaxChanged += pilotPrefComp_deadZoneLeftMaxChanged; pilotPrefComp.deadZoneRightMinChanged += pilotPrefComp_deadZoneRightMinChanged; pilotPrefComp.deadZoneRightMaxChanged += pilotPrefComp_deadZoneRightMaxChanged; pilotPrefComp.topSpeedChanged += pilotPrefComp_topSpeedChanged; topSpeedVal.Content = pilotPrefComp.TopSpeedPercentage; //just so the gui shows the same value as the slider at boot... xboxController = new XboxController.XboxController(); pilotPrefComp.xboxController = xboxController; }
float deadzone = 15; // set lower for HIGHER resolution public MainWindow() { InitializeComponent(); ARMan = ArduinoManager.Instance; ARMan.findArduinos(); hanDuino = ARMan.getHandArduino(); hanDuino.Data_Received += hanDuino_Data_Received; comInViz.setTitle("WRIST COM IN"); comOutViz.setTitle("WRIST COM OUT"); XBController = new XboxController.XboxController(); XBController.ThumbStickLeft += XBController_ThumbStickLeft; XBController.ButtonAReleased += XBController_ButtonAReleased; //Press A to start/restart dance, exit live data mode. XBController.ButtonBReleased += XBController_ButtonBReleased; //Press B to go into live input mode, exit dance mode. XBController.ButtonStartReleased += XBController_ButtonStartReleased; //Press start button for emergency stop XBController.TriggerRight += XBController_TriggerRight; }
int deadzone = 1; //Lower this value for increased resolution (might cause slower response) public MainWindow() { InitializeComponent(); serialTimer = new Timer(serialTimerCallback, null, 0, 50); wristInViz.setTitle("WRIST COM IN"); ArduMan = ArduinoManager.Instance; ArduMan.findArduinos(); wristDuino = ArduMan.getHandArduino(); wristDuino.Data_Received += wristDuino_Data_Received; XBoxCon = new XboxController.XboxController(); XBoxCon.ThumbStickLeft+= XBoxCon_ThumbStickLeft; Dispatcher.Invoke(() => maxMagSlider.Value = MAX_MAGNITUDE); }
/// <summary> /// Sample code on using the Xbox controller library. /// </summary> public Program() { XboxController.XboxController controller = new XboxController.XboxController(); // Buttons controller.ButtonAPressed += ButtonAPressed; controller.ButtonAReleased += ButtonAReleased; controller.ButtonBPressed += ButtonBPressed; controller.ButtonBReleased += ButtonBReleased; controller.ButtonXPressed += ButtonXPressed; controller.ButtonXReleased += ButtonXReleased; controller.ButtonYPressed += ButtonYPressed; controller.ButtonYReleased += ButtonYReleased; controller.ButtonStartPressed += ButtonStartPressed; controller.ButtonStartReleased += ButtonStartReleased; controller.ButtonBackPressed += ButtonBackPressed; controller.ButtonBackReleased += ButtonBackReleased; controller.ButtonLeftShoulderPressed += ButtonLeftShoulderPressed; controller.ButtonLeftShoulderReleased += ButtonLeftShoulderReleased; controller.ButtonRightShoulderPressed += ButtonRightShoulderPressed; controller.ButtonRightShoulderReleased += ButtonRightShoulderReleased; controller.ThumbStickLeftPressed += ThumbStickLeftPressed; controller.ThumbStickLeftReleased += ThumbStickLeftReleased; controller.ThumbStickRightPressed += ThumbStickRightPressed; controller.ThumbStickRightReleased += ThumbStickRightReleased; // DPad controller.DPadUpPressed += DPadUpPressed; controller.DPadUpReleased += DPadUpReleased; controller.DPadDownPressed += DPadDownPressed; controller.DPadDownReleased += DPadDownReleased; controller.DPadLeftPressed += DPadLeftPressed; controller.DPadLeftReleased += DPadLeftReleased; controller.DPadRightPressed += DPadRightPressed; controller.DPadRightReleased += DPadRightReleased; // Triggers controller.TriggerLeft += TriggerLeft; controller.TriggerRight += TriggerRight; // ThumbSticks controller.ThumbStickLeft += ThumbStickLeft; controller.ThumbStickRight += ThumbStickRight; }
public MainWindow() { InitializeComponent(); ArduMan = ArduinoManager.Instance; ArduMan.findArduinos(); frontDriveDuino = ArduMan.getDriveFrontArduino(); backDriveDuino = ArduMan.getDriveBackArduino(); frontDriveDuino.Data_Received += frontDriveDuino_Data_Received; backDriveDuino.Data_Received += backDriveDuino_Data_Received; xboxCont = new XboxController.XboxController(); xboxCont.ThumbStickLeft += xboxCont_ThumbStickLeft; xboxCont.ThumbStickRight += xboxCont_ThumbStickRight; backDuinoInViz.setTitle("BACK COM IN"); backDuinoOutViz.setTitle("BACK COM OUT"); frontDuinoInViz.setTitle("FRONT COM IN"); frontDuinoOutViz.setTitle("FRONT COM OUT"); sendTimer = new Timer(sendTimerCallback, null, 0, 200); }
public driveInputManager(XboxController.XboxController _xboxController) { xboxController = _xboxController; xboxController.ThumbStickLeft += xboxController_ThumbStickLeft; xboxController.ThumbStickRight += xboxController_ThumbStickRight; }
public MainWindow() { InitializeComponent(); XBoxCon = new XboxController.XboxController(); testXboxMonitor.xboxController = XBoxCon; }
private armInputManager(XboxController.XboxController _xboxController) { xboxController = _xboxController; xboxController.ThumbStickRight += xboxController_ThumbStickRight; xboxController.TriggerLeft += xboxController_TriggerLeft; xboxController.TriggerRight += xboxController_TriggerRight; turntableUpdateThread = new Thread(new ThreadStart(turnTableUpdate)); turntableUpdateThread.Start(); elbowUpdateThread = new Thread(new ThreadStart(elbowUpdate)); elbowUpdateThread.Start(); shoulderUpdateThread = new Thread(new ThreadStart(shoulderUpdate)); shoulderUpdateThread.Start(); }
private armInputManager(XboxController.XboxController _xboxController) { xboxController = _xboxController; xboxController.ThumbStickRight += xboxController_ThumbStickRight; xboxController.TriggerLeft += xboxController_TriggerLeft; xboxController.TriggerRight += xboxController_TriggerRight; xboxController.ThumbStickLeft += xboxController_ThumbStickLeft; xboxController.ButtonRightShoulderPressed += xboxController_ButtonRightShoulderPressed; xboxController.ButtonLeftShoulderPressed += xboxController_ButtonLeftShoulderPressed; xboxController.ButtonRightShoulderReleased += bumperReleased; xboxController.ButtonLeftShoulderReleased += bumperReleased; turntableUpdateThread = new Thread(new ThreadStart(turnTableUpdate)); turntableUpdateThread.Start(); elbowUpdateThread = new Thread(new ThreadStart(elbowUpdate)); elbowUpdateThread.Start(); shoulderUpdateThread = new Thread(new ThreadStart(shoulderUpdate)); shoulderUpdateThread.Start(); wristUpdateThread = new Thread(new ThreadStart(wristUpdate)); wristUpdateThread.Start(); gripperUpdateThread = new Thread(new ThreadStart(gripperUpdate)); gripperUpdateThread.Start(); }
public static armInputManager getInstance(XboxController.XboxController _xboxController) { if (actualInstance != null) { return actualInstance; } else { actualInstance = new armInputManager(_xboxController); return actualInstance; } }
private armInputManager(XboxController.XboxController _xboxController, commSockReceiver _armCommSock) { xboxController = _xboxController; xboxController.ThumbStickRight += xboxController_ThumbStickRight; xboxController.TriggerLeft += xboxController_TriggerLeft; xboxController.TriggerRight += xboxController_TriggerRight; xboxController.ThumbStickLeft += xboxController_ThumbStickLeft; xboxController.ButtonRightShoulderPressed += xboxController_ButtonRightShoulderPressed; xboxController.ButtonLeftShoulderPressed += xboxController_ButtonLeftShoulderPressed; xboxController.ButtonRightShoulderReleased += bumperReleased; xboxController.ButtonLeftShoulderReleased += bumperReleased; xboxController.ButtonBPressed += xboxController_ButtonBPressed; turntableUpdateThread = new Thread(new ThreadStart(turnTableUpdate)); turntableUpdateThread.Start(); elbowUpdateThread = new Thread(new ThreadStart(elbowUpdate)); elbowUpdateThread.Start(); shoulderUpdateThread = new Thread(new ThreadStart(shoulderUpdate)); shoulderUpdateThread.Start(); wristUpdateThread = new Thread(new ThreadStart(wristUpdate)); wristUpdateThread.Start(); gripperUpdateThread = new Thread(new ThreadStart(gripperUpdate)); gripperUpdateThread.Start(); commSock = _armCommSock; commSock.IncomingLine += commSock_IncomingLine; commSock.connectionLost += commSock_connectionLost; }
public static armInputManager getInstance(XboxController.XboxController _xboxController, commSockReceiver _armCommSock) { if (actualInstance != null) { return actualInstance; } else { actualInstance = new armInputManager(_xboxController, _armCommSock); return actualInstance; } }