Exemple #1
0
 // Use this for initialization
 void Start()
 {
     _socket = GameObject.Find("SocketIO").GetComponent <SocketIOComponent>();
     _socket.On("open", OnOpen);
     _socket.On("reset", OnReset);
     _socket.On("steer", OnSteer);
     _socket.On("manual", onManual);
     _carController = CarRemoteControl.GetComponent <CarController>();
     wpt            = new WaypointTracker_pid();
 }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        _carController = CarRemoteControl.GetComponent <CarController>();
        wpt            = new WaypointTracker_pid();

        //connect to TCP Server
        ReadOk  = false;
        WriteOk = false;
        try
        {
            client = new TcpClient(Server_IP, SERVER_PORT);
            client.GetStream().BeginRead(readBuffer, 0, READ_BUFFER_SIZE, new AsyncCallback(DoRead), null);
            Debug.Log("Connection OK!");
        }
        catch (Exception ex)
        {
            Debug.Log("Connection ERROR!");
        }
    }