public new static void CallBack(Float64Msg msg)
    {
        Debug.Log("Hello Hello,can you hear me !" + msg.GetData());
        double temp1 = 8;
        double temp2 = 2;
        double temp3 = 4;
        double temp4 = 6;
        double temp5 = 5;

        if (msg.GetData() == temp1)
        {
            fw = 1;
            Debug.Log("Received");
        }
        else if (msg.GetData() == temp2)
        {
            bw = 2;
            Debug.Log("Received");
        }
        else if (msg.GetData() == temp3)
        {
            lf = 3;
            Debug.Log("Received");
        }
        else if (msg.GetData() == temp4)
        {
            rf = 4;
            Debug.Log("Received");
        }
        else if (msg.GetData() == temp5)
        {
            ju = 5;
            Debug.Log("Received");
        }
    }
    // This function should fire on each received ros message
    public static void CallBack(ROSBridgeMsg msg1)
    {
        Float64Msg msg = (Float64Msg)msg1;

        Debug.Log("Recieved Message : " + msg.GetData());
        // Update ball position, or whatever
        player = GameObject.Find("Player");
        rb     = player.GetComponent <Rigidbody>();
        if (msg.GetData() == 8)
        {
            rb.AddForce(new Vector3(0, 0, 500));
        }
        if (msg.GetData() == 6)
        {
            rb.AddForce(new Vector3(500, 0, 0));
        }
        if (msg.GetData() == 4)
        {
            rb.AddForce(new Vector3(-500, 0, 0));
        }
        if (msg.GetData() == 2)
        {
            rb.AddForce(new Vector3(0, 0, -500));
        }
        if (msg.GetData() == 5)
        {
            rb.AddForce(new Vector3(0, 500, 0));
        }
    }
Beispiel #3
0
 public double GetYaw()
 {
     return(_yaw.GetData());
 }
Beispiel #4
0
 public double GetAxisZ()
 {
     return(_axis_z.GetData());
 }
Beispiel #5
0
 public double GetAxisY()
 {
     return(_axis_y.GetData());
 }
Beispiel #6
0
 public double GetAxisX()
 {
     return(_axis_x.GetData());
 }