Ejemplo n.º 1
0
    void Start()
    {
        /*
         * if (isServer)
         *      pose = GameObject.Find("startpoint1").GetComponent<Transform>().position;
         * else
         *      pose = GameObject.Find("startpoint2").GetComponent<Transform>().position;
         */

        shotSound = GetComponent <AudioSource>();
        config    = GameObject.Find("Config").GetComponent <SceneConfiguration>();

        if (config.useROS)
        {
            ConnectToTcpServer();

            //buttons = new int[4];
            //axes = new float[4];

            Debug.Log("Connecting to ROS master at " + config.remoteIP);
            rosClient = new ROSClient(config.remoteIP);
            if (config.enableMyFilter)
            {
                rosClient.enableFilter(config.bufferSize);
            }

            //Debug.Log("Connected");
            rosClient.initSubscriber(config.subscribingTopic);
            rosClient.initPublisher(config.publishingTopic);
        }
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("Connecting to ROS master at " + remoteIP);
        rosClient = new ROSClient(remoteIP);
        if (enableMyFilter)
        {
            rosClient.enableFilter(bufferSize);
        }

        Debug.Log("Connected");
        rosClient.initSubscriber(subscribingTopic);
        rosClient.initPublisher(publishingTopic);
        buttons = new int[11];
        axes    = new float[8];
    }