Beispiel #1
0
        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;
        }
Beispiel #2
0
 public engineeringNetworkManager(commSockReceiver _comSock, videoManager.ToolboxControl _VM)
 {
     VM = _VM;
     VM.intendedCameraStatusChanged+=VM_intendedCameraStatusChanged;
     comSock = _comSock;
     comSock.IncomingLine += comSock_IncomingLine;
 }
Beispiel #3
0
        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;
        }
Beispiel #4
0
        public MainWindow()
        {
            InitializeComponent();

            comSock = new commSockReceiver(35006);
            comSock.IncomingLine += comSock_IncomingLine;
            comSock.newConnection += comSock_newConnection;
            comSock.connectionLost += comSock_connectionLost;
            comSock.beginAccept();

            frontSSR = new snapShotReceiver(35007);
            frontSSR.newSnapShotReceived += frontSSR_newSnapShotReceived;

            rightSSR = new snapShotReceiver(35009);
            rightSSR.newSnapShotReceived += rightSSR_newSnapShotReceived;

            backSSR = new snapShotReceiver(35008);
            backSSR.newSnapShotReceived += backSSR_newSnapShotReceived;

            leftSSR = new snapShotReceiver(35011);
            leftSSR.newSnapShotReceived += leftSSR_newSnapShotReceived;

            this.WindowState = System.Windows.WindowState.Maximized;
            mapPalette.newPaletteItemSelected += mapPalette_newPaletteItemSelected;
            mapWin = new mapWindow();
            mapWin.Show();
            leftMagWin = new magnificationWindow(1, "Left Magnification");
            leftMagWin.Show();
            rightMagWin = new magnificationWindow(2, "Right Magnification");
            rightMagWin.Show();
        }
Beispiel #5
0
 public driveTransmitter(driveInputManager _driveInput, commSockReceiver _CSR) {
     CSR = _CSR;
     driveInput = _driveInput;
     driveInput.newLeftValue += driveInput_newLeftValue;
     driveInput.newRightValue += driveInput_newRightValue;
     sendTimer = new Timer(sendTimerCallback, null, 100, 100);
 }
Beispiel #6
0
 public MainWindow()
 {
     InitializeComponent();
     CSR = new commSockReceiver(35000);
     CSR.beginAccept();
     CSR.IncomingLine += CSR_IncomingLine;
     CSR.newConnection += CSR_newConnection;
 }
Beispiel #7
0
        public MainWindow()
        {
            InitializeComponent();

            comSock = new commSockReceiver(35010);
            comSock.IncomingLine += comSock_IncomingLine;
            comSock.newConnection += comSock_newConnection;
            comSock.connectionLost += comSock_connectionLost;
            comSock.beginAccept();

            videoManager.intendedCameraStatusChanged+=videoManager_intendedCameraStatusChanged;
            videoQualityControl.userUpdatedVideoTraits += videoQualityControl_userUpdatedVideoTraits;

            rareHeartbeatTimer = new Timer(rareHeartbeatTimerCallback, null, 2000, 25000);
        }
Beispiel #8
0
 public OculusTransmitter(commSockReceiver _CSR, OculusOrientation _OcuOrient) {
     CSR = _CSR;
     OcuOrient = _OcuOrient;
     OcuOrient.yawChanged += OcuOrient_yawChanged;
     OcuOrient.pitchChanged += OcuOrient_pitchChanged;
     sendTimer = new Timer(sendTimerCallback, null,100, 50); //can send up to 20 times per second
 }
Beispiel #9
0
        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;
        }
Beispiel #10
0
 public static armInputManager getInstance(XboxController.XboxController _xboxController, commSockReceiver _armCommSock)
 {
     if (actualInstance != null)
     {
         return actualInstance;
     }
     else
     {
         actualInstance = new armInputManager(_xboxController, _armCommSock);
         return actualInstance;
     }
 }
Beispiel #11
0
        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);
        }