예제 #1
0
    //public bool showParticles = true;

    //public GameObject[] thrusterClockwise;
    //public GameObject[] thrusterCounterClockwise;

    // Start is called before the first frame update
    void Start()
    {
        desired_angle = 0;
        lightSensors  = GetComponentsInChildren <LightSensor2>();
        solarPanels   = GetComponentsInChildren <SolarPanel2>();

        rgbd = GetComponent <Rigidbody>();

        //pidRotate = new PIDController(0.000001f, 0.025f, 0.0000f);
        pidRotate = new PIDController(5f, 1f, 0.01f);
        //pidRotate = new PIDController(1f, 0f, 0f);
        //pidRotate = new PIDController(1f, 0.001f, 0.001f);
        //pidRotate = new PIDController(0.001f, 0f, 0f);

        //AnimateThrusters(thrusterClockwise, false);
        //AnimateThrusters(thrusterCounterClockwise, false);

        socket = FindObjectOfType <NetworkHandler>().client;

        socket.On("connect", () =>
        {
            //socket.FillSendBuffer<string>("u","\"float\"");
            socket.FillSendBuffer <string>("actual_angle", "\"float\"");
            socket.FillSendBuffer <string>("desired_angle", "\"float\"");
            socket.SendAvailableData();
        });
    }