コード例 #1
0
        public InputConfigDialog(ARDrone.Input.InputManager inputManager)
        {
            InitializeComponent();
            CreateControlsForNoDevice();

            Init(inputManager);
        }
コード例 #2
0
        public ConfigInput(ARDrone.Input.InputManager inputManager)
        {
            InitializeComponent();
            comboBoxDevices.SelectedIndex = 0;

            Init(inputManager);
        }
コード例 #3
0
        public void InitializeInputManager(ARDrone.Input.InputManager inputManager)
        {
            this.inputManager = inputManager;
            inputManager.SwitchInputMode(Input.InputManager.InputMode.NoInput);

            inputManager.NewInputDevice += new NewInputDeviceHandler(inputManager_NewInputDevice);
            inputManager.InputDeviceLost += new InputDeviceLostHandler(inputManager_InputDeviceLost);
            inputManager.RawInputReceived += new RawInputReceivedHandler(inputManager_RawInputReceived);
        }
コード例 #4
0
 public void InitializeInputManager(ARDrone.Input.InputManager inputManager)
 {
     this.inputManager = inputManager;
     AddInputListeners();
 }
コード例 #5
0
 public void Init(ARDrone.Input.InputManager inputManager)
 {
     InitializeControlMap();
     InitializeInputManager(inputManager);
     InitializeDeviceList();
 }
コード例 #6
0
ファイル: ConfigInput.xaml.cs プロジェクト: abraxas4/DR-Lib
 public ConfigInput(ARDrone.Input.InputManager inputManager)
 {
     InitializeComponent();
     Init(inputManager);
 }
コード例 #7
0
        private void ConnectDrone( ARDrone.Control.DroneConfig config )
        {
            bool paired = false;
            if ( _droneInit != null )
            {
                paired = _droneInit.DroneCommand.IsDronePaired;
            }
            _droneInit = new DroneInitializer( config );

            _droneInit.NetworkConnectionStateChanged += OnNetworkConnectionStateChanged;
            _droneInit.ConnectionStateChanged += OnConnectionStateChanged;
            _droneInit.DroneDataReady += OnDroneDataReady;
            _droneInit.DroneDataReady += OnOrientationChange;
            // Bind front drone camera
            _droneInit.DroneFrameReady += OnDroneFrameReady;

            _droneInit.DroneCommand.IsDronePaired = paired;
            _droneInit.StartDrone();

            _sendDroneCommand = new SendDroneCommand();
            _sendDroneCommand.ActiveDrone = _droneInit.DroneCommand;

            _Xbox360Gamepad.ActiveDrone = _droneInit.DroneCommand;
            _keyboardController.ActiveDrone = _droneInit.DroneCommand;
            ( (RideOnMotion.Inputs.Kinect.KinectSensorController)_inputController ).ActiveDrone = _droneInit.DroneCommand;
        }
コード例 #8
0
        private void updateInstrument(VerticalSpeedIndicatorInstrumentControl control, ARDrone.Control.ARDroneControl.DroneData droneData)
        {
            control.Invoke((MethodInvoker)delegate
            {

                control.SetVerticalSpeedIndicatorParameters(Convert.ToInt32(droneData.vZ));
            });
        }
コード例 #9
0
        private void updateInstrument(HeadingIndicatorInstrumentControl control, ARDrone.Control.ARDroneControl.DroneData droneData)
        {
            control.Invoke((MethodInvoker)delegate
            {
                // Psi range -180..0..180 but heading indicator require 0..360
                if (droneData.Psi > 0)
                {
                    control.SetHeadingIndicatorParameters(Convert.ToInt32(droneData.Psi / 1000));
                }
                else
                {
                    control.SetHeadingIndicatorParameters(360 + Convert.ToInt32(droneData.Psi / 1000));
                }

            });
        }
コード例 #10
0
        private void updateInstrument(AltimeterInstrumentControl control, ARDrone.Control.ARDroneControl.DroneData droneData)
        {
            control.Invoke((MethodInvoker)delegate
            {

                control.SetAlimeterParameters(droneData.Altitude);
            });
        }
コード例 #11
0
        private void updateInstrument(AttitudeIndicatorInstrumentControl control, ARDrone.Control.ARDroneControl.DroneData droneData)
        {
            control.Invoke((MethodInvoker)delegate
            {

                control.SetAttitudeIndicatorParameters((droneData.Theta / 1000), -(droneData.Phi / 1000));
            });
        }