Client WebSocket Protocol

Client WebSocket Protocol

Desktop Teleoperation Robot: TeleTwin Desktop

(1) Synchronous

The synchronous client is DesktopClient. The PC async client DesktopPCAsyncClient sends the same messages as below.

Request format

{
  // async_params.embodiment from the task, passed through unchanged
  "embodiment": "teletwin_desktop/gripper-g",
  // Present only if configured. The client accepts only "provided" (the alias "catalog" is rewritten to provided)
  "normalization": "provided",
  // instruction from the task, collapsed from a string array into one string
  "instruction": "pick up the cup",
  "observation": {
    "images": {
      "front": "<JPEG bytes>",       // internal camera_front, the head camera
      "left_wrist": "<JPEG bytes>",  // internal camera_left
      "right_wrist": "<JPEG bytes>"  // internal camera_right. A camera that is null is omitted
    },
    "state": {
      // Split from the 7 values of follow1_pos. Position in meters, rotation in radians
      // rotation_rpy = [roll, pitch, yaw], rotation matrix Rz(yaw)·Ry(pitch)·Rx(roll)
      "left_ee": {
        "position": [0.42, 0.18, 0.31],
        "rotation_rpy": [0.01, 1.55, 0.02],
        "gripper": 0.04
      },
      "right_ee": {
        "position": [0.41, -0.19, 0.30],
        "rotation_rpy": [-0.02, 1.57, 0.01],
        "gripper": 0.03
      }
    },
    // Internal fields not mapped into state. The server does not read them for inference today
    "extra_state": {
      // 6-axis arm: 6 joints + trailing gripper, 7 values in total. A 7-axis arm has 8
      "follow1_joints": [0.1, -0.4, 0.2, 1.2, 0.0, 0.3],   // trailing gripper removed, (N,)
      "follow2_joints": [0.1, 0.4, 0.2, 1.2, 0.0, 0.3],
      "follow1_joints_cur": [0.2, 0.1, 0.0, 0.4, 0.0, 0.1, 0.05],  // joint torques + gripper torque
      "follow2_joints_cur": [0.2, 0.1, 0.0, 0.4, 0.0, 0.1, 0.04],
      "follow1_joints_dev": [0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0],     // (N,) arm velocities only; last slot is a gripper placeholder 0
      "follow2_joints_dev": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
      "follow1_end_effort_force": [0.1, -0.2, 1.4],    // end-effector force, local frame, (3,)
      "follow1_end_effort_torque": [0.0, 0.01, 0.0],   // end-effector torque, local frame, (3,)
      "follow2_end_effort_force": [0.0, 0.1, 1.2],
      "follow2_end_effort_torque": [0.0, 0.0, 0.0]
    }
  }
}

Response format

The Desktop state has no head, lift, or chassis, so the response has none of these either.

{
  "embodiment": "teletwin_desktop/gripper-g",   // echoes the request
  "actions": {
    "left_ee": {
      "position": [                      // actual shape [32, 3]; only the first 2 frames shown
        [0.421, 0.181, 0.309],
        [0.422, 0.182, 0.308]
      ],
      "rotation_rpy": [                  // actual shape [32, 3], [roll, pitch, yaw]
        [0.011, 1.549, 0.021],
        [0.012, 1.548, 0.022]
      ],
      "gripper": [0.041, 0.042]          // actual shape [32]
    },
    "right_ee": {
      "position": [
        [0.411, -0.191, 0.301],
        [0.412, -0.190, 0.302]
      ],
      "rotation_rpy": [
        [-0.019, 1.569, 0.011],
        [-0.018, 1.568, 0.012]
      ],
      "gripper": [0.031, 0.032]
    }
  }
}

Entries with the same index belong to the same frame. actions.left_ee.gripper[5] executes together with actions.left_ee.position[5].

(2) RTC

The RTC client is DesktopRTCAsyncClient. Below is a request sent when actions from the previous step are already available. The first step has no use_rtc group; everything else is the same as synchronous mode. In RTC, follow1_joints keeps the trailing gripper (the Desktop synchronous client and EX001 both drop it; this is a client implementation difference).

Request format

{
  "embodiment": "teletwin_desktop/gripper-g",
  "normalization": "provided",
  "instruction": "pick up the cup",
  "observation": {
    "images": {
      "front": "<JPEG bytes>",
      "left_wrist": "<JPEG bytes>",
      "right_wrist": "<JPEG bytes>"
    },
    "state": {
      "left_ee": {
        "position": [0.42, 0.18, 0.31],
        "rotation_rpy": [0.01, 1.55, 0.02],
        "gripper": 0.04
      },
      "right_ee": {
        "position": [0.41, -0.19, 0.30],
        "rotation_rpy": [-0.02, 1.57, 0.01],
        "gripper": 0.03
      }
    },
    "extra_state": {
      // RTC keeps the trailing gripper: one more value than synchronous mode
      "follow1_joints": [0.1, -0.4, 0.2, 1.2, 0.0, 0.3, 0.04],
      "follow2_joints": [0.1, 0.4, 0.2, 1.2, 0.0, 0.3, 0.03],
      "follow1_joints_cur": [0.2, 0.1, 0.0, 0.4, 0.0, 0.1, 0.05],
      "follow2_joints_cur": [0.2, 0.1, 0.0, 0.4, 0.0, 0.1, 0.04],
      "follow1_joints_dev": [0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0],
      "follow2_joints_dev": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
      "follow1_end_effort_force": [0.1, -0.2, 1.4],
      "follow1_end_effort_torque": [0.0, 0.01, 0.0],
      "follow2_end_effort_force": [0.0, 0.1, 1.2],
      "follow2_end_effort_torque": [0.0, 0.0, 0.0]
    }
  },
  // Present only when the previous step still has a usable prefix. The server accepts inference_delay of 1, 2, 3, or 4 only
  "rtc_mode": "training_time",
  "use_rtc": true,
  "inference_delay": 4,
  "num_flow_steps": 10,
  "prev_action_chunk": {
    "left_ee": {
      "position": [[0.420, 0.180, 0.310], [0.421, 0.181, 0.309]],
      "rotation_rpy": [[0.010, 1.550, 0.020], [0.011, 1.549, 0.021]],
      "gripper": [0.040, 0.041]
    },
    "right_ee": {
      "position": [[0.410, -0.190, 0.300], [0.411, -0.191, 0.301]],
      "rotation_rpy": [[-0.020, 1.570, 0.010], [-0.019, 1.569, 0.011]],
      "gripper": [0.030, 0.031]
    }
  }
}

Response format

{
  "embodiment": "teletwin_desktop/gripper-g",
  "actions": {
    "left_ee": {
      "position": [[0.421, 0.181, 0.309], [0.422, 0.182, 0.308]],
      "rotation_rpy": [[0.011, 1.549, 0.021], [0.012, 1.548, 0.022]],
      "gripper": [0.041, 0.042]
    },
    "right_ee": {
      "position": [[0.411, -0.191, 0.301], [0.412, -0.190, 0.302]],
      "rotation_rpy": [[-0.019, 1.569, 0.011], [-0.018, 1.568, 0.012]],
      "gripper": [0.031, 0.032]
    }
  }
  // "rtc": {"enabled": true, "effective_delay": 4, "trained_max_delay": 4}
}

If inference_delay is greater than 4, the server returns rtc_delay_exceeds_training with no actions.


Quanta X1 Pro: Quanta_X1_Pro (x86)

When the state includes head, lift, and chassis velocity, the server runs inference as the wheeled quanta_x1_pro. observation.state.car_pose is a velocity [vx, vy, wz], not a pose.

(1) Synchronous

The synchronous client is EX001Client. The PC async client EX001PCAsyncClient has the same public fields as below.

Request format

{
  "embodiment": "quanta_x1_pro/gripper-g",
  "normalization": "provided",
  "instruction": "fold the towel",
  "observation": {
    "images": {
      "front": "<JPEG bytes>",
      "left_wrist": "<JPEG bytes>",
      "right_wrist": "<JPEG bytes>"
    },
    "state": {
      "left_ee": {
        "position": [0.35, 0.20, 0.90],
        "rotation_rpy": [0.02, 1.20, -0.01],
        "gripper": 0.02
      },
      "right_ee": {
        "position": [0.36, -0.21, 0.91],
        "rotation_rpy": [0.01, 1.22, 0.00],
        "gripper": 0.02
      },
      "head_pose": [0.10, -0.20],   // [yaw, pitch], radians
      "lift": 0.45,                 // lift height, meters
      "car_pose": [0.05, 0.00, 0.01] // velocity [vx, vy, wz]. The first frame is [0, 0, 0]
    },
    "extra_state": {
      "follow1_joints": [0.2, -0.5, 0.1, 1.4, 0.0, 0.2],   // arm only, no gripper
      "follow2_joints": [0.2, 0.5, 0.1, 1.4, 0.0, 0.2],
      "follow1_joints_cur": [0.1, 0.0, 0.2, 0.3, 0.0, 0.1, 0.01],
      "follow2_joints_cur": [0.1, 0.0, 0.2, 0.3, 0.0, 0.1, 0.01],
      "follow1_joints_dev": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],  // last slot is a gripper placeholder 0
      "follow2_joints_dev": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
      // This is the pose relative to the start [x, y, yaw], not the same quantity as the velocity car_pose above
      "car_pose": [0.12, -0.03, 0.08]
    }
  }
}

Response format

{
  "embodiment": "quanta_x1_pro/gripper-g",
  "actions": {
    "left_ee": {
      "position": [[0.351, 0.201, 0.901], [0.352, 0.202, 0.900]],
      "rotation_rpy": [[0.021, 1.201, -0.009], [0.022, 1.200, -0.008]],
      "gripper": [0.021, 0.022]
    },
    "right_ee": {
      "position": [[0.361, -0.211, 0.911], [0.362, -0.210, 0.910]],
      "rotation_rpy": [[0.011, 1.221, 0.001], [0.012, 1.220, 0.002]],
      "gripper": [0.021, 0.022]
    },
    "head_pose": [[0.10, -0.20], [0.11, -0.19]],                 // actual [32, 2]
    "lift": [0.45, 0.451],                                       // actual [32]
    "velocity_decomposed_odom": [[0.05, 0.00, 0.01], [0.05, 0.00, 0.02]]  // actual [32, 3], velocity
  }
}

(2) RTC

The RTC client is EX001AsyncClient. The first step has no use_rtc. prev_action_chunk contains only the left and right arms.

Request format

{
  "embodiment": "quanta_x1_pro/gripper-g",
  "normalization": "provided",
  "instruction": "fold the towel",
  "observation": {
    "images": {
      "front": "<JPEG bytes>",
      "left_wrist": "<JPEG bytes>",
      "right_wrist": "<JPEG bytes>"
    },
    "state": {
      "left_ee": {
        "position": [0.35, 0.20, 0.90],
        "rotation_rpy": [0.02, 1.20, -0.01],
        "gripper": 0.02
      },
      "right_ee": {
        "position": [0.36, -0.21, 0.91],
        "rotation_rpy": [0.01, 1.22, 0.00],
        "gripper": 0.02
      },
      "head_pose": [0.10, -0.20],
      "lift": 0.45,
      "car_pose": [0.05, 0.00, 0.01]
    },
    "extra_state": {
      "follow1_joints": [0.2, -0.5, 0.1, 1.4, 0.0, 0.2],
      "follow2_joints": [0.2, 0.5, 0.1, 1.4, 0.0, 0.2],
      "follow1_joints_cur": [0.1, 0.0, 0.2, 0.3, 0.0, 0.1, 0.01],
      "follow2_joints_cur": [0.1, 0.0, 0.2, 0.3, 0.0, 0.1, 0.01],
      "follow1_joints_dev": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
      "follow2_joints_dev": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
      "car_pose": [0.12, -0.03, 0.08]
    }
  },
  "rtc_mode": "training_time",
  "use_rtc": true,
  "inference_delay": 4,
  "num_flow_steps": 10,
  "prev_action_chunk": {
    "left_ee": {
      "position": [[0.350, 0.200, 0.900], [0.351, 0.201, 0.901]],
      "rotation_rpy": [[0.020, 1.200, -0.010], [0.021, 1.201, -0.009]],
      "gripper": [0.020, 0.021]
    },
    "right_ee": {
      "position": [[0.360, -0.210, 0.910], [0.361, -0.211, 0.911]],
      "rotation_rpy": [[0.010, 1.220, 0.000], [0.011, 1.221, 0.001]],
      "gripper": [0.020, 0.021]
    }
  }
}

Response format

{
  "embodiment": "quanta_x1_pro/gripper-g",
  "actions": {
    "left_ee": {
      "position": [[0.351, 0.201, 0.901], [0.352, 0.202, 0.900]],
      "rotation_rpy": [[0.021, 1.201, -0.009], [0.022, 1.200, -0.008]],
      "gripper": [0.021, 0.022]
    },
    "right_ee": {
      "position": [[0.361, -0.211, 0.911], [0.362, -0.210, 0.910]],
      "rotation_rpy": [[0.011, 1.221, 0.001], [0.012, 1.220, 0.002]],
      "gripper": [0.021, 0.022]
    },
    "head_pose": [[0.10, -0.20], [0.11, -0.19]],
    "lift": [0.45, 0.451],
    "velocity_decomposed_odom": [[0.05, 0.00, 0.01], [0.05, 0.00, 0.02]]
  }
  // "rtc": {"enabled": true, "effective_delay": 4, "trained_max_delay": 4}
}

Quanta X1 Pro: Quanta_X1_Pro (Orin)

The three images come from NV12 shared memory. The public keys are still front, left_wrist, and right_wrist, and the content is JPEG bytes (a Base64 string when image_wire_format=base64).

(1) Synchronous

The fields for synchronous and PC async mode are the same as EX001 x86 synchronous mode. Images come from xrcam_head_left_eye, xrcam_left_wrist, and xrcam_right_wrist.

Request format

{
  "embodiment": "quanta_x1_pro/gripper-g",
  "normalization": "provided",
  "instruction": "fold the towel",
  "observation": {
    "images": {
      "front": "<JPEG bytes>",       // xrcam_head_left_eye
      "left_wrist": "<JPEG bytes>",  // xrcam_left_wrist
      "right_wrist": "<JPEG bytes>"  // xrcam_right_wrist
    },
    "state": {
      "left_ee": {
        "position": [0.35, 0.20, 0.90],
        "rotation_rpy": [0.02, 1.20, -0.01],
        "gripper": 0.02
      },
      "right_ee": {
        "position": [0.36, -0.21, 0.91],
        "rotation_rpy": [0.01, 1.22, 0.00],
        "gripper": 0.02
      },
      "head_pose": [0.10, -0.20],
      "lift": 0.45,
      "car_pose": [0.05, 0.00, 0.01]
    },
    "extra_state": {
      "follow1_joints": [0.2, -0.5, 0.1, 1.4, 0.0, 0.2],
      "follow2_joints": [0.2, 0.5, 0.1, 1.4, 0.0, 0.2],
      "follow1_joints_cur": [0.1, 0.0, 0.2, 0.3, 0.0, 0.1, 0.01],
      "follow2_joints_cur": [0.1, 0.0, 0.2, 0.3, 0.0, 0.1, 0.01],
      "follow1_joints_dev": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
      "follow2_joints_dev": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
      "car_pose": [0.12, -0.03, 0.08]
    }
  }
}

Response format

{
  "embodiment": "quanta_x1_pro/gripper-g",
  "actions": {
    "left_ee": {
      "position": [[0.351, 0.201, 0.901], [0.352, 0.202, 0.900]],
      "rotation_rpy": [[0.021, 1.201, -0.009], [0.022, 1.200, -0.008]],
      "gripper": [0.021, 0.022]
    },
    "right_ee": {
      "position": [[0.361, -0.211, 0.911], [0.362, -0.210, 0.910]],
      "rotation_rpy": [[0.011, 1.221, 0.001], [0.012, 1.220, 0.002]],
      "gripper": [0.021, 0.022]
    },
    "head_pose": [[0.10, -0.20], [0.11, -0.19]],
    "lift": [0.45, 0.451],
    "velocity_decomposed_odom": [[0.05, 0.00, 0.01], [0.05, 0.00, 0.02]]
  }
}

(2) RTC

Orin RTC uses EX001OrinClientRTC. Compared with x86 RTC, it adds image_encoding and image_pipeline. observation.images contains JPEG bytes.

Request format

{
  "embodiment": "quanta_x1_pro/gripper-g",
  "normalization": "provided",
  "instruction": "fold the towel",
  "observation": {
    "images": {
      "front": "<JPEG bytes>",
      "left_wrist": "<JPEG bytes>",
      "right_wrist": "<JPEG bytes>"
    },
    "state": {
      "left_ee": {
        "position": [0.35, 0.20, 0.90],
        "rotation_rpy": [0.02, 1.20, -0.01],
        "gripper": 0.02
      },
      "right_ee": {
        "position": [0.36, -0.21, 0.91],
        "rotation_rpy": [0.01, 1.22, 0.00],
        "gripper": 0.02
      },
      "head_pose": [0.10, -0.20],
      "lift": 0.45,
      "car_pose": [0.05, 0.00, 0.01]
    },
    "extra_state": {
      "follow1_joints": [0.2, -0.5, 0.1, 1.4, 0.0, 0.2],
      "follow2_joints": [0.2, 0.5, 0.1, 1.4, 0.0, 0.2],
      "follow1_joints_cur": [0.1, 0.0, 0.2, 0.3, 0.0, 0.1, 0.01],
      "follow2_joints_cur": [0.1, 0.0, 0.2, 0.3, 0.0, 0.1, 0.01],
      "follow1_joints_dev": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
      "follow2_joints_dev": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
      "car_pose": [0.12, -0.03, 0.08]
    }
  },
  "image_encoding": "jpeg",
  "image_pipeline": {
    "resize": "cuda",
    "encode": "jpeg",
    "wire": "raw"   // default image_wire_format=jpeg: images are JPEG bytes; with image_wire_format=base64 this is "base64"
  },
  "rtc_mode": "training_time",
  "use_rtc": true,
  "inference_delay": 4,
  "num_flow_steps": 10,
  "prev_action_chunk": {
    "left_ee": {
      "position": [[0.350, 0.200, 0.900], [0.351, 0.201, 0.901]],
      "rotation_rpy": [[0.020, 1.200, -0.010], [0.021, 1.201, -0.009]],
      "gripper": [0.020, 0.021]
    },
    "right_ee": {
      "position": [[0.360, -0.210, 0.910], [0.361, -0.211, 0.911]],
      "rotation_rpy": [[0.010, 1.220, 0.000], [0.011, 1.221, 0.001]],
      "gripper": [0.020, 0.021]
    }
  }
}

Response format

The response is the same as EX001 x86 RTC. image_encoding appears only in the request.

{
  "embodiment": "quanta_x1_pro/gripper-g",
  "actions": {
    "left_ee": {
      "position": [[0.351, 0.201, 0.901], [0.352, 0.202, 0.900]],
      "rotation_rpy": [[0.021, 1.201, -0.009], [0.022, 1.200, -0.008]],
      "gripper": [0.021, 0.022]
    },
    "right_ee": {
      "position": [[0.361, -0.211, 0.911], [0.362, -0.210, 0.910]],
      "rotation_rpy": [[0.011, 1.221, 0.001], [0.012, 1.220, 0.002]],
      "gripper": [0.021, 0.022]
    },
    "head_pose": [[0.10, -0.20], [0.11, -0.19]],
    "lift": [0.45, 0.451],
    "velocity_decomposed_odom": [[0.05, 0.00, 0.01], [0.05, 0.00, 0.02]]
  }
  // "rtc": {"enabled": true, "effective_delay": 4, "trained_max_delay": 4}
}

On this page