|
| 1 | +Teleoperation Data Collection |
| 2 | +----------------------------- |
| 3 | + |
| 4 | +This workflow covers collecting demonstrations for the G1 loco-manipulation task using **Meta Quest 3** supported by **NVIDIA CloudXR**. |
| 5 | + |
| 6 | +This workflow requires several components to run: |
| 7 | + |
| 8 | +* **NVIDIA CloudXR Runtime**: Runs in a Docker container on your workstation and streams the Isaac Lab simulation to a compatible XR device. See the `CloudXR Runtime documentation <https://docs.nvidia.com/cloudxr-sdk/latest/usr_guide/cloudxr_runtime/index.html>`_. |
| 9 | +* **Arena Docker container**: Runs the Isaac Lab simulation and recording. |
| 10 | +* **CloudXR.js WebServer**: Meta Quest 3 and Pico 4 Ultra connect to Isaac Lab via the CloudXR.js WebXR client. See `CloudXR.js (Early Access) <https://docs.nvidia.com/cloudxr-sdk/latest/usr_guide/cloudxr_js/index.html>`_. |
| 11 | + |
| 12 | +.. note:: |
| 13 | + |
| 14 | + You must join the **NVIDIA CloudXR Early Access Program** to obtain the CloudXR runtime and client: |
| 15 | + |
| 16 | + * **CloudXR Early Access**: `Join the NVIDIA CloudXR SDK Early Access Program <https://developer.nvidia.com/cloudxr-sdk-early-access-program/join>`_ |
| 17 | + |
| 18 | + Follow the steps in the confirmation email to get access to the CloudXR runtime container and client resources. |
| 19 | + |
| 20 | + |
| 21 | +Step 1: Start the CloudXR Runtime Container |
| 22 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 23 | + |
| 24 | +#. Download the **CloudXR Runtime Container** from NVIDIA NGC. Version **6.0.1** is tested. |
| 25 | + |
| 26 | + .. code-block:: bash |
| 27 | +
|
| 28 | + docker login nvcr.io |
| 29 | + docker pull nvcr.io/nvidia/cloudxr-runtime-early-access:6.0.1-webrtc |
| 30 | +
|
| 31 | +#. In a new terminal, start the CloudXR runtime container: |
| 32 | + |
| 33 | + .. code-block:: bash |
| 34 | +
|
| 35 | + cd submodules/IsaacLab |
| 36 | + mkdir -p openxr |
| 37 | +
|
| 38 | + docker run -dit --rm --name cloudxr-runtime \ |
| 39 | + --user $(id -u):$(id -g) \ |
| 40 | + --gpus=all \ |
| 41 | + -e "ACCEPT_EULA=Y" \ |
| 42 | + --mount type=bind,src=$(pwd)/openxr,dst=/openxr \ |
| 43 | + --network host \ |
| 44 | + nvcr.io/nvidia/cloudxr-runtime-early-access:6.0.1-webrtc |
| 45 | +
|
| 46 | +
|
| 47 | +Step 2: Start Arena Teleop |
| 48 | +^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 49 | + |
| 50 | +In another terminal, start the Arena Docker container and launch the teleop session to verify the pipeline: |
| 51 | + |
| 52 | +:docker_run_default: |
| 53 | + |
| 54 | +.. code-block:: bash |
| 55 | +
|
| 56 | + python isaaclab_arena/scripts/imitation_learning/teleop.py \ |
| 57 | + --enable_pinocchio \ |
| 58 | + galileo_g1_locomanip_pick_and_place \ |
| 59 | + --teleop_device openxr |
| 60 | +
|
| 61 | +Start the AR/XR session from the **AR** tab in the application window. |
| 62 | + |
| 63 | +.. figure:: ../../../images/locomanip_arena_server.png |
| 64 | + :width: 100% |
| 65 | + :alt: Arena teleop with XR running (stereoscopic view and OpenXR settings) |
| 66 | + :align: center |
| 67 | + |
| 68 | + Arena teleop session with XR running. Stereoscopic view (left) and OpenXR settings in the AR tab (right). |
| 69 | + |
| 70 | + |
| 71 | +Step 3: Build and Run the CloudXR.js WebServer |
| 72 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 73 | + |
| 74 | +#. Download the `CloudXR.js with samples <https://catalog.ngc.nvidia.com/orgs/nvidia/resources/cloudxr-js-early-access?version=6.0.1-beta>`_, unzip and follow the included guide. |
| 75 | + |
| 76 | +#. Start the CloudXR.js WebServer: |
| 77 | + |
| 78 | + .. code-block:: bash |
| 79 | +
|
| 80 | + cd cloudxr-js-early-access_6.0.1-beta/release |
| 81 | + docker build -t cloudxr-isaac-sample --build-arg EXAMPLE_NAME=isaac . |
| 82 | + docker run -d --name cloudxr-isaac-sample -p 8080:80 -p 8443:443 cloudxr-isaac-sample |
| 83 | +
|
| 84 | + You can test from a local browser at ``http://localhost:8080/`` before connecting the Quest. |
| 85 | + |
| 86 | +.. figure:: ../../../images/locomanip_cloudxr_js.png |
| 87 | + :width: 100% |
| 88 | + :alt: CloudXR.js Isaac Lab Teleop Client (connection and debug settings) |
| 89 | + :align: center |
| 90 | + |
| 91 | + CloudXR.js Isaac Lab Teleop Client. Configure server IP and port, then press **Connect**. Adjust stream resolution and reference space in Debug Settings if needed. |
| 92 | + |
| 93 | +Step 4: Setup and Connect from Meta Quest 3 |
| 94 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 95 | + |
| 96 | +#. On the host machine, update the firewall to allow traffic on these ports: |
| 97 | + |
| 98 | + .. code-block:: bash |
| 99 | +
|
| 100 | + sudo ufw allow 49100/tcp |
| 101 | + sudo ufw allow 47998/udp |
| 102 | +
|
| 103 | +#. **Network**: Use a router with Wi-Fi 6 (5 GHz band). Connect the server via Ethernet and the Quest to the same router's Wi-Fi. See the `CloudXR Network Setup <https://docs.nvidia.com/cloudxr-sdk/latest/requirement/network_setup.html>`_ guide. |
| 104 | + |
| 105 | +#. **Quest configuration**: On the Quest headset, configure insecure origins for HTTP mode (one-time setup): |
| 106 | + |
| 107 | + * Open the Meta Quest 3 browser and go to ``chrome://flags``. |
| 108 | + * Search for ``insecure``, find ``unsafely-treat-insecure-origin-as-secure``, and set it to **Enabled**. |
| 109 | + * In the text field, enter your Arena host URL: ``http://<server-ip>:8080``. |
| 110 | + * Tap outside the text field; a **Relaunch** button appears. Tap **Relaunch** to apply. |
| 111 | + * After relaunch, return to ``chrome://flags`` and confirm the flag is still enabled and the URL is saved. |
| 112 | + |
| 113 | +#. **Connect**: On the Quest, open the browser and go to ``http://<server-ip>:8080``. In Settings, enter the server IP, then press **Connect**. You should see the simulation and be able to teleoperate. |
| 114 | + |
| 115 | + The browser will prompt for WebXR permissions the first time. Select **Allow**; the immersive session starts after permission is granted. |
| 116 | + |
| 117 | +#. **Teleoperation Controls**: |
| 118 | + |
| 119 | +* **Left joystick**: Move the body forward/backward/left/right. |
| 120 | +* **Right joystick**: Squat (down), rotate torso (left/right). |
| 121 | +* **Controllers**: Move end-effector (EE) targets for the arms. |
| 122 | + |
| 123 | + |
| 124 | +Step 5: Record with Quest 3 |
| 125 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 126 | + |
| 127 | +#. **Recording**: When ready to collect data, run the recording script from the Arena container: |
| 128 | + |
| 129 | + .. code-block:: bash |
| 130 | +
|
| 131 | + export DATASET_DIR=/datasets/isaaclab_arena/locomanipulation_tutorial |
| 132 | + mkdir -p $DATASET_DIR |
| 133 | +
|
| 134 | + # Record demonstrations with OpenXR teleop |
| 135 | + python isaaclab_arena/scripts/imitation_learning/record_demos.py \ |
| 136 | + --device cpu \ |
| 137 | + --enable_pinocchio \ |
| 138 | + --dataset_file $DATASET_DIR/arena_g1_locomanipulation_dataset_recorded.hdf5 \ |
| 139 | + --num_demos 10 \ |
| 140 | + --num_success_steps 2 \ |
| 141 | + galileo_g1_locomanip_pick_and_place \ |
| 142 | + --teleop_device openxr |
| 143 | +
|
| 144 | +#. Complete the task for each demo. Reset between demos. The script saves successful runs to the HDF5 file above. |
| 145 | + |
| 146 | +.. hint:: |
| 147 | + |
| 148 | + Suggested sequence for the task: |
| 149 | + |
| 150 | + #. Align your body with the robot. |
| 151 | + #. Walk forward (left joystick forward). |
| 152 | + #. Grab the box (controllers). |
| 153 | + #. Walk backward (left joystick back). |
| 154 | + #. Turn toward the bin (right joystick). |
| 155 | + #. Walk forward to the bin. |
| 156 | + #. Squat (right joystick down). |
| 157 | + #. Place the box in the bin (controllers). |
| 158 | + |
| 159 | +.. image:: ../../../images/g1_galileo_arena_box_pnp_locomanip.gif |
| 160 | + :align: center |
| 161 | + :height: 400px |
| 162 | + |
| 163 | + |
| 164 | +Step 6: Replay Recorded Demos (Optional) |
| 165 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 166 | + |
| 167 | +To replay the recorded demos: |
| 168 | + |
| 169 | +.. code-block:: bash |
| 170 | +
|
| 171 | + # Replay from the recorded HDF5 dataset |
| 172 | + python isaaclab_arena/scripts/imitation_learning/replay_demos.py \ |
| 173 | + --device cpu \ |
| 174 | + --dataset_file $DATASET_DIR/arena_g1_locomanipulation_dataset_recorded.hdf5 \ |
| 175 | + --enable_pinocchio \ |
| 176 | + galileo_g1_locomanip_pick_and_place |
0 commit comments