コード例 #1
0
ファイル: InfoUI.cs プロジェクト: Bing-Jing/DroneSim
 void Start()
 {
     connected = true;
     DM        = GameObject.FindGameObjectWithTag("Player").GetComponent <DroneMove> ();
     //latLonAlt = GameObject.FindGameObjectWithTag("System").GetComponent<LatLonAlt>();
     //udp = GameObject.FindGameObjectWithTag ("System").GetComponent<UdpClient> ();
 }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        DM     = player.GetComponent <DroneMove> ();

        //MavLink.MavLinkSerializer.Deserialize_ALTITUDE ();

//		else if(ENABLE){
//			/* generate rings , balls */
//			int counter = 0;
//			StreamReader reader = new StreamReader (path);
//			while (true) {
//				var str = reader.ReadLine ();
//				if (str == null)
//					break;
//				var parts = str.Split (' ');
//				pos = new Vector3 (float.Parse(parts[0]), float.Parse(parts[1]), float.Parse(parts[2]));
//				Quaternion rot = Quaternion.Euler(float.Parse(parts[3]), float.Parse(parts[4]), float.Parse(parts[5]));
//				if (prePos != Vector3.zero && Vector3.Distance (prePos, pos) < gerGap)
//					continue;
//				if (counter == ring_show_gap) {
//					Instantiate (ring, pos, rot);
//				}
//				else
//					Instantiate (coin, pos , rot);
//				counter++;
//				counter %= ring_gap;
//				prePos = pos;
//			}
//		}
    }
コード例 #3
0
    void Start()
    {
        rBody = GetComponent <Rigidbody>();
        DM    = this.gameObject.GetComponent <DroneMove>();

        resetTarget();
        StartX = this.transform.localPosition.x;
        StartZ = this.transform.localPosition.z;

        DM.AutoMove = true;
    }
コード例 #4
0
ファイル: UdpClient.cs プロジェクト: feofeona/DroneSim
    // Use this for initialization
    void Start()
    {
        SystemId    = (byte)MAV_MODE.MAV_MODE_MANUAL_ARMED;
        ComponentId = (byte)MAV_COMPONENT.MAV_COMP_ID_AUTOPILOT1;
        Application.runInBackground = true;
        mlpn            = new Msg_local_position_ned();
        mgpi            = new Msg_global_position_int();
        Mheratbeat      = new Msg_heartbeat();
        Msts            = new Msg_sys_status();
        Matt            = new Msg_attitude();
        Mdatastream     = new Msg_request_data_stream();
        Mgpsr           = new Msg_gps_raw_int();
        Mattq           = new Msg_attitude_quaternion();
        Mvhud           = new Msg_vfr_hud();
        MattTar         = new Msg_attitude_target();
        MHome           = new Msg_home_position();
        setMHome        = new Msg_set_home_position();
        setMode         = new Msg_set_mode();
        EstimatorStatus = new Msg_estimator_status();
        Mvirbration     = new Msg_vibration();
        ExtendState     = new Msg_extended_sys_state();

        latlonalt    = new LatLonAlt();
        Malt         = new Msg_altitude();
        positionL    = new Msg_position_target_local_ned();
        setPositionL = new Msg_set_position_target_local_ned();
        setPositionG = new Msg_set_position_target_global_int();
        PositionG    = new Msg_position_target_global_int();

        MhiIMU        = new Msg_highres_imu();
        BatteryStatus = new Msg_battery_status();


        player = GameObject.FindGameObjectWithTag("Player");
        DM     = player.GetComponent <DroneMove> ();
        InitSocket();

        setHomePosition();
        setPositionTargetLocal();
        setPositionTargetGlobal();
    }
コード例 #5
0
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     Drone  = player.GetComponent <DroneMove>();
 }
コード例 #6
0
ファイル: InfoUI.cs プロジェクト: feofeona/DroneSim
 void Start()
 {
     DM  = GameObject.FindGameObjectWithTag("Player").GetComponent <DroneMove> ();
     udp = GameObject.FindGameObjectWithTag("System").GetComponent <UdpClient> ();
 }