public MainWindow() { InitializeComponent(); ArduMan.findArduinos(); testDuino = ArduMan.getHandArduino(); testDuino.Data_Received+=testDuino_Data_Received; }
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(); incomingCOMViz.title = "Incoming COM"; incomingNETViz.title="Incoming NET"; outgoingCOMViz.title="Outgoing COM"; outgoingNETViz.title="Outgoing NET"; leftVid.setTitle("Palm Camera"); rightVid.setTitle("Angle Camera"); macroButtons.MacroPressed += macroButtons_MacroPressed; GUIArmDrive.directionPressed += GUIArmDrive_directionPressed; GUIArmDrive.isGrayedOut = true; ControlStatusPanel.activateButtonClicked += ControlStatusPanel_activateButtonClicked; ArduManage = ArduinoManager.Instance; if (ArduManage.findArduinos()) { //An ARM Arduino is connected to the computer try { ARM = ArduManage.getArmArduino(); } catch { MessageBox.Show("No ARM Arduino found, GUI cannot function correctly..."); } ARM.Data_Received += ARM_Data_Received; ControlStatusPanel.toggleLights(Control_Status.ControlStatus.Indication_Lights.Arm_Connected, true); } else { ControlStatusPanel.toggleLights(Control_Status.ControlStatus.Indication_Lights.Arm_Connected, false); } leftVid.setMJPEGVideoFeedSource("HTTP://localhost:8080"); leftVid.StartVideo(); rightVid.setMJPEGVideoFeedSource("HTTP://localhost:8080"); rightVid.StartVideo(); }
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); }
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); }
public MainWindow() { InitializeComponent(); cameraView = new dualCameraViewer.MainWindow(); cameraView.Show(); comVizIn.setTitle("PT COM IN"); comVizOut.setTitle("PT COM OUT"); ArduMan = ArduinoManager.Instance; ArduMan.findArduinos(); PTDuino = ArduMan.getPanTiltArduino(); PTDuino.Data_Received += PTDuino_Data_Received; orientation = OculusOrientation.getInstance(); orientation.orientationChanged += orientation_orientationChanged; }
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 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 MainWindow() { InitializeComponent(); driveIPLabel.Content = rocConstants.MCIP_DRIVE.ToString(); armIPLabel.Content = rocConstants.MCIP_ARM.ToString(); logisticsIPLabel.Content = rocConstants.MCIP_LOGISTICS; engineeringIPLabel.Content = rocConstants.MCIP_ENG.ToString(); NetMan = networkManager.getInstance(incomingDriveLineManager, incomingEngLineManager, incomingArmLineManager, incomingLogisticsLineManager); NetMan.DriveConnectionStatusChanged += NetMan_DriveConnectionStatusChanged; NetMan.EngineeringConnectionStatusChanged += NetMan_EngineeringConnectionStatusChanged; NetMan.ArmConnectionStatusChanged += NetMan_ArmConnectionStatusChanged; NetMan.LogisticsConnectionStatusChanged += NetMan_LogisticsConnectionStatusChanged; ArduMan = ArduinoManager.Instance; ArduMan.findArduinos(); backDrive = ArduMan.getDriveBackArduino(false); frontDrive = ArduMan.getDriveFrontArduino(false); ptDuino = ArduMan.getPanTiltArduino(true); ArmDuino = ArduMan.getArmArduino(false); HandDuino = ArduMan.getHandArduino(false); miscDuino = ArduMan.getMiscArduino(false); backDrive.Data_Received += backDrive_Data_Received; frontDrive.Data_Received += frontDrive_Data_Received; ptDuino.Data_Received += ptDuino_Data_Received; ArmDuino.Data_Received += ArmDuino_Data_Received; HandDuino.Data_Received += HandDuino_Data_Received; miscDuino.Data_Received += miscDuino_Data_Received; driveMan = driveManager.getInstance(backDrive, frontDrive, NetMan); ptMan = ptManager.getInstance(ptDuino, NetMan); armMan = armManager.getInstance(ArmDuino, HandDuino, NetMan); hwMonitor = ROCInfo.getInstance(1000);//updates once per second hwMonitor.updatedValue += hwMonitor_updatedValue; camMan = cameraManager.getInstance(); camMan.assignCameras(); VideoCaptureDevice panTiltLeft; VideoCaptureDevice panTiltRight; if(camMan.getCamera(rocConstants.CAMS.PT_left, out panTiltLeft) && camMan.getCamera(rocConstants.CAMS.PT_right, out panTiltRight)){ //if both the left and right cameras are found... panTiltTransmitter = new managedDualVideoTransmitter(panTiltLeft, panTiltRight, rocConstants.MCIP_DRIVE, rocConstants.MCPORT_DRIVE_VIDEO_OCULUS); panTiltTransmitter.startTransmitting(); } ////////////// ///VIDEO CAMS SETUP ////////////// VideoCaptureDevice palmCam; if (camMan.getCamera(rocConstants.CAMS.PALM, out palmCam)) { palmCamTransmitter = new managedVideoTransmitter(palmCam, rocConstants.MCIP_ARM, rocConstants.MCPORT_ARM_VIDEO_PALM); } VideoCaptureDevice noseCam; if (camMan.getCamera(rocConstants.CAMS.NOSE, out noseCam)) { noseCamTransmitter = new managedVideoTransmitter(noseCam, rocConstants.MCIP_DRIVE, rocConstants.MCPORT_DRIVE_VIDEO_NOSE); } VideoCaptureDevice humerusCam; if (camMan.getCamera(rocConstants.CAMS.Humerus, out humerusCam)) { humerusCamTransmitter = new managedVideoTransmitter(humerusCam, rocConstants.MCIP_ARM, rocConstants.MCPORT_ARM_VIDEO_HUMERUS); } ////////////// ///SNAPSHOT CAMS SETUP ////////////// VideoCaptureDevice logFrontCam; if (camMan.getCamera(rocConstants.CAMS.LOG_FRONT, out logFrontCam)) { logFrontSS = new snapShotSender(logFrontCam); } VideoCaptureDevice logRightCam; if (camMan.getCamera(rocConstants.CAMS.LOG_RIGHT, out logRightCam)) { logRightSS = new snapShotSender(logRightCam); } VideoCaptureDevice logBackCam; if (camMan.getCamera(rocConstants.CAMS.LOG_BACK, out logBackCam)) { logBackSS = new snapShotSender(logBackCam); } VideoCaptureDevice logLeftCam; if (camMan.getCamera(rocConstants.CAMS.LOG_LEFT, out logLeftCam)) { logLeftSS = new snapShotSender(logLeftCam); } }
private armManager(Arduino armArduino, Arduino handArduino, networkManager _netman) { armDuino = armArduino; handDuino = handArduino; netMan = _netman; netMan.incomingArm += netMan_incomingArm; armDuino.Data_Received += armDuino_Data_Received; handDuino.Data_Received += handDuino_Data_Received; }
public static armManager getInstance(Arduino armArduino, Arduino handArduino, networkManager _netman) { if (instance == null) { instance = new armManager(armArduino,handArduino,_netman); } return instance; }
private ptManager(Arduino panTiltArduino, networkManager _netMan) { ptDuino = panTiltArduino; netMan = _netMan; ptDuino.Data_Received += ptDuino_Data_Received; netMan.incomingDrive += netMan_incomingDrive; }
public static ptManager getInstance(Arduino panTiltArduino, networkManager _netMan) { if (instance == null) { instance = new ptManager(panTiltArduino, _netMan); } return instance; }
private driveManager(Arduino backArduino, Arduino frontArduino, networkManager _netMan) { frontDriveDuino = frontArduino; backDriveDuino = backArduino; frontDriveDuino.Data_Received += frontDriveDuino_Data_Received; backDriveDuino.Data_Received += backDriveDuino_Data_Received; netMan = _netMan; netMan.incomingDrive += netMan_incomingDrive; }
public static driveManager getInstance(Arduino backArduino, Arduino frontArduino, networkManager _netMan) { if (instance == null) { instance = new driveManager(backArduino, frontArduino, _netMan); } return instance; }