Ejemplo n.º 1
0
    public void RequestArmPositionsFromServerAndFreeze()
    {
        Debug.Log("requesting freeze pos from server.");
        FreezeArmPositionMessage m = new FreezeArmPositionMessage();

        myClient.Send(MyMsgTypes.MSG_FREEZE_ARM_POSITION, m);
    }
Ejemplo n.º 2
0
    private void ReceiveFreezeArmPosition(NetworkMessage netMsg)
    {
        var msg = netMsg.ReadMessage <FreezeArmPositionMessage>(); // irrelevent, client doesn't need to send us anything except the request itself
        FreezeArmPositionMessage m = new FreezeArmPositionMessage();

        float[] positions = KinovaAPI.GetCartesianPositions();
        m.x      = positions[0];
        m.y      = positions[1];
        m.z      = positions[2];
        m.thetaX = positions[3];
        m.thetaY = positions[4];
        m.thetaZ = positions[5];
        m.fp1    = positions[6];
        m.fp2    = positions[7];
        m.fp3    = 0;
        NetworkServer.SendToAll(MyMsgTypes.MSG_FREEZE_ARM_POSITION, m);
        Debug.Log("Sending frozen position!");
    }