diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_23dof.xml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_23dof.xml
new file mode 100644
index 0000000000000000000000000000000000000000..1c9526e7765f74c0e74515335757ef99b19069d3
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_23dof.xml
@@ -0,0 +1,477 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof.xml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof.xml
new file mode 100644
index 0000000000000000000000000000000000000000..958650e7e0866af70ea9e55a383da6e7c6b2c6ec
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof.xml
@@ -0,0 +1,296 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof_old.xml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof_old.xml
new file mode 100644
index 0000000000000000000000000000000000000000..0707bb3eed19ac01c848c70e2b158dd780a716d0
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof_old.xml
@@ -0,0 +1,521 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof_with_hand.xml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof_with_hand.xml
new file mode 100644
index 0000000000000000000000000000000000000000..726211e4820241c9bc102a3fd074c7c0a2704e7f
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof_with_hand.xml
@@ -0,0 +1,743 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_23dof.xml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_23dof.xml
new file mode 100644
index 0000000000000000000000000000000000000000..b697dc54b2c1cecc1a6fefa1daef5655a6bc7a4f
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_23dof.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_29dof.xml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_29dof.xml
new file mode 100644
index 0000000000000000000000000000000000000000..9aa74d44bdeb06f1fb1b2f4e8d0a7541a8d81c31
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_29dof.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_29dof_with_hand.xml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_29dof_with_hand.xml
new file mode 100644
index 0000000000000000000000000000000000000000..515ea20575de4032b1c8bb324537e36cb97ba7a1
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_29dof_with_hand.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_empty.xml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_empty.xml
new file mode 100644
index 0000000000000000000000000000000000000000..19e909878d88115e34caab4f3b8bf316eb31b205
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_empty.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/observation_config_example.yaml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/observation_config_example.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..a80682d265c9891e87e790759b4111d008a97811
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/observation_config_example.yaml
@@ -0,0 +1,150 @@
+# ===================================================================
+# G1 Deploy - Observation Configuration Example
+# ===================================================================
+# This file demonstrates the complete observation configuration format
+# This example matches the default configuration exactly
+#
+# Instructions:
+# 1. Copy this file to create your custom configuration
+# 2. Modify enabled: true/false to enable/disable observations
+# 3. Reorder observations by changing their position in the list
+# 4. The system automatically calculates offsets based on order
+# 5. Ensure total enabled dimensions match your ONNX model input
+# ===================================================================
+
+# Observation definitions - processed in the order listed below
+observations:
+ # ---------------------------------------------------------------
+ # Motion Reference Data (from loaded motion sequences)
+ # ---------------------------------------------------------------
+
+ - name: "motion_joint_positions"
+ enabled: true
+ # Description: Joint positions from motion reference data
+ # Dimension: 29 elements (one per joint)
+ # Units: radians
+ # Purpose: Provides target joint positions for the current motion frame
+
+ - name: "motion_joint_velocities"
+ enabled: true
+ # Description: Joint velocities from motion reference data
+ # Dimension: 29 elements (one per joint)
+ # Units: radians/second
+ # Purpose: Provides target joint velocities for the current motion frame
+ # Note: Only active when motion is playing (is_playing_ = true)
+
+ - name: "motion_anchor_orientation"
+ enabled: true
+ # Description: Motion anchor orientation relative to robot base
+ # Dimension: 6 elements (rotation matrix first 2 columns flattened)
+ # Units: dimensionless (rotation matrix elements)
+ # Purpose: Encodes relative orientation between robot and motion reference
+ # Calculation: Includes heading compensation and delta heading adjustments
+
+ # ---------------------------------------------------------------
+ # Robot State Data (from sensors and estimation)
+ # ---------------------------------------------------------------
+
+ - name: "base_angular_velocity"
+ enabled: true
+ # Description: Robot base angular velocity in body frame
+ # Dimension: 3 elements (roll, pitch, yaw rates)
+ # Units: radians/second
+ # Source: IMU sensor data
+ # Purpose: Provides current rotational motion of the robot base
+
+ - name: "body_joint_positions"
+ enabled: true
+ # Description: Current robot joint positions
+ # Dimension: 29 elements (one per joint)
+ # Units: radians
+ # Source: Joint encoders via robot low-level state
+ # Purpose: Current actual joint positions for feedback control
+
+ - name: "body_joint_velocities"
+ enabled: true
+ # Description: Current robot joint velocities
+ # Dimension: 29 elements (one per joint)
+ # Units: radians/second
+ # Source: Joint encoders via robot low-level state
+ # Purpose: Current actual joint velocities for feedback control
+
+ # ---------------------------------------------------------------
+ # Control History
+ # ---------------------------------------------------------------
+
+ - name: "last_actions"
+ enabled: true
+ # Description: Previous control action output
+ # Dimension: 29 elements (one per joint)
+ # Units: dimensionless (normalized action values)
+ # Purpose: Provides action history for temporal consistency
+ # Note: Helps with smooth control transitions
+
+# ===================================================================
+# Configuration Summary
+# ===================================================================
+#
+# Default Configuration Totals:
+# - motion_joint_positions: 29D (enabled) [offset: 0]
+# - motion_joint_velocities: 29D (enabled) [offset: 29]
+# - motion_anchor_orientation: 6D (enabled) [offset: 58]
+# - base_angular_velocity: 3D (enabled) [offset: 64]
+# - body_joint_positions: 29D (enabled) [offset: 67]
+# - body_joint_velocities: 29D (enabled) [offset: 96]
+# - last_actions: 29D (enabled) [offset: 125]
+# ----------------------------------------------------------------
+# Total Enabled Dimension: 154D
+#
+# This matches the standard G1 policy model input dimension of 154
+#
+# ===================================================================
+# Customization Examples
+# ===================================================================
+#
+# Example 1: Disable motion velocities (for position-only policies)
+# - name: "motion_joint_velocities"
+# enabled: false
+#
+# Example 2: Disable last actions (for non-temporal policies)
+# - name: "last_actions"
+# enabled: false
+#
+# Example 3: Minimal configuration (position-only)
+# observations:
+# - name: "motion_joint_positions"
+# enabled: true
+# - name: "body_joint_positions"
+# enabled: true
+# # Total: 58D (29+29)
+#
+# Example 4: Reorder observations (offsets calculated automatically)
+# observations:
+# - name: "body_joint_positions" # Will get offset: 0
+# enabled: true
+# - name: "motion_joint_positions" # Will get offset: 29
+# enabled: true
+# # Automatic offset calculation based on order
+#
+# Example 5: Multi-frame observations with step intervals (for temporal dynamics)
+# observations:
+# - name: "motion_joint_positions_5frame_step5" # 145D (29 joints * 5 frames, step=5)
+# enabled: true
+# - name: "motion_joint_velocities_5frame_step5" # 145D (29 joints * 5 frames, step=5)
+# enabled: true
+# - name: "base_angular_velocity" # 3D (current frame only)
+# enabled: true
+# # Total: 293D (145+145+3)
+# # Captures frames at: current, current+5, current+10, current+15, current+20
+#
+# Example 6: Multi-frame with different step sizes
+# observations:
+# - name: "motion_joint_positions_5frame_step10" # 145D (step=10 for longer intervals)
+# enabled: true
+# # Captures frames at: current, current+10, current+20, current+30, current+40
+#
+# Note: Multi-frame observations capture temporal patterns by sampling
+# future frames at configurable intervals (step sizes)
+# If future frames exceed motion length, repeats the last frame
+#
+# ===================================================================
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config.yaml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..893b960b226ea329a2936040502ce3bfd365360b
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config.yaml
@@ -0,0 +1,80 @@
+# G1 Deploy - Observation Configuration
+# ====================================
+# Total dimension: 436 (64+12+116+116+116+12)
+
+observations:
+
+ - name: "token_state"
+ enabled: true
+
+ - name: "his_base_angular_velocity_10frame_step1"
+ enabled: true
+
+ - name: "his_body_joint_positions_10frame_step1"
+ enabled: true
+
+ - name: "his_body_joint_velocities_10frame_step1"
+ enabled: true
+
+ - name: "his_last_actions_10frame_step1"
+ enabled: true
+
+ - name: "his_gravity_dir_10frame_step1"
+ enabled: true
+
+encoder:
+ dimension: 64
+ use_fp16: false
+ encoder_observations:
+ - name: "encoder_mode_4"
+ enabled: true
+ - name: "motion_joint_positions_10frame_step5"
+ enabled: true
+ - name: "motion_joint_velocities_10frame_step5"
+ enabled: true
+ - name: "motion_root_z_position_10frame_step5"
+ enabled: true
+ - name: "motion_root_z_position"
+ enabled: true
+ - name: "motion_anchor_orientation"
+ enabled: true
+ - name: "motion_anchor_orientation_10frame_step5"
+ enabled: true
+ - name: "motion_joint_positions_lowerbody_10frame_step5"
+ enabled: true
+ - name: "motion_joint_velocities_lowerbody_10frame_step5"
+ enabled: true
+ - name: "vr_3point_local_target"
+ enabled: true
+ - name: "vr_3point_local_orn_target"
+ enabled: true
+ - name: "smpl_joints_10frame_step1"
+ enabled: true
+ - name: "smpl_anchor_orientation_10frame_step1"
+ enabled: true
+ - name: "motion_joint_positions_wrists_10frame_step1"
+ enabled: true
+ encoder_modes:
+ - name: "g1"
+ mode_id: 0
+ required_observations:
+ - encoder_mode_4
+ - motion_joint_positions_10frame_step5
+ - motion_joint_velocities_10frame_step5
+ - motion_anchor_orientation_10frame_step5
+ - name: "teleop"
+ mode_id: 1
+ required_observations:
+ - encoder_mode_4
+ - motion_joint_positions_lowerbody_10frame_step5
+ - motion_joint_velocities_lowerbody_10frame_step5
+ - vr_3point_local_target
+ - vr_3point_local_orn_target
+ - motion_anchor_orientation
+ - name: "smpl"
+ mode_id: 2
+ required_observations:
+ - encoder_mode_4
+ - smpl_joints_10frame_step1
+ - smpl_anchor_orientation_10frame_step1
+ - motion_joint_positions_wrists_10frame_step1
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_low_latency.yaml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_low_latency.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..d95ff3bad2124180be8d0a056eb8884eb186ce3f
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_low_latency.yaml
@@ -0,0 +1,92 @@
+# SONIC Release (Low-Latency) - Observation Configuration
+# =======================================================
+# For ONNX models exported from the low-latency sonic_release checkpoint
+# (smpl 4-frame lookahead; g1/teleop lookahead at step1, body-frame orientation).
+#
+# Encoder input dimension: 1247 Decoder/policy dimension: 994 token: 64
+# Uses the unitoken_all_noz tokenizer config (3 encoders: g1, teleop, smpl)
+#
+# Requires the smpl_*_4frame_step1 entries in GetObservationRegistry()
+# (src/g1/g1_deploy_onnx_ref/src/g1_deploy_onnx_ref.cpp) + a rebuild to load.
+
+observations:
+
+ - name: "token_state"
+ enabled: true
+
+ - name: "his_base_angular_velocity_10frame_step1"
+ enabled: true
+
+ - name: "his_body_joint_positions_10frame_step1"
+ enabled: true
+
+ - name: "his_body_joint_velocities_10frame_step1"
+ enabled: true
+
+ - name: "his_last_actions_10frame_step1"
+ enabled: true
+
+ - name: "his_gravity_dir_10frame_step1"
+ enabled: true
+
+encoder:
+ dimension: 64
+ use_fp16: false
+ encoder_observations:
+ # Shared
+ - name: "encoder_mode_4"
+ enabled: true
+ # g1 encoder: command_multi_future_nonflat (positions + velocities), step1
+ - name: "motion_joint_positions_10frame_step1"
+ enabled: true
+ - name: "motion_joint_velocities_10frame_step1"
+ enabled: true
+ # g1 encoder: motion_anchor_ori_b_mf_nonflat (body, multi-frame FIRST), step1
+ - name: "motion_anchor_orientation_10frame_step1"
+ enabled: true
+ # teleop encoder: motion_anchor_ori_b (body, single-frame SECOND)
+ - name: "motion_anchor_orientation"
+ enabled: true
+ # teleop encoder: command_multi_future_lower_body, step1
+ - name: "motion_joint_positions_lowerbody_10frame_step1"
+ enabled: true
+ - name: "motion_joint_velocities_lowerbody_10frame_step1"
+ enabled: true
+ # teleop encoder: vr_3point
+ - name: "vr_3point_local_target"
+ enabled: true
+ - name: "vr_3point_local_orn_target"
+ enabled: true
+ # smpl encoder: smpl_joints_multi_future_local_nonflat (4 frames, step1) <-- LOW-LATENCY
+ - name: "smpl_joints_4frame_step1"
+ enabled: true
+ # smpl encoder: smpl_root_ori_b_multi_future (body, 4 frames, step1) <-- LOW-LATENCY
+ - name: "smpl_anchor_orientation_4frame_step1"
+ enabled: true
+ # smpl encoder: joint_pos_multi_future_wrist_for_smpl (4 frames, step1) <-- LOW-LATENCY
+ - name: "motion_joint_positions_wrists_4frame_step1"
+ enabled: true
+ encoder_modes:
+ - name: "g1"
+ mode_id: 0
+ required_observations:
+ - encoder_mode_4
+ - motion_joint_positions_10frame_step1
+ - motion_joint_velocities_10frame_step1
+ - motion_anchor_orientation_10frame_step1
+ - name: "teleop"
+ mode_id: 1
+ required_observations:
+ - encoder_mode_4
+ - motion_joint_positions_lowerbody_10frame_step1
+ - motion_joint_velocities_lowerbody_10frame_step1
+ - vr_3point_local_target
+ - vr_3point_local_orn_target
+ - motion_anchor_orientation
+ - name: "smpl"
+ mode_id: 2
+ required_observations:
+ - encoder_mode_4
+ - smpl_joints_4frame_step1
+ - smpl_anchor_orientation_4frame_step1
+ - motion_joint_positions_wrists_4frame_step1
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_sonic_release.yaml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_sonic_release.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..07e2025ee02987f2704314d13d1430fd4a03806a
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_sonic_release.yaml
@@ -0,0 +1,79 @@
+# SONIC Release - Observation Configuration
+# ==========================================
+# For ONNX models exported from sonic_release checkpoint via:
+# python gear_sonic/eval_agent_trl.py +checkpoint=sonic_release/last.pt \
+# +headless=True ++num_envs=1 +export_onnx_only=true
+#
+# Encoder input dimension: 1751 (1 encoder_index + 1750 tokenizer obs)
+# Uses the unitoken_all_noz tokenizer config (3 encoders: g1, teleop, smpl)
+
+observations:
+
+ - name: "token_state"
+ enabled: true
+
+ - name: "his_base_angular_velocity_10frame_step1"
+ enabled: true
+
+ - name: "his_body_joint_positions_10frame_step1"
+ enabled: true
+
+ - name: "his_body_joint_velocities_10frame_step1"
+ enabled: true
+
+ - name: "his_last_actions_10frame_step1"
+ enabled: true
+
+ - name: "his_gravity_dir_10frame_step1"
+ enabled: true
+
+encoder:
+ dimension: 64
+ use_fp16: false
+ encoder_observations:
+ # Used by all encoder modes
+ - name: "encoder_index"
+ enabled: true
+ # G1 mode
+ - name: "command_multi_future_nonflat"
+ enabled: true
+ - name: "motion_anchor_ori_b_mf_nonflat"
+ enabled: true
+ # Teleop mode
+ - name: "command_multi_future_lower_body"
+ enabled: true
+ - name: "vr_3point_local_target"
+ enabled: true
+ - name: "vr_3point_local_orn_target"
+ enabled: true
+ - name: "motion_anchor_ori_b"
+ enabled: true
+ # SMPL mode
+ - name: "smpl_joints_multi_future_local_nonflat"
+ enabled: true
+ - name: "smpl_root_ori_b_multi_future"
+ enabled: true
+ - name: "joint_pos_multi_future_wrist_for_smpl"
+ enabled: true
+ encoder_modes:
+ - name: "g1"
+ mode_id: 0
+ required_observations:
+ - encoder_index
+ - command_multi_future_nonflat
+ - motion_anchor_ori_b_mf_nonflat
+ - name: "teleop"
+ mode_id: 1
+ required_observations:
+ - encoder_index
+ - command_multi_future_lower_body
+ - vr_3point_local_target
+ - vr_3point_local_orn_target
+ - motion_anchor_ori_b
+ - name: "smpl"
+ mode_id: 2
+ required_observations:
+ - encoder_index
+ - smpl_joints_multi_future_local_nonflat
+ - smpl_root_ori_b_multi_future
+ - joint_pos_multi_future_wrist_for_smpl
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_sonic_v1_1.yaml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_sonic_v1_1.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..986bc2af0f6e7835d1453ae3902da388759e328b
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_sonic_v1_1.yaml
@@ -0,0 +1,74 @@
+# SONIC v1.1 - Observation Configuration
+# =================================================
+# Matches sonic_v1_1/model_encoder.onnx and model_decoder.onnx.
+#
+# Encoder input: 1751 Decoder input: 994 Token: 64
+# G1/teleop references use 10 frames at step5. SMPL and wrist references use
+# 10 frames at step1. Root orientations are normalized by robot heading.
+
+observations:
+ - name: "token_state"
+ enabled: true
+ - name: "his_base_angular_velocity_10frame_step1"
+ enabled: true
+ - name: "his_body_joint_positions_10frame_step1"
+ enabled: true
+ - name: "his_body_joint_velocities_10frame_step1"
+ enabled: true
+ - name: "his_last_actions_10frame_step1"
+ enabled: true
+ - name: "his_gravity_dir_10frame_step1"
+ enabled: true
+
+encoder:
+ dimension: 64
+ use_fp16: false
+ encoder_observations:
+ - name: "encoder_mode_4"
+ enabled: true
+ - name: "motion_joint_positions_10frame_step5"
+ enabled: true
+ - name: "motion_joint_velocities_10frame_step5"
+ enabled: true
+ - name: "motion_anchor_orientation_heading_10frame_step5"
+ enabled: true
+ - name: "motion_anchor_orientation_heading"
+ enabled: true
+ - name: "motion_joint_positions_lowerbody_10frame_step5"
+ enabled: true
+ - name: "motion_joint_velocities_lowerbody_10frame_step5"
+ enabled: true
+ - name: "vr_3point_local_target"
+ enabled: true
+ - name: "vr_3point_local_orn_target"
+ enabled: true
+ - name: "smpl_joints_10frame_step1"
+ enabled: true
+ - name: "smpl_anchor_orientation_heading_10frame_step1"
+ enabled: true
+ - name: "motion_joint_positions_wrists_10frame_step1"
+ enabled: true
+ encoder_modes:
+ - name: "g1"
+ mode_id: 0
+ required_observations:
+ - encoder_mode_4
+ - motion_joint_positions_10frame_step5
+ - motion_joint_velocities_10frame_step5
+ - motion_anchor_orientation_heading_10frame_step5
+ - name: "teleop"
+ mode_id: 1
+ required_observations:
+ - encoder_mode_4
+ - motion_joint_positions_lowerbody_10frame_step5
+ - motion_joint_velocities_lowerbody_10frame_step5
+ - vr_3point_local_target
+ - vr_3point_local_orn_target
+ - motion_anchor_orientation_heading
+ - name: "smpl"
+ mode_id: 2
+ required_observations:
+ - encoder_mode_4
+ - smpl_joints_10frame_step1
+ - smpl_anchor_orientation_heading_10frame_step1
+ - motion_joint_positions_wrists_10frame_step1
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/sonic_v1_1/observation_config.yaml b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/sonic_v1_1/observation_config.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..986bc2af0f6e7835d1453ae3902da388759e328b
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/sonic_v1_1/observation_config.yaml
@@ -0,0 +1,74 @@
+# SONIC v1.1 - Observation Configuration
+# =================================================
+# Matches sonic_v1_1/model_encoder.onnx and model_decoder.onnx.
+#
+# Encoder input: 1751 Decoder input: 994 Token: 64
+# G1/teleop references use 10 frames at step5. SMPL and wrist references use
+# 10 frames at step1. Root orientations are normalized by robot heading.
+
+observations:
+ - name: "token_state"
+ enabled: true
+ - name: "his_base_angular_velocity_10frame_step1"
+ enabled: true
+ - name: "his_body_joint_positions_10frame_step1"
+ enabled: true
+ - name: "his_body_joint_velocities_10frame_step1"
+ enabled: true
+ - name: "his_last_actions_10frame_step1"
+ enabled: true
+ - name: "his_gravity_dir_10frame_step1"
+ enabled: true
+
+encoder:
+ dimension: 64
+ use_fp16: false
+ encoder_observations:
+ - name: "encoder_mode_4"
+ enabled: true
+ - name: "motion_joint_positions_10frame_step5"
+ enabled: true
+ - name: "motion_joint_velocities_10frame_step5"
+ enabled: true
+ - name: "motion_anchor_orientation_heading_10frame_step5"
+ enabled: true
+ - name: "motion_anchor_orientation_heading"
+ enabled: true
+ - name: "motion_joint_positions_lowerbody_10frame_step5"
+ enabled: true
+ - name: "motion_joint_velocities_lowerbody_10frame_step5"
+ enabled: true
+ - name: "vr_3point_local_target"
+ enabled: true
+ - name: "vr_3point_local_orn_target"
+ enabled: true
+ - name: "smpl_joints_10frame_step1"
+ enabled: true
+ - name: "smpl_anchor_orientation_heading_10frame_step1"
+ enabled: true
+ - name: "motion_joint_positions_wrists_10frame_step1"
+ enabled: true
+ encoder_modes:
+ - name: "g1"
+ mode_id: 0
+ required_observations:
+ - encoder_mode_4
+ - motion_joint_positions_10frame_step5
+ - motion_joint_velocities_10frame_step5
+ - motion_anchor_orientation_heading_10frame_step5
+ - name: "teleop"
+ mode_id: 1
+ required_observations:
+ - encoder_mode_4
+ - motion_joint_positions_lowerbody_10frame_step5
+ - motion_joint_velocities_lowerbody_10frame_step5
+ - vr_3point_local_target
+ - vr_3point_local_orn_target
+ - motion_anchor_orientation_heading
+ - name: "smpl"
+ mode_id: 2
+ required_observations:
+ - encoder_mode_4
+ - smpl_joints_10frame_step1
+ - smpl_anchor_orientation_heading_10frame_step1
+ - motion_joint_positions_wrists_10frame_step1
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/convert_motions.py b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/convert_motions.py
new file mode 100644
index 0000000000000000000000000000000000000000..98e7d99c0eee1875e4a46f85fd570dc793bc0b40
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/convert_motions.py
@@ -0,0 +1,274 @@
+#!/usr/bin/env python3
+"""
+Convert G1 motion capture data from joblib pickle to C++ readable formats
+Converts motion sequences with joint positions, velocities, and full body kinematics
+"""
+
+import sys
+import os
+
+def convert_motion_data(pkl_file, base_output_dir=None):
+ """Convert the motion pickle file to C++ readable formats"""
+
+ # Create organized folder structure: reference/{pkl_name}/
+ pkl_name = os.path.splitext(os.path.basename(pkl_file))[0] # Extract filename without extension
+
+ if base_output_dir is None:
+ # Default: put in reference folder structure
+ base_output_dir = os.path.join(os.path.dirname(pkl_file), pkl_name)
+
+ print(f"Converting motion data from: {pkl_file}")
+ print(f"Output directory structure: {base_output_dir}/")
+
+ # Load the data
+ try:
+ import joblib
+ data = joblib.load(pkl_file)
+ print("✓ Successfully loaded with joblib")
+ except ImportError:
+ print("✗ joblib not available, trying pickle...")
+ try:
+ import pickle
+ with open(pkl_file, 'rb') as f:
+ data = pickle.load(f)
+ print("✓ Successfully loaded with pickle")
+ except Exception as e:
+ print(f"✗ Failed to load: {e}")
+ return False
+ except Exception as e:
+ print(f"✗ Failed to load with joblib: {e}")
+ return False
+
+ # Create base output directory
+ os.makedirs(base_output_dir, exist_ok=True)
+
+ print(f"\nFound {len(data)} motion sequences:")
+ for motion_name in data.keys():
+ print(f" - {motion_name}")
+
+ # Convert each motion sequence
+ success_count = 0
+ for motion_name, motion_data in data.items():
+ print(f"\nProcessing: {motion_name}")
+
+ # Create individual folder for this motion
+ motion_output_dir = os.path.join(base_output_dir, motion_name)
+ print(f"Creating individual folder for this motion: {motion_output_dir}")
+ os.makedirs(motion_output_dir, exist_ok=True)
+
+ if convert_single_motion(motion_name, motion_data, motion_output_dir):
+ success_count += 1
+
+ # Create summary file in base directory
+ create_summary_file(data, base_output_dir)
+
+ print(f"\n✓ Successfully converted {success_count}/{len(data)} motions")
+ print(f"Output files saved to: {base_output_dir}/")
+
+ # Extract counts from first motion for summary
+ joint_count = None
+ body_count = None
+ if data:
+ first_motion = next(iter(data.values()))
+ joint_count = first_motion['joint_pos'].shape[1]
+ body_count = first_motion['body_pos_w'].shape[1]
+
+ return success_count > 0, len(data), joint_count, body_count
+
+def convert_single_motion(motion_name, motion_data, output_dir):
+ """Convert a single motion sequence to various formats"""
+
+ try:
+ # Extract ALL available data arrays
+ joint_pos = motion_data['joint_pos'] # Shape: (timesteps, 29)
+ joint_vel = motion_data['joint_vel'] # Shape: (timesteps, 29)
+ body_pos_w = motion_data['body_pos_w'] # Shape: (timesteps, 14, 3)
+ body_quat_w = motion_data['body_quat_w'] # Shape: (timesteps, 14, 4)
+ body_lin_vel_w = motion_data['body_lin_vel_w'] # Shape: (timesteps, 14, 3)
+ body_ang_vel_w = motion_data['body_ang_vel_w'] # Shape: (timesteps, 14, 3)
+
+ timesteps = joint_pos.shape[0]
+ print(f" Timesteps: {timesteps}, Joints: {joint_pos.shape[1]}, Body parts: {body_pos_w.shape[1]}")
+
+ # 1. Save joint data as CSV
+ joint_pos_file = os.path.join(output_dir, "joint_pos.csv")
+ save_array_as_csv(joint_pos, joint_pos_file,
+ [f"joint_{i}" for i in range(joint_pos.shape[1])])
+
+ joint_vel_file = os.path.join(output_dir, "joint_vel.csv")
+ save_array_as_csv(joint_vel, joint_vel_file,
+ [f"joint_vel_{i}" for i in range(joint_vel.shape[1])])
+
+ # 2. Save body position data (reshape to 2D for CSV)
+ body_pos_reshaped = body_pos_w.reshape(timesteps, -1) # (timesteps, 14*3)
+ body_pos_file = os.path.join(output_dir, "body_pos.csv")
+ body_pos_headers = [f"body_{i//3}_{'xyz'[i%3]}" for i in range(body_pos_reshaped.shape[1])]
+ save_array_as_csv(body_pos_reshaped, body_pos_file, body_pos_headers)
+
+ # 3. Save body quaternion data (reshape to 2D for CSV)
+ body_quat_reshaped = body_quat_w.reshape(timesteps, -1) # (timesteps, 14*4)
+ body_quat_file = os.path.join(output_dir, "body_quat.csv")
+ body_quat_headers = [f"body_{i//4}_{'wxyz'[i%4]}" for i in range(body_quat_reshaped.shape[1])]
+ save_array_as_csv(body_quat_reshaped, body_quat_file, body_quat_headers)
+
+ # 4. Save body linear velocity data
+ body_lin_vel_reshaped = body_lin_vel_w.reshape(timesteps, -1) # (timesteps, 14*3)
+ body_lin_vel_file = os.path.join(output_dir, "body_lin_vel.csv")
+ body_lin_vel_headers = [f"body_{i//3}_vel_{'xyz'[i%3]}" for i in range(body_lin_vel_reshaped.shape[1])]
+ save_array_as_csv(body_lin_vel_reshaped, body_lin_vel_file, body_lin_vel_headers)
+
+ # 5. Save body angular velocity data
+ body_ang_vel_reshaped = body_ang_vel_w.reshape(timesteps, -1) # (timesteps, 14*3)
+ body_ang_vel_file = os.path.join(output_dir, "body_ang_vel.csv")
+ body_ang_vel_headers = [f"body_{i//3}_angvel_{'xyz'[i%3]}" for i in range(body_ang_vel_reshaped.shape[1])]
+ save_array_as_csv(body_ang_vel_reshaped, body_ang_vel_file, body_ang_vel_headers)
+
+ # 6. Save metadata
+ metadata_file = os.path.join(output_dir, "metadata.txt")
+ save_metadata(motion_name, motion_data, metadata_file)
+
+ # 7. Save detailed info
+ info_file = os.path.join(output_dir, "info.txt")
+ save_motion_info(motion_name, motion_data, info_file)
+
+ print(f" ✓ Saved 7 files for {motion_name} (joints + full body kinematics)")
+ return True
+
+ except Exception as e:
+ print(f" ✗ Error processing {motion_name}: {e}")
+ return False
+
+def save_array_as_csv(array, filename, headers=None):
+ """Save numpy array as CSV file"""
+ import numpy as np
+
+ with open(filename, 'w') as f:
+ # Write header
+ if headers:
+ f.write(",".join(headers) + "\n")
+ else:
+ f.write(",".join([f"col_{i}" for i in range(array.shape[1])]) + "\n")
+
+ # Write data
+ for row in array:
+ f.write(",".join([f"{val:.6f}" for val in row]) + "\n")
+
+
+def save_metadata(motion_name, motion_data, filename):
+ """Save metadata and indices information"""
+
+ with open(filename, 'w') as f:
+ f.write(f"Metadata for: {motion_name}\n")
+ f.write("=" * 30 + "\n\n")
+
+ # Save body indexes if available
+ if '_body_indexes' in motion_data:
+ f.write("Body part indexes:\n")
+ f.write(f"{motion_data['_body_indexes']}\n\n")
+
+ # Save total timestep count
+ if 'time_step_total' in motion_data:
+ f.write(f"Total timesteps: {motion_data['time_step_total']}\n\n")
+
+ # Data summary
+ f.write("Data arrays summary:\n")
+ for key, value in motion_data.items():
+ if hasattr(value, 'shape'):
+ f.write(f" {key}: {value.shape} ({value.dtype})\n")
+
+def save_motion_info(motion_name, motion_data, filename):
+ """Save detailed motion information"""
+
+ with open(filename, 'w') as f:
+ f.write(f"Motion Information: {motion_name}\n")
+ f.write("=" * 50 + "\n\n")
+
+ for key, value in motion_data.items():
+ f.write(f"{key}:\n")
+ if hasattr(value, 'shape'):
+ f.write(f" Shape: {value.shape}\n")
+ f.write(f" Dtype: {value.dtype}\n")
+ if value.size > 0:
+ flat_vals = value.flatten()
+ f.write(f" Range: [{flat_vals.min():.3f}, {flat_vals.max():.3f}]\n")
+ f.write(f" Sample: {flat_vals[:5]}\n")
+ else:
+ f.write(f" Value: {value}\n")
+ f.write("\n")
+
+def create_summary_file(data, output_dir):
+ """Create a summary file with all motion information"""
+
+ summary_file = os.path.join(output_dir, "motion_summary.txt")
+
+ with open(summary_file, 'w') as f:
+ f.write("G1 Motion Capture Data Summary\n")
+ f.write("=" * 40 + "\n\n")
+ f.write(f"Total motion sequences: {len(data)}\n\n")
+
+
+ # Detailed motion list
+ f.write("Detailed motion list:\n")
+ for motion_name, motion_data in data.items():
+ joint_pos = motion_data['joint_pos']
+ f.write(f" {motion_name}:\n")
+ f.write(f" Timesteps: {joint_pos.shape[0]}\n")
+ f.write(f" Joints: {joint_pos.shape[1]}\n")
+ f.write(f" Body parts: {motion_data['body_pos_w'].shape[1]}\n")
+ f.write("\n")
+
+def main():
+ if len(sys.argv) < 2:
+ print("Usage: python3 convert_motions.py [output_base_dir]")
+ print("Examples:")
+ print(" python3 convert_motions.py bones_072925_test.pkl")
+ print(" python3 convert_motions.py bones_072925_test.pkl custom_output/")
+ print("")
+ print("Default output structure: reference/{pkl_name}/{motion_name}/")
+ return
+
+ pkl_file = sys.argv[1]
+ output_base_dir = sys.argv[2] if len(sys.argv) > 2 else None
+
+ if not os.path.exists(pkl_file):
+ print(f"Error: File not found: {pkl_file}")
+ return
+
+ # Extract pkl name for output messages
+ pkl_name = os.path.splitext(os.path.basename(pkl_file))[0]
+
+ print("G1 Motion Data Converter")
+ print("========================")
+
+ success, motion_count, joint_count, body_count = convert_motion_data(pkl_file, output_base_dir)
+ if success:
+ print("\n✓ Conversion completed successfully!")
+ print("\nExtracted data for each motion:")
+ print(f"- Joint positions & velocities ({joint_count} joints)")
+ print(f"- Body positions in world coordinates ({body_count} body parts)")
+ print("- Body orientations (quaternions)")
+ print("- Body linear & angular velocities")
+ print("- Metadata and body part indices")
+ print("\nNext steps:")
+ print(f"1. Build C++ reader: make motion_data_reader")
+ print(f"2. Test reading: ./bin/motion_data_reader reference/{pkl_name}/")
+ print("3. Use full kinematic data in your G1 control programs")
+ print("\nFile structure created:")
+ print(f"reference/{pkl_name}/")
+ print("├── [motion_name_1]/")
+ print("│ ├── joint_pos.csv")
+ print("│ ├── joint_vel.csv")
+ print("│ ├── body_pos.csv")
+ print("│ ├── body_quat.csv")
+ print("│ ├── body_lin_vel.csv")
+ print("│ ├── body_ang_vel.csv")
+ print("│ ├── metadata.txt")
+ print("│ └── info.txt")
+ print("├── [motion_name_2]/")
+ print("├── motion_summary.txt")
+ print(f"└── ... ({motion_count} motion folders total)")
+ else:
+ print("\n✗ Conversion failed")
+
+if __name__ == "__main__":
+ main()
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464/info.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464/info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c745c551d0917b175c688bb2002745cf9aab6923
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464/info.txt
@@ -0,0 +1,52 @@
+Motion Information: dance_in_da_party_001__A464
+==================================================
+
+joint_pos:
+ Shape: (497, 29)
+ Dtype: float32
+ Range: [-1.868, 2.226]
+ Sample: [ 0.12844084 0.10271313 0.0201158 -0.01923597 0.02096039]
+
+joint_vel:
+ Shape: (497, 29)
+ Dtype: float32
+ Range: [-20.223, 20.504]
+ Sample: [0.14367104 0.14386438 0. 0. 0. ]
+
+body_pos_w:
+ Shape: (497, 14, 3)
+ Dtype: float32
+ Range: [-0.525, 1.307]
+ Sample: [2.7894555e-04 1.4439992e-02 7.9243100e-01 1.1525212e-01 1.0816078e-02]
+
+body_quat_w:
+ Shape: (497, 14, 4)
+ Dtype: float32
+ Range: [-0.707, 0.998]
+ Sample: [-0.7035716 0.02096497 0.01313119 0.71019363 -0.70268404]
+
+body_lin_vel_w:
+ Shape: (497, 14, 3)
+ Dtype: float32
+ Range: [-2.763, 2.750]
+ Sample: [-0.00116042 -0.02408473 -0.00280159 -0.00131542 -0.02102444]
+
+body_ang_vel_w:
+ Shape: (497, 14, 3)
+ Dtype: float32
+ Range: [-12.991, 16.331]
+ Sample: [ 2.82337610e-03 9.97470808e-04 -2.06027436e-03 1.01761095e-01
+ -4.19195203e-05]
+
+_body_indexes:
+ Shape: (14,)
+ Dtype: int64
+ Range: [0.000, 29.000]
+ Sample: [ 0 4 10 18 5]
+
+time_step_total:
+ Shape: ()
+ Dtype: int64
+ Range: [497.000, 497.000]
+ Sample: [497]
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464/metadata.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464/metadata.txt
new file mode 100644
index 0000000000000000000000000000000000000000..df7e43f432c377a7504f4c4bab7f68b35353e8fa
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464/metadata.txt
@@ -0,0 +1,17 @@
+Metadata for: dance_in_da_party_001__A464
+==============================
+
+Body part indexes:
+[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
+
+Total timesteps: 497
+
+Data arrays summary:
+ joint_pos: (497, 29) (float32)
+ joint_vel: (497, 29) (float32)
+ body_pos_w: (497, 14, 3) (float32)
+ body_quat_w: (497, 14, 4) (float32)
+ body_lin_vel_w: (497, 14, 3) (float32)
+ body_ang_vel_w: (497, 14, 3) (float32)
+ _body_indexes: (14,) (int64)
+ time_step_total: () (int64)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464_M/info.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464_M/info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..afa759c6007aed1edb3e95ead8ed5594f21ad9ed
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464_M/info.txt
@@ -0,0 +1,52 @@
+Motion Information: dance_in_da_party_001__A464_M
+==================================================
+
+joint_pos:
+ Shape: (497, 29)
+ Dtype: float32
+ Range: [-1.868, 2.226]
+ Sample: [ 0.10277859 0.12832902 -0.02010582 -0.0212364 0.01920657]
+
+joint_vel:
+ Shape: (497, 29)
+ Dtype: float32
+ Range: [-20.223, 20.504]
+ Sample: [0.14217682 0.14665052 0. 0. 0. ]
+
+body_pos_w:
+ Shape: (497, 14, 3)
+ Dtype: float32
+ Range: [-0.537, 1.307]
+ Sample: [-2.83326663e-04 1.44427223e-02 7.92431474e-01 1.17636755e-01
+ 1.22397467e-02]
+
+body_quat_w:
+ Shape: (497, 14, 4)
+ Dtype: float32
+ Range: [-0.707, 0.998]
+ Sample: [ 0.7101825 -0.01322068 -0.0210839 -0.7035777 0.70851105]
+
+body_lin_vel_w:
+ Shape: (497, 14, 3)
+ Dtype: float32
+ Range: [-2.763, 2.579]
+ Sample: [ 0.00117058 -0.02414531 -0.00281086 0.00139649 -0.02009862]
+
+body_ang_vel_w:
+ Shape: (497, 14, 3)
+ Dtype: float32
+ Range: [-16.230, 12.991]
+ Sample: [ 0.00225733 -0.00063545 0.00251273 0.10681088 0.0040871 ]
+
+_body_indexes:
+ Shape: (14,)
+ Dtype: int64
+ Range: [0.000, 29.000]
+ Sample: [ 0 4 10 18 5]
+
+time_step_total:
+ Shape: ()
+ Dtype: int64
+ Range: [497.000, 497.000]
+ Sample: [497]
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464_M/metadata.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464_M/metadata.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d5d4431311cec4e7d36024b3430e7615f2ab3a91
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464_M/metadata.txt
@@ -0,0 +1,17 @@
+Metadata for: dance_in_da_party_001__A464_M
+==============================
+
+Body part indexes:
+[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
+
+Total timesteps: 497
+
+Data arrays summary:
+ joint_pos: (497, 29) (float32)
+ joint_vel: (497, 29) (float32)
+ body_pos_w: (497, 14, 3) (float32)
+ body_quat_w: (497, 14, 4) (float32)
+ body_lin_vel_w: (497, 14, 3) (float32)
+ body_ang_vel_w: (497, 14, 3) (float32)
+ _body_indexes: (14,) (int64)
+ time_step_total: () (int64)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/forward_lunge_R_001__A359_M/info.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/forward_lunge_R_001__A359_M/info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..886074dde3cc72aaa29ca8001675849a3f8a520d
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/forward_lunge_R_001__A359_M/info.txt
@@ -0,0 +1,51 @@
+Motion Information: forward_lunge_R_001__A359_M
+==================================================
+
+joint_pos:
+ Shape: (399, 29)
+ Dtype: float32
+ Range: [-1.516, 1.847]
+ Sample: [ 0.21495092 0.21319595 -0.0629773 -0.03622465 0.0364784 ]
+
+joint_vel:
+ Shape: (399, 29)
+ Dtype: float32
+ Range: [-6.573, 7.911]
+ Sample: [ 0. -0.07231236 0. 0. 0. ]
+
+body_pos_w:
+ Shape: (399, 14, 3)
+ Dtype: float32
+ Range: [-0.749, 1.083]
+ Sample: [0.00151141 0.01061182 0.79061526 0.11847792 0.00413224]
+
+body_quat_w:
+ Shape: (399, 14, 4)
+ Dtype: float32
+ Range: [-0.707, 0.951]
+ Sample: [ 0.7101441 -0.0368785 -0.03962614 -0.70197237 0.71026546]
+
+body_lin_vel_w:
+ Shape: (399, 14, 3)
+ Dtype: float32
+ Range: [-2.788, 2.510]
+ Sample: [ 0.00209634 -0.00167504 -0.01071004 -0.00232031 0.00457859]
+
+body_ang_vel_w:
+ Shape: (399, 14, 3)
+ Dtype: float32
+ Range: [-6.113, 7.547]
+ Sample: [ 0.1587345 0.02668758 -0.10707712 0.09136587 0.00318161]
+
+_body_indexes:
+ Shape: (14,)
+ Dtype: int64
+ Range: [0.000, 29.000]
+ Sample: [ 0 4 10 18 5]
+
+time_step_total:
+ Shape: ()
+ Dtype: int64
+ Range: [399.000, 399.000]
+ Sample: [399]
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/forward_lunge_R_001__A359_M/metadata.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/forward_lunge_R_001__A359_M/metadata.txt
new file mode 100644
index 0000000000000000000000000000000000000000..574e3a7eaa1c9f704cd31a8480624599278d7def
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/forward_lunge_R_001__A359_M/metadata.txt
@@ -0,0 +1,17 @@
+Metadata for: forward_lunge_R_001__A359_M
+==============================
+
+Body part indexes:
+[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
+
+Total timesteps: 399
+
+Data arrays summary:
+ joint_pos: (399, 29) (float32)
+ joint_vel: (399, 29) (float32)
+ body_pos_w: (399, 14, 3) (float32)
+ body_quat_w: (399, 14, 4) (float32)
+ body_lin_vel_w: (399, 14, 3) (float32)
+ body_ang_vel_w: (399, 14, 3) (float32)
+ _body_indexes: (14,) (int64)
+ time_step_total: () (int64)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545/info.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545/info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..741f0f87ec07289c86e3bb58b57974fff3863d06
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545/info.txt
@@ -0,0 +1,54 @@
+Motion Information: macarena_001__A545
+==================================================
+
+joint_pos:
+ Shape: (1375, 29)
+ Dtype: float32
+ Range: [-1.839, 1.703]
+ Sample: [-0.10820262 -0.12627353 -0.04614628 0.17931442 0.03701398]
+
+joint_vel:
+ Shape: (1375, 29)
+ Dtype: float32
+ Range: [-16.128, 17.410]
+ Sample: [-0.6181218 0. 0.19610636 0.40379167 0.22178088]
+
+body_pos_w:
+ Shape: (1375, 14, 3)
+ Dtype: float32
+ Range: [-0.461, 1.258]
+ Sample: [-5.8091094e-04 1.5418809e-02 7.8600091e-01 1.1273000e-01
+ 3.0267565e-03]
+
+body_quat_w:
+ Shape: (1375, 14, 4)
+ Dtype: float32
+ Range: [-0.707, 1.000]
+ Sample: [-6.7035830e-01 -5.1285548e-04 -1.2871666e-02 7.4192578e-01
+ -6.7212301e-01]
+
+body_lin_vel_w:
+ Shape: (1375, 14, 3)
+ Dtype: float32
+ Range: [-2.083, 2.181]
+ Sample: [-0.07513097 0.0133487 -0.02677997 -0.09454302 0.01350545]
+
+body_ang_vel_w:
+ Shape: (1375, 14, 3)
+ Dtype: float32
+ Range: [-16.576, 15.656]
+ Sample: [-5.7085539e-04 1.4832462e-01 1.8231243e-01 -7.0407879e-01
+ -1.9635165e-01]
+
+_body_indexes:
+ Shape: (14,)
+ Dtype: int64
+ Range: [0.000, 29.000]
+ Sample: [ 0 4 10 18 5]
+
+time_step_total:
+ Shape: ()
+ Dtype: int64
+ Range: [1375.000, 1375.000]
+ Sample: [1375]
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545/metadata.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545/metadata.txt
new file mode 100644
index 0000000000000000000000000000000000000000..416e44eacab5e7fd5c88690dfecbccc6427856ca
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545/metadata.txt
@@ -0,0 +1,17 @@
+Metadata for: macarena_001__A545
+==============================
+
+Body part indexes:
+[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
+
+Total timesteps: 1375
+
+Data arrays summary:
+ joint_pos: (1375, 29) (float32)
+ joint_vel: (1375, 29) (float32)
+ body_pos_w: (1375, 14, 3) (float32)
+ body_quat_w: (1375, 14, 4) (float32)
+ body_lin_vel_w: (1375, 14, 3) (float32)
+ body_ang_vel_w: (1375, 14, 3) (float32)
+ _body_indexes: (14,) (int64)
+ time_step_total: () (int64)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545_M/info.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545_M/info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..ea72016a5ae026c70b1a24c7cd3632c8b1888fcd
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545_M/info.txt
@@ -0,0 +1,52 @@
+Motion Information: macarena_001__A545_M
+==================================================
+
+joint_pos:
+ Shape: (1375, 29)
+ Dtype: float32
+ Range: [-1.752, 1.839]
+ Sample: [-0.12627211 -0.1081429 0.04614829 -0.03699337 -0.17927563]
+
+joint_vel:
+ Shape: (1375, 29)
+ Dtype: float32
+ Range: [-17.410, 16.353]
+ Sample: [ 0. -0.6198224 -0.19615404 -0.22224468 -0.4047744 ]
+
+body_pos_w:
+ Shape: (1375, 14, 3)
+ Dtype: float32
+ Range: [-0.428, 1.258]
+ Sample: [5.7239551e-04 1.5415414e-02 7.8600442e-01 1.1899064e-01 2.5980033e-02]
+
+body_quat_w:
+ Shape: (1375, 14, 4)
+ Dtype: float32
+ Range: [-0.707, 1.000]
+ Sample: [ 7.4192613e-01 1.2869124e-02 5.1390840e-04 -6.7035794e-01
+ 7.3185688e-01]
+
+body_lin_vel_w:
+ Shape: (1375, 14, 3)
+ Dtype: float32
+ Range: [-1.572, 2.181]
+ Sample: [ 0.07525253 0.0134165 -0.02684434 0.09596311 -0.00692309]
+
+body_ang_vel_w:
+ Shape: (1375, 14, 3)
+ Dtype: float32
+ Range: [-15.288, 16.576]
+ Sample: [-0.00054383 -0.14689815 -0.18050767 0.00343074 0.08365735]
+
+_body_indexes:
+ Shape: (14,)
+ Dtype: int64
+ Range: [0.000, 29.000]
+ Sample: [ 0 4 10 18 5]
+
+time_step_total:
+ Shape: ()
+ Dtype: int64
+ Range: [1375.000, 1375.000]
+ Sample: [1375]
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545_M/metadata.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545_M/metadata.txt
new file mode 100644
index 0000000000000000000000000000000000000000..4ee76bcb5170cb24be301842c0351e2d43f5c4ec
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545_M/metadata.txt
@@ -0,0 +1,17 @@
+Metadata for: macarena_001__A545_M
+==============================
+
+Body part indexes:
+[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
+
+Total timesteps: 1375
+
+Data arrays summary:
+ joint_pos: (1375, 29) (float32)
+ joint_vel: (1375, 29) (float32)
+ body_pos_w: (1375, 14, 3) (float32)
+ body_quat_w: (1375, 14, 4) (float32)
+ body_lin_vel_w: (1375, 14, 3) (float32)
+ body_ang_vel_w: (1375, 14, 3) (float32)
+ _body_indexes: (14,) (int64)
+ time_step_total: () (int64)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543/info.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543/info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..742cc0176981f200d2d51fc5a1549677e48e5b39
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543/info.txt
@@ -0,0 +1,52 @@
+Motion Information: neutral_kick_R_001__A543
+==================================================
+
+joint_pos:
+ Shape: (165, 29)
+ Dtype: float32
+ Range: [-1.511, 2.231]
+ Sample: [ 0.0102154 -0.02437789 -0.00672904 0.01929011 0.01479329]
+
+joint_vel:
+ Shape: (165, 29)
+ Dtype: float32
+ Range: [-18.290, 20.364]
+ Sample: [-0.20629734 -0.50493777 0. 0. -0.0665314 ]
+
+body_pos_w:
+ Shape: (165, 14, 3)
+ Dtype: float32
+ Range: [-0.350, 1.138]
+ Sample: [ 2.5986615e-04 -2.1045217e-03 7.8969425e-01 -1.1502424e-01
+ -9.6319402e-03]
+
+body_quat_w:
+ Shape: (165, 14, 4)
+ Dtype: float32
+ Range: [-0.658, 0.962]
+ Sample: [ 0.70344394 -0.01907959 0.01310167 0.7103738 0.7017253 ]
+
+body_lin_vel_w:
+ Shape: (165, 14, 3)
+ Dtype: float32
+ Range: [-3.077, 4.037]
+ Sample: [-0.00510128 -0.00777466 -0.01248983 -0.01428711 -0.00505795]
+
+body_ang_vel_w:
+ Shape: (165, 14, 3)
+ Dtype: float32
+ Range: [-13.461, 10.895]
+ Sample: [-0.18448198 0.06041717 -0.20089665 0.01372697 0.04333916]
+
+_body_indexes:
+ Shape: (14,)
+ Dtype: int64
+ Range: [0.000, 29.000]
+ Sample: [ 0 4 10 18 5]
+
+time_step_total:
+ Shape: ()
+ Dtype: int64
+ Range: [165.000, 165.000]
+ Sample: [165]
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543/metadata.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543/metadata.txt
new file mode 100644
index 0000000000000000000000000000000000000000..403a86c202e83cc09e10e60f80d9716f1fb353ed
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543/metadata.txt
@@ -0,0 +1,17 @@
+Metadata for: neutral_kick_R_001__A543
+==============================
+
+Body part indexes:
+[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
+
+Total timesteps: 165
+
+Data arrays summary:
+ joint_pos: (165, 29) (float32)
+ joint_vel: (165, 29) (float32)
+ body_pos_w: (165, 14, 3) (float32)
+ body_quat_w: (165, 14, 4) (float32)
+ body_lin_vel_w: (165, 14, 3) (float32)
+ body_ang_vel_w: (165, 14, 3) (float32)
+ _body_indexes: (14,) (int64)
+ time_step_total: () (int64)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543_M/info.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543_M/info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d47981a9c9977db101dfbb88dbfa864a05f53463
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543_M/info.txt
@@ -0,0 +1,52 @@
+Motion Information: neutral_kick_R_001__A543_M
+==================================================
+
+joint_pos:
+ Shape: (165, 29)
+ Dtype: float32
+ Range: [-1.511, 2.231]
+ Sample: [-0.02438436 0.01020973 0.0067296 -0.01478768 -0.01928544]
+
+joint_vel:
+ Shape: (165, 29)
+ Dtype: float32
+ Range: [-18.290, 20.364]
+ Sample: [-0.5047629 -0.20612705 0. 0.06651222 0. ]
+
+body_pos_w:
+ Shape: (165, 14, 3)
+ Dtype: float32
+ Range: [-0.351, 1.138]
+ Sample: [-2.5653988e-04 -2.1049839e-03 7.8969407e-01 -1.1784680e-01
+ -6.2525691e-03]
+
+body_quat_w:
+ Shape: (165, 14, 4)
+ Dtype: float32
+ Range: [-0.674, 0.962]
+ Sample: [ 0.71037376 -0.0131016 0.01907985 0.703444 0.7091498 ]
+
+body_lin_vel_w:
+ Shape: (165, 14, 3)
+ Dtype: float32
+ Range: [-3.077, 4.037]
+ Sample: [ 0.00510508 -0.00776416 -0.01248534 0.01384882 -0.0365492 ]
+
+body_ang_vel_w:
+ Shape: (165, 14, 3)
+ Dtype: float32
+ Range: [-10.156, 13.797]
+ Sample: [-0.18570669 -0.06071702 0.20189351 0.40606773 0.00312011]
+
+_body_indexes:
+ Shape: (14,)
+ Dtype: int64
+ Range: [0.000, 29.000]
+ Sample: [ 0 4 10 18 5]
+
+time_step_total:
+ Shape: ()
+ Dtype: int64
+ Range: [165.000, 165.000]
+ Sample: [165]
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543_M/metadata.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543_M/metadata.txt
new file mode 100644
index 0000000000000000000000000000000000000000..86b1149cdcf6032b6b3fe36e0120d2637e5a3f9c
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543_M/metadata.txt
@@ -0,0 +1,17 @@
+Metadata for: neutral_kick_R_001__A543_M
+==============================
+
+Body part indexes:
+[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
+
+Total timesteps: 165
+
+Data arrays summary:
+ joint_pos: (165, 29) (float32)
+ joint_vel: (165, 29) (float32)
+ body_pos_w: (165, 14, 3) (float32)
+ body_quat_w: (165, 14, 4) (float32)
+ body_lin_vel_w: (165, 14, 3) (float32)
+ body_ang_vel_w: (165, 14, 3) (float32)
+ _body_indexes: (14,) (int64)
+ time_step_total: () (int64)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/squat_001__A359/info.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/squat_001__A359/info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1a3588457a4920fc2ef99eff709d936c66a66426
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/squat_001__A359/info.txt
@@ -0,0 +1,51 @@
+Motion Information: squat_001__A359
+==================================================
+
+joint_pos:
+ Shape: (424, 29)
+ Dtype: float32
+ Range: [-2.215, 2.576]
+ Sample: [ 0.15727139 0.15096666 0.04344312 -0.00495214 0.00737908]
+
+joint_vel:
+ Shape: (424, 29)
+ Dtype: float32
+ Range: [-4.688, 4.380]
+ Sample: [0.06294921 0.07401705 0. 0. 0. ]
+
+body_pos_w:
+ Shape: (424, 14, 3)
+ Dtype: float32
+ Range: [-0.364, 1.085]
+ Sample: [-0.00253593 0.01265665 0.79256266 0.11277536 0.00799088]
+
+body_quat_w:
+ Shape: (424, 14, 4)
+ Dtype: float32
+ Range: [-0.707, 0.778]
+ Sample: [ 0.7121807 -0.03302116 -0.02697971 -0.70069987 0.711816 ]
+
+body_lin_vel_w:
+ Shape: (424, 14, 3)
+ Dtype: float32
+ Range: [-1.232, 1.069]
+ Sample: [-0.00345908 0.01068808 0.00030054 -0.00323385 0.01278332]
+
+body_ang_vel_w:
+ Shape: (424, 14, 3)
+ Dtype: float32
+ Range: [-4.028, 3.743]
+ Sample: [ 0.00429551 -0.00147157 0.01170849 -0.00151611 -0.00085008]
+
+_body_indexes:
+ Shape: (14,)
+ Dtype: int64
+ Range: [0.000, 29.000]
+ Sample: [ 0 4 10 18 5]
+
+time_step_total:
+ Shape: ()
+ Dtype: int64
+ Range: [424.000, 424.000]
+ Sample: [424]
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/squat_001__A359/metadata.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/squat_001__A359/metadata.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a484e1268214df01302fafd3f70c1b1db0ebba2e
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/squat_001__A359/metadata.txt
@@ -0,0 +1,17 @@
+Metadata for: squat_001__A359
+==============================
+
+Body part indexes:
+[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
+
+Total timesteps: 424
+
+Data arrays summary:
+ joint_pos: (424, 29) (float32)
+ joint_vel: (424, 29) (float32)
+ body_pos_w: (424, 14, 3) (float32)
+ body_quat_w: (424, 14, 4) (float32)
+ body_lin_vel_w: (424, 14, 3) (float32)
+ body_ang_vel_w: (424, 14, 3) (float32)
+ _body_indexes: (14,) (int64)
+ time_step_total: () (int64)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_forward_lunge_R_001__A359_M/info.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_forward_lunge_R_001__A359_M/info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0181cb5782276205bda070b870a98409857f4472
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_forward_lunge_R_001__A359_M/info.txt
@@ -0,0 +1,51 @@
+Motion Information: tired_forward_lunge_R_001__A359_M
+==================================================
+
+joint_pos:
+ Shape: (810, 29)
+ Dtype: float32
+ Range: [-1.681, 2.251]
+ Sample: [ 0.10455281 0.12311819 -0.13420933 0.0210929 0.01301001]
+
+joint_vel:
+ Shape: (810, 29)
+ Dtype: float32
+ Range: [-29.172, 24.785]
+ Sample: [0. 0. 0. 0. 0.]
+
+body_pos_w:
+ Shape: (810, 14, 3)
+ Dtype: float32
+ Range: [-0.830, 1.122]
+ Sample: [ 0.00363829 0.01252624 0.78668284 0.11977606 -0.00450246]
+
+body_quat_w:
+ Shape: (810, 14, 4)
+ Dtype: float32
+ Range: [-0.707, 0.968]
+ Sample: [-0.6985865 0.04820039 0.04724668 0.71233517 -0.6972264 ]
+
+body_lin_vel_w:
+ Shape: (810, 14, 3)
+ Dtype: float32
+ Range: [-2.633, 2.705]
+ Sample: [ 0.00514652 -0.0242208 0.00147181 0.0059143 -0.02151402]
+
+body_ang_vel_w:
+ Shape: (810, 14, 3)
+ Dtype: float32
+ Range: [-9.584, 12.844]
+ Sample: [ 0.01855543 -0.00674082 0.00205783 0.04113024 0.00938711]
+
+_body_indexes:
+ Shape: (14,)
+ Dtype: int64
+ Range: [0.000, 29.000]
+ Sample: [ 0 4 10 18 5]
+
+time_step_total:
+ Shape: ()
+ Dtype: int64
+ Range: [810.000, 810.000]
+ Sample: [810]
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_forward_lunge_R_001__A359_M/metadata.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_forward_lunge_R_001__A359_M/metadata.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c054b637577ae8fd5a5ed1c4cd24fd24e63bf2fa
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_forward_lunge_R_001__A359_M/metadata.txt
@@ -0,0 +1,17 @@
+Metadata for: tired_forward_lunge_R_001__A359_M
+==============================
+
+Body part indexes:
+[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
+
+Total timesteps: 810
+
+Data arrays summary:
+ joint_pos: (810, 29) (float32)
+ joint_vel: (810, 29) (float32)
+ body_pos_w: (810, 14, 3) (float32)
+ body_quat_w: (810, 14, 4) (float32)
+ body_lin_vel_w: (810, 14, 3) (float32)
+ body_ang_vel_w: (810, 14, 3) (float32)
+ _body_indexes: (14,) (int64)
+ time_step_total: () (int64)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359/info.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359/info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..7a0f73fb2fae81f95db15ed8f4a3740e8fb3d4dd
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359/info.txt
@@ -0,0 +1,53 @@
+Motion Information: tired_one_leg_jumping_R_001__A359
+==================================================
+
+joint_pos:
+ Shape: (500, 29)
+ Dtype: float32
+ Range: [-2.466, 2.544]
+ Sample: [ 0.19818522 0.18190861 0.05533926 -0.01394359 0.01180514]
+
+joint_vel:
+ Shape: (500, 29)
+ Dtype: float32
+ Range: [-24.277, 29.521]
+ Sample: [0.08117855 0.10404438 0. 0. 0. ]
+
+body_pos_w:
+ Shape: (500, 14, 3)
+ Dtype: float32
+ Range: [-0.638, 1.389]
+ Sample: [-3.7561040e-03 1.1930190e-02 7.9080468e-01 1.1164543e-01
+ -1.8159859e-04]
+
+body_quat_w:
+ Shape: (500, 14, 4)
+ Dtype: float32
+ Range: [-0.707, 0.994]
+ Sample: [-0.7018543 0.04748023 0.04207473 0.7094899 -0.7020061 ]
+
+body_lin_vel_w:
+ Shape: (500, 14, 3)
+ Dtype: float32
+ Range: [-2.468, 3.083]
+ Sample: [-0.00731237 0.00322476 -0.00184366 -0.0072301 0.0033868 ]
+
+body_ang_vel_w:
+ Shape: (500, 14, 3)
+ Dtype: float32
+ Range: [-13.765, 14.489]
+ Sample: [-2.3229383e-02 9.2615977e-05 7.7703241e-03 3.2781955e-02
+ -2.4797707e-03]
+
+_body_indexes:
+ Shape: (14,)
+ Dtype: int64
+ Range: [0.000, 29.000]
+ Sample: [ 0 4 10 18 5]
+
+time_step_total:
+ Shape: ()
+ Dtype: int64
+ Range: [500.000, 500.000]
+ Sample: [500]
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359/metadata.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359/metadata.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e0c04aa7da47c55aecf8061065d981e28efb9b95
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359/metadata.txt
@@ -0,0 +1,17 @@
+Metadata for: tired_one_leg_jumping_R_001__A359
+==============================
+
+Body part indexes:
+[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
+
+Total timesteps: 500
+
+Data arrays summary:
+ joint_pos: (500, 29) (float32)
+ joint_vel: (500, 29) (float32)
+ body_pos_w: (500, 14, 3) (float32)
+ body_quat_w: (500, 14, 4) (float32)
+ body_lin_vel_w: (500, 14, 3) (float32)
+ body_ang_vel_w: (500, 14, 3) (float32)
+ _body_indexes: (14,) (int64)
+ time_step_total: () (int64)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359_M/info.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359_M/info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..61492c27d645b0c207bd8f6d59f0c87988508955
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359_M/info.txt
@@ -0,0 +1,51 @@
+Motion Information: tired_one_leg_jumping_R_001__A359_M
+==================================================
+
+joint_pos:
+ Shape: (500, 29)
+ Dtype: float32
+ Range: [-2.466, 2.544]
+ Sample: [ 0.18195386 0.19815134 -0.05533458 -0.01181217 0.01394258]
+
+joint_vel:
+ Shape: (500, 29)
+ Dtype: float32
+ Range: [-25.521, 29.521]
+ Sample: [0.10270029 0.0821501 0. 0. 0. ]
+
+body_pos_w:
+ Shape: (500, 14, 3)
+ Dtype: float32
+ Range: [-0.638, 1.389]
+ Sample: [0.00375429 0.0119299 0.7908045 0.12123838 0.00211857]
+
+body_quat_w:
+ Shape: (500, 14, 4)
+ Dtype: float32
+ Range: [-0.707, 0.994]
+ Sample: [ 0.70963436 -0.04173436 -0.04712047 -0.7017528 0.709552 ]
+
+body_lin_vel_w:
+ Shape: (500, 14, 3)
+ Dtype: float32
+ Range: [-2.468, 3.083]
+ Sample: [ 0.00727609 0.00323505 -0.00185661 0.00736587 -0.00425211]
+
+body_ang_vel_w:
+ Shape: (500, 14, 3)
+ Dtype: float32
+ Range: [-14.474, 12.502]
+ Sample: [-0.04819455 -0.00166482 -0.01665068 0.0203299 0.0001879 ]
+
+_body_indexes:
+ Shape: (14,)
+ Dtype: int64
+ Range: [0.000, 29.000]
+ Sample: [ 0 4 10 18 5]
+
+time_step_total:
+ Shape: ()
+ Dtype: int64
+ Range: [500.000, 500.000]
+ Sample: [500]
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359_M/metadata.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359_M/metadata.txt
new file mode 100644
index 0000000000000000000000000000000000000000..37e1e0e6518667f18676a28fecf50202919e08a1
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359_M/metadata.txt
@@ -0,0 +1,17 @@
+Metadata for: tired_one_leg_jumping_R_001__A359_M
+==============================
+
+Body part indexes:
+[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
+
+Total timesteps: 500
+
+Data arrays summary:
+ joint_pos: (500, 29) (float32)
+ joint_vel: (500, 29) (float32)
+ body_pos_w: (500, 14, 3) (float32)
+ body_quat_w: (500, 14, 4) (float32)
+ body_lin_vel_w: (500, 14, 3) (float32)
+ body_ang_vel_w: (500, 14, 3) (float32)
+ _body_indexes: (14,) (int64)
+ time_step_total: () (int64)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428/info.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428/info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e6a1cd5ad3c261a373a6b1377ddaf48a623258f1
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428/info.txt
@@ -0,0 +1,51 @@
+Motion Information: walking_quip_360_R_002__A428
+==================================================
+
+joint_pos:
+ Shape: (455, 29)
+ Dtype: float32
+ Range: [-1.350, 1.403]
+ Sample: [ 0.0239802 0.01111414 -0.06473327 0.01455649 -0.05278705]
+
+joint_vel:
+ Shape: (455, 29)
+ Dtype: float32
+ Range: [-10.128, 10.542]
+ Sample: [ 0. -0.06379467 0. 0. 0. ]
+
+body_pos_w:
+ Shape: (455, 14, 3)
+ Dtype: float32
+ Range: [-5.178, 1.205]
+ Sample: [0.00238936 0.01172794 0.7911665 0.11803366 0.01129898]
+
+body_quat_w:
+ Shape: (455, 14, 4)
+ Dtype: float32
+ Range: [-0.707, 0.993]
+ Sample: [ 0.7112312 -0.00883037 -0.00456219 -0.70288795 0.7092943 ]
+
+body_lin_vel_w:
+ Shape: (455, 14, 3)
+ Dtype: float32
+ Range: [-2.853, 1.454]
+ Sample: [-0.00302621 0.01039287 0.0045207 -0.00268457 0.01099243]
+
+body_ang_vel_w:
+ Shape: (455, 14, 3)
+ Dtype: float32
+ Range: [-10.792, 10.693]
+ Sample: [ 0.00032408 -0.00011129 0.00044492 -0.00352303 0.0018626 ]
+
+_body_indexes:
+ Shape: (14,)
+ Dtype: int64
+ Range: [0.000, 29.000]
+ Sample: [ 0 4 10 18 5]
+
+time_step_total:
+ Shape: ()
+ Dtype: int64
+ Range: [455.000, 455.000]
+ Sample: [455]
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428/metadata.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428/metadata.txt
new file mode 100644
index 0000000000000000000000000000000000000000..874949f4c1a7ead3be5663ea297cbf1393831000
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428/metadata.txt
@@ -0,0 +1,17 @@
+Metadata for: walking_quip_360_R_002__A428
+==============================
+
+Body part indexes:
+[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
+
+Total timesteps: 455
+
+Data arrays summary:
+ joint_pos: (455, 29) (float32)
+ joint_vel: (455, 29) (float32)
+ body_pos_w: (455, 14, 3) (float32)
+ body_quat_w: (455, 14, 4) (float32)
+ body_lin_vel_w: (455, 14, 3) (float32)
+ body_ang_vel_w: (455, 14, 3) (float32)
+ _body_indexes: (14,) (int64)
+ time_step_total: () (int64)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428_M/info.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428_M/info.txt
new file mode 100644
index 0000000000000000000000000000000000000000..911d087531797b17c70daefcc7f312ce44e51711
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428_M/info.txt
@@ -0,0 +1,51 @@
+Motion Information: walking_quip_360_R_002__A428_M
+==================================================
+
+joint_pos:
+ Shape: (455, 29)
+ Dtype: float32
+ Range: [-1.003, 1.403]
+ Sample: [ 0.01109954 0.02397734 0.06473204 0.05247362 -0.01430147]
+
+joint_vel:
+ Shape: (455, 29)
+ Dtype: float32
+ Range: [-10.128, 10.542]
+ Sample: [-0.06343862 0. 0. 0. 0. ]
+
+body_pos_w:
+ Shape: (455, 14, 3)
+ Dtype: float32
+ Range: [-5.178, 1.205]
+ Sample: [-0.00239508 0.01172869 0.7911661 0.1148396 0.00817287]
+
+body_quat_w:
+ Shape: (455, 14, 4)
+ Dtype: float32
+ Range: [-0.707, 0.993]
+ Sample: [-0.702888 0.00456196 0.00883033 0.7112312 -0.70121443]
+
+body_lin_vel_w:
+ Shape: (455, 14, 3)
+ Dtype: float32
+ Range: [-2.853, 1.454]
+ Sample: [0.00306987 0.01037478 0.00453062 0.00270815 0.00906713]
+
+body_ang_vel_w:
+ Shape: (455, 14, 3)
+ Dtype: float32
+ Range: [-10.691, 10.791]
+ Sample: [ 0.0003236 0.00011099 -0.00044414 -0.02917245 0.00046786]
+
+_body_indexes:
+ Shape: (14,)
+ Dtype: int64
+ Range: [0.000, 29.000]
+ Sample: [ 0 4 10 18 5]
+
+time_step_total:
+ Shape: ()
+ Dtype: int64
+ Range: [455.000, 455.000]
+ Sample: [455]
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428_M/metadata.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428_M/metadata.txt
new file mode 100644
index 0000000000000000000000000000000000000000..85fc566443a0e450b0fd355121db1b6ea672b541
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428_M/metadata.txt
@@ -0,0 +1,17 @@
+Metadata for: walking_quip_360_R_002__A428_M
+==============================
+
+Body part indexes:
+[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
+
+Total timesteps: 455
+
+Data arrays summary:
+ joint_pos: (455, 29) (float32)
+ joint_vel: (455, 29) (float32)
+ body_pos_w: (455, 14, 3) (float32)
+ body_quat_w: (455, 14, 4) (float32)
+ body_lin_vel_w: (455, 14, 3) (float32)
+ body_ang_vel_w: (455, 14, 3) (float32)
+ _body_indexes: (14,) (int64)
+ time_step_total: () (int64)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/install_deps.sh b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/install_deps.sh
new file mode 100644
index 0000000000000000000000000000000000000000..a8e413ec3838bb4f307216547055e95970cc01b7
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/install_deps.sh
@@ -0,0 +1,926 @@
+#!/bin/bash
+
+set -e
+
+echo "🚀 Installing G1 Deploy system dependencies..."
+sudo apt-get update && sudo apt-get install -y libgtest-dev
+
+# Detect system type and architecture
+ARCH=$(uname -m)
+OS_ID=$(lsb_release -si 2>/dev/null || echo "Unknown")
+OS_VERSION=$(lsb_release -sr 2>/dev/null || echo "Unknown")
+
+# Common CUDA installation paths (used by multiple functions)
+CUDA_PATHS=(
+ "/usr/local/cuda"
+ "/usr/local/cuda-12.6" # CUDA 12.6 on newer Jetson
+ "/usr/local/cuda-12.5" # CUDA 12.5 variant
+ "/usr/local/cuda-12.4" # CUDA 12.4 variant
+ "/usr/local/cuda-12" # Generic CUDA 12.x
+ "/usr/local/cuda-11.4" # Common on older Jetson
+ "/usr/local/cuda-10.2" # Common on older Jetson
+ "/usr/local/cuda-11"
+ "/usr/local/cuda-10"
+ "/opt/cuda"
+ "/usr/cuda"
+)
+
+# Common CUDA runtime library paths (used by multiple functions)
+CUDA_RUNTIME_PATHS=(
+ "/usr/local/cuda/lib64/libcudart.so"
+ "/usr/local/cuda-12.6/lib64/libcudart.so"
+ "/usr/local/cuda-12.5/lib64/libcudart.so"
+ "/usr/local/cuda-12.4/lib64/libcudart.so"
+ "/usr/local/cuda-12/lib64/libcudart.so"
+ "/usr/local/cuda-11.4/lib64/libcudart.so"
+ "/usr/local/cuda-10.2/lib64/libcudart.so"
+ "/usr/lib/aarch64-linux-gnu/libcudart.so"
+ "/usr/lib/x86_64-linux-gnu/libcudart.so"
+ "/usr/lib64/libcudart.so"
+ "/usr/lib/libcudart.so"
+)
+
+# Common CUDA header paths (used by multiple functions)
+CUDA_HEADER_PATHS=(
+ "/usr/local/cuda/include/cuda_runtime.h"
+ "/usr/local/cuda-12.6/include/cuda_runtime.h"
+ "/usr/local/cuda-12.5/include/cuda_runtime.h"
+ "/usr/local/cuda-12.4/include/cuda_runtime.h"
+ "/usr/local/cuda-12/include/cuda_runtime.h"
+ "/usr/local/cuda-11.4/include/cuda_runtime.h"
+ "/usr/local/cuda-10.2/include/cuda_runtime.h"
+ "/usr/local/cuda-11/include/cuda_runtime.h"
+ "/usr/include/cuda_runtime.h"
+ "/usr/include/cuda/cuda_runtime.h"
+)
+
+# Common utility functions
+has_cuda_in_ldconfig() {
+ ldconfig -p 2>/dev/null | grep -q "libcudart\|libcuda"
+}
+
+# Update package cache (with deduplication)
+update_package_cache() {
+ if [ "$PACKAGE_MANAGER" = "apt" ] && [ "$APT_UPDATED" != "true" ]; then
+ sudo apt-get update
+ export APT_UPDATED="true"
+ fi
+}
+
+# Enhanced Jetson detection
+IS_JETSON=false
+JETSON_MODEL=""
+
+if [[ "$ARCH" == "aarch64" ]]; then
+ # Check for Jetson-specific indicators
+ if [[ -f "/etc/nv_tegra_release" ]] || \
+ [[ -d "/usr/src/jetson_multimedia_api" ]] || \
+ ls /etc/apt/sources.list.d/ 2>/dev/null | grep -q jetson || \
+ [[ -f "/proc/device-tree/model" && $(cat /proc/device-tree/model 2>/dev/null) =~ "Jetson" ]]; then
+ IS_JETSON=true
+
+ # Detect Jetson model for optimized package selection
+ if [[ -f "/proc/device-tree/model" ]]; then
+ JETSON_MODEL=$(cat /proc/device-tree/model 2>/dev/null | tr -d '\0' | sed 's/NVIDIA //')
+ echo "🤖 Jetson system detected: $JETSON_MODEL"
+ else
+ echo "🤖 Jetson system detected (model unknown)"
+ fi
+
+ # Check JetPack version if available
+ if command -v jetson_release &> /dev/null; then
+ JETPACK_VERSION=$(jetson_release -v 2>/dev/null | grep "JETPACK" | cut -d' ' -f2 || echo "unknown")
+ echo "📦 JetPack version: $JETPACK_VERSION"
+ fi
+ fi
+fi
+
+echo "🔍 System: $OS_ID $OS_VERSION ($ARCH)$([ "$IS_JETSON" = true ] && echo " - Jetson")"
+
+# Detect the operating system and package manager
+if command -v apt-get &> /dev/null; then
+ PACKAGE_MANAGER="apt"
+elif command -v yum &> /dev/null; then
+ PACKAGE_MANAGER="yum"
+elif command -v pacman &> /dev/null; then
+ PACKAGE_MANAGER="pacman"
+else
+ echo "❌ Unsupported package manager. This script supports apt, yum, and pacman."
+ exit 1
+fi
+
+# Function to install packages based on the package manager
+install_packages() {
+ case $PACKAGE_MANAGER in
+ apt)
+ update_package_cache
+ sudo apt-get install -y "$@"
+ ;;
+ yum)
+ sudo yum install -y "$@"
+ ;;
+ pacman)
+ sudo pacman -S --noconfirm "$@"
+ ;;
+ esac
+}
+
+echo "📦 Installing base development tools..."
+case $PACKAGE_MANAGER in
+ apt)
+ if [ "$IS_JETSON" = true ]; then
+ echo "🤖 Installing packages optimized for Jetson system..."
+ # Jetson systems may have some tools pre-installed
+ JETSON_PACKAGES="build-essential clang cmake git git-lfs pkg-config patchelf zlib1g-dev curl wget"
+
+ # Add optional packages if available
+ if apt-cache show cmake-format &>/dev/null; then
+ JETSON_PACKAGES="$JETSON_PACKAGES cmake-format"
+ fi
+ if apt-cache show cppcheck &>/dev/null; then
+ JETSON_PACKAGES="$JETSON_PACKAGES cppcheck"
+ fi
+
+ install_packages $JETSON_PACKAGES
+ else
+ install_packages \
+ build-essential \
+ clang \
+ cmake \
+ cmake-format \
+ cppcheck \
+ git \
+ git-lfs \
+ pkg-config \
+ patchelf \
+ zlib1g-dev \
+ curl \
+ wget
+ fi
+ ;;
+ yum)
+ install_packages \
+ gcc \
+ gcc-c++ \
+ clang \
+ cmake \
+ cppcheck \
+ git \
+ git-lfs \
+ pkgconfig \
+ patchelf \
+ zlib-devel \
+ curl \
+ wget
+ ;;
+ pacman)
+ install_packages \
+ base-devel \
+ clang \
+ cmake \
+ cppcheck \
+ git \
+ git-lfs \
+ pkgconf \
+ patchelf \
+ zlib \
+ curl \
+ wget
+ ;;
+esac
+
+echo "📚 Installing C++ libraries..."
+case $PACKAGE_MANAGER in
+ apt)
+ install_packages \
+ libyaml-cpp-dev \
+ libeigen3-dev \
+ libmsgpack-dev \
+ libzmq3-dev \
+ nlohmann-json3-dev \
+ libgtest-dev
+ ;;
+ yum)
+ install_packages \
+ yaml-cpp-devel \
+ eigen3-devel \
+ msgpack-devel \
+ zeromq-devel \
+ cppzmq-devel \
+ nlohmann-json-devel \
+ gtest-devel
+ ;;
+ pacman)
+ install_packages \
+ yaml-cpp \
+ eigen \
+ msgpack-cxx \
+ zeromq \
+ cppzmq \
+ nlohmann-json \
+ gtest
+ ;;
+esac
+
+# Ensure ZeroMQ C++ headers (cppzmq) are available.
+# On some Ubuntu releases (e.g., 24.04), the 'cppzmq' or 'libcppzmq-dev' package may be missing.
+# If not found, vendor the header-only repo to third_party/cppzmq.
+echo "🧩 Ensuring ZeroMQ C++ headers (cppzmq)..."
+
+# Resolve repository root relative to this script
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
+THIRD_PARTY_DIR="$REPO_ROOT/third_party"
+
+have_cppzmq_header=false
+if [ -f "/usr/include/zmq.hpp" ]; then
+ have_cppzmq_header=true
+fi
+
+if [ "$have_cppzmq_header" = false ]; then
+ if [ "$PACKAGE_MANAGER" = "apt" ]; then
+ # Try distro packages if available
+ if apt-cache policy cppzmq 2>/dev/null | grep -q "Candidate:" && \
+ ! apt-cache policy cppzmq 2>/dev/null | grep -q "(none)"; then
+ update_package_cache
+ if sudo apt-get install -y cppzmq; then
+ have_cppzmq_header=true
+ fi
+ elif apt-cache policy libcppzmq-dev 2>/dev/null | grep -q "Candidate:" && \
+ ! apt-cache policy libcppzmq-dev 2>/dev/null | grep -q "(none)"; then
+ update_package_cache
+ if sudo apt-get install -y libcppzmq-dev; then
+ have_cppzmq_header=true
+ fi
+ fi
+ fi
+fi
+
+if [ "$have_cppzmq_header" = false ]; then
+ echo "📦 Vendoring header-only cppzmq into third_party..."
+ mkdir -p "$THIRD_PARTY_DIR"
+ if [ ! -d "$THIRD_PARTY_DIR/cppzmq/.git" ]; then
+ if git clone --depth 1 https://github.com/zeromq/cppzmq.git "$THIRD_PARTY_DIR/cppzmq"; then
+ echo "✅ cppzmq headers cloned to $THIRD_PARTY_DIR/cppzmq"
+ echo " Add include path: -I$THIRD_PARTY_DIR/cppzmq"
+ else
+ echo "❌ Failed to clone cppzmq repo. Please install headers manually."
+ fi
+ else
+ if git -C "$THIRD_PARTY_DIR/cppzmq" pull --ff-only; then
+ echo "✅ cppzmq headers updated in $THIRD_PARTY_DIR/cppzmq"
+ else
+ echo "⚠️ Failed to update cppzmq headers. Using existing copy."
+ fi
+ fi
+else
+ echo "✅ ZeroMQ C++ headers found in system includes"
+fi
+
+# Ensure JSON headers (nlohmann/json) are available (similar to cppzmq ensure)
+echo "🧩 Ensuring JSON headers (nlohmann/json)..."
+
+have_json_header=false
+if [ -f "/usr/include/nlohmann/json.hpp" ] || [ -f "/usr/local/include/nlohmann/json.hpp" ]; then
+ have_json_header=true
+fi
+
+if [ "$have_json_header" = false ]; then
+ case $PACKAGE_MANAGER in
+ apt)
+ update_package_cache
+ sudo apt-get install -y nlohmann-json3-dev || true
+ ;;
+ yum)
+ sudo yum install -y nlohmann-json-devel || true
+ ;;
+ pacman)
+ sudo pacman -S --noconfirm nlohmann-json || true
+ ;;
+ esac
+ if [ -f "/usr/include/nlohmann/json.hpp" ] || [ -f "/usr/local/include/nlohmann/json.hpp" ]; then
+ have_json_header=true
+ fi
+fi
+
+if [ "$have_json_header" = false ]; then
+ echo "📦 Vendoring nlohmann/json into third_party..."
+ # Reuse THIRD_PARTY_DIR from earlier cppzmq ensure block if set; otherwise define
+ if [ -z "$THIRD_PARTY_DIR" ]; then
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
+ THIRD_PARTY_DIR="$REPO_ROOT/third_party"
+ fi
+ mkdir -p "$THIRD_PARTY_DIR"
+ if [ ! -d "$THIRD_PARTY_DIR/nlohmann_json/.git" ]; then
+ if git clone --depth 1 https://github.com/nlohmann/json.git "$THIRD_PARTY_DIR/nlohmann_json"; then
+ echo "✅ nlohmann/json cloned to $THIRD_PARTY_DIR/nlohmann_json"
+ echo " Add include path: -I$THIRD_PARTY_DIR/nlohmann_json/single_include"
+ else
+ echo "❌ Failed to clone nlohmann/json. Please install headers manually."
+ fi
+ else
+ if git -C "$THIRD_PARTY_DIR/nlohmann_json" pull --ff-only; then
+ echo "✅ nlohmann/json updated in $THIRD_PARTY_DIR/nlohmann_json"
+ else
+ echo "⚠️ Failed to update nlohmann/json. Using existing copy."
+ fi
+ fi
+else
+ echo "✅ JSON headers found in system includes"
+fi
+
+# Install Just command runner
+echo "⚡ Installing Just command runner..."
+if ! command -v just &> /dev/null; then
+ case $PACKAGE_MANAGER in
+ apt|yum)
+ # Install Just from GitHub releases for Ubuntu/Debian and RHEL/CentOS
+ JUST_VERSION="1.43.0"
+ JUST_ARCH=$(uname -m)
+
+ # Map architecture names to just release naming
+ case $JUST_ARCH in
+ x86_64)
+ JUST_ARCH_NAME="x86_64-unknown-linux-musl"
+ ;;
+ aarch64|arm64)
+ JUST_ARCH_NAME="aarch64-unknown-linux-musl"
+ ;;
+ armv7l)
+ JUST_ARCH_NAME="armv7-unknown-linux-musleabihf"
+ ;;
+ arm*)
+ JUST_ARCH_NAME="arm-unknown-linux-musleabihf"
+ ;;
+ *)
+ echo "❌ Unsupported architecture for just: $JUST_ARCH"
+ echo " Supported architectures: x86_64, aarch64, armv7l, arm"
+ exit 1
+ ;;
+ esac
+
+ echo "📥 Downloading Just ${JUST_VERSION} for ${JUST_ARCH}..."
+ JUST_URL="https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-${JUST_ARCH_NAME}.tar.gz"
+ curl -L "$JUST_URL" | tar xz -C /tmp
+ sudo mv /tmp/just /usr/local/bin/
+ ;;
+ pacman)
+ install_packages just
+ ;;
+ esac
+else
+ echo "✅ Just is already installed"
+fi
+
+# Install ONNX Runtime
+echo "🧠 Setting up ONNX Runtime..."
+
+# Allow configurable installation path
+ONNX_INSTALL_PATH="${ONNX_INSTALL_PATH:-/opt/onnxruntime}"
+
+if [ ! -d "$ONNX_INSTALL_PATH" ]; then
+ ONNX_VERSION="1.16.3"
+ ONNX_ARCH=$(uname -m)
+
+ if [ "$ONNX_ARCH" = "x86_64" ]; then
+ ONNX_URL="https://github.com/microsoft/onnxruntime/releases/download/v${ONNX_VERSION}/onnxruntime-linux-x64-${ONNX_VERSION}.tgz"
+ elif [ "$ONNX_ARCH" = "aarch64" ]; then
+ # Same URL for all ARM64 systems (Jetson and regular ARM64)
+ ONNX_URL="https://github.com/microsoft/onnxruntime/releases/download/v${ONNX_VERSION}/onnxruntime-linux-aarch64-${ONNX_VERSION}.tgz"
+ if [ "$IS_JETSON" = true ]; then
+ echo "🤖 Jetson system detected - using ARM64 ONNX Runtime..."
+ fi
+ else
+ echo "❌ Unsupported architecture: $ONNX_ARCH"
+ exit 1
+ fi
+
+ echo "📥 Downloading ONNX Runtime ${ONNX_VERSION} for ${ONNX_ARCH}$([ "$IS_JETSON" = true ] && echo " (Jetson-optimized)")..."
+ cd /tmp
+
+ # Download with retry for Jetson systems (sometimes have slower network)
+ if [ "$IS_JETSON" = true ]; then
+ curl -L --retry 3 --retry-delay 2 "$ONNX_URL" -o onnxruntime.tgz
+ else
+ curl -L "$ONNX_URL" -o onnxruntime.tgz
+ fi
+
+ tar xzf onnxruntime.tgz
+
+ # Move to configured location (may need sudo for system paths)
+ ONNX_DIR=$(ls -d onnxruntime-linux-* | head -n1)
+
+ if [[ "$ONNX_INSTALL_PATH" =~ ^(/opt|/usr) ]]; then
+ # System path - needs sudo
+ sudo mv "$ONNX_DIR" "$ONNX_INSTALL_PATH"
+ sudo ln -sf "$ONNX_INSTALL_PATH/lib/libonnxruntime.so" /usr/local/lib/ 2>/dev/null || true
+ sudo ln -sf "$ONNX_INSTALL_PATH/include" /usr/local/include/onnxruntime 2>/dev/null || true
+ echo "$ONNX_INSTALL_PATH/lib" | sudo tee /etc/ld.so.conf.d/onnxruntime.conf
+ sudo ldconfig
+ else
+ # User path - no sudo needed
+ mv "$ONNX_DIR" "$ONNX_INSTALL_PATH"
+ # Create user-accessible symlinks if possible
+ if [ -w /usr/local/lib ]; then
+ ln -sf "$ONNX_INSTALL_PATH/lib/libonnxruntime.so" /usr/local/lib/ 2>/dev/null || true
+ fi
+ fi
+
+ # For Jetson systems, add to environment
+ if [ "$IS_JETSON" = true ]; then
+ echo "# ONNX Runtime for Jetson" | sudo tee -a /etc/environment
+ echo "LD_LIBRARY_PATH=\"$ONNX_INSTALL_PATH/lib:\$LD_LIBRARY_PATH\"" | sudo tee -a /etc/environment
+ fi
+
+ echo "✅ ONNX Runtime installed to $ONNX_INSTALL_PATH$([ "$IS_JETSON" = true ] && echo " with Jetson optimizations")"
+else
+ echo "✅ ONNX Runtime is already installed at $ONNX_INSTALL_PATH"
+fi
+
+echo "💡 To install to a different location, set ONNX_INSTALL_PATH environment variable"
+
+# Function to check for CUDA toolkit (nvcc compiler) - silent check
+check_cuda_toolkit() {
+ # Check for nvcc in PATH
+ if command -v nvcc &> /dev/null; then
+ return 0
+ fi
+
+ # Check common CUDA installation paths (using shared variable)
+
+ for cuda_path in "${CUDA_PATHS[@]}"; do
+ if [ -f "$cuda_path/bin/nvcc" ]; then
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+# Function to check for CUDA runtime libraries AND headers (needed for compilation)
+check_cuda_runtime() {
+ # Check for CUDA runtime libraries
+ local has_libraries=false
+ if has_cuda_in_ldconfig; then
+ has_libraries=true
+ else
+ # Check specific paths for runtime libraries (using shared variable)
+ for lib_path in "${CUDA_RUNTIME_PATHS[@]}"; do
+ if [ -f "$lib_path" ]; then
+ has_libraries=true
+ break
+ fi
+ done
+ fi
+
+ # Check for CUDA headers (essential for compilation) - using shared variable
+ local has_headers=false
+ for header_path in "${CUDA_HEADER_PATHS[@]}"; do
+ if [ -f "$header_path" ]; then
+ has_headers=true
+ break
+ fi
+ done
+
+ # Need both libraries and headers
+ if [ "$has_libraries" = true ] && [ "$has_headers" = true ]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+# Check what CUDA components we have and provide clear, non-confusing output
+echo "🔍 Checking CUDA installation..."
+
+
+# Function to handle non-Jetson ARM64 systems
+install_cuda_for_arm64() {
+ echo "🔧 Installing CUDA packages for ARM64 system..."
+
+ if sudo apt-get install -y cuda-cudart-dev-12-2 cuda-runtime-12-2 2>/dev/null || \
+ sudo apt-get install -y cuda-cudart-dev-11-8 cuda-runtime-11-8 2>/dev/null || \
+ sudo apt-get install -y libcudart-dev nvidia-cuda-runtime-cu12 2>/dev/null; then
+ echo "✅ CUDA runtime and development packages installed for ARM64!"
+ return 0
+ else
+ echo "❌ Failed to install CUDA packages for ARM64 system"
+ return 1
+ fi
+}
+
+# Function to handle x86_64 systems
+install_cuda_for_x86_64() {
+ echo "🔧 Installing CUDA packages for x86_64 system..."
+
+ # Detect CUDA version from nvidia-smi if available
+ local DETECTED_CUDA_VERSION=""
+ if command -v nvidia-smi &> /dev/null; then
+ DETECTED_CUDA_VERSION=$(nvidia-smi | grep "CUDA Version:" | sed 's/.*CUDA Version: \([0-9]\+\.[0-9]\+\).*/\1/' | head -n1)
+ if [ -n "$DETECTED_CUDA_VERSION" ]; then
+ echo "📍 Detected CUDA $DETECTED_CUDA_VERSION from nvidia-smi"
+ fi
+ fi
+
+ # Check if NVIDIA CUDA repository is configured
+ local has_cuda_repo=false
+ if [ -f /etc/apt/sources.list.d/cuda*.list ] || \
+ grep -r "developer.download.nvidia.com/compute/cuda" /etc/apt/sources.list* &>/dev/null; then
+ has_cuda_repo=true
+ fi
+
+ # Add NVIDIA CUDA repository if not present
+ if [ "$has_cuda_repo" = false ]; then
+ echo "📦 NVIDIA CUDA repository not found, adding it now..."
+
+ # Detect Ubuntu version for correct repository
+ local ubuntu_version=""
+ if [ "$OS_ID" = "Ubuntu" ]; then
+ case "$OS_VERSION" in
+ 22.04)
+ ubuntu_version="ubuntu2204"
+ ;;
+ 20.04)
+ ubuntu_version="ubuntu2004"
+ ;;
+ 24.04)
+ ubuntu_version="ubuntu2404"
+ ;;
+ *)
+ # Default to 22.04 for unknown versions
+ ubuntu_version="ubuntu2204"
+ echo "⚠️ Ubuntu $OS_VERSION detected, using ubuntu2204 repository (may need adjustment)"
+ ;;
+ esac
+ else
+ ubuntu_version="ubuntu2204"
+ echo "⚠️ Non-Ubuntu system detected, using ubuntu2204 repository (may not work)"
+ fi
+
+ # Download and install CUDA keyring
+ local cuda_keyring_url="https://developer.download.nvidia.com/compute/cuda/repos/${ubuntu_version}/x86_64/cuda-keyring_1.1-1_all.deb"
+
+ if [ -f /tmp/cuda-keyring.deb ]; then
+ rm /tmp/cuda-keyring.deb
+ fi
+
+ echo "📥 Downloading CUDA repository keyring for $ubuntu_version..."
+ if wget -q "$cuda_keyring_url" -O /tmp/cuda-keyring.deb 2>/dev/null; then
+ if sudo dpkg -i /tmp/cuda-keyring.deb 2>/dev/null; then
+ echo "✅ NVIDIA CUDA repository keyring installed"
+ # Force apt-get update after adding new repository
+ echo "🔄 Updating package cache with new CUDA repository..."
+ sudo apt-get update
+ has_cuda_repo=true
+ else
+ echo "⚠️ Failed to install CUDA keyring"
+ fi
+ rm -f /tmp/cuda-keyring.deb
+ else
+ echo "⚠️ Failed to download CUDA keyring from $cuda_keyring_url"
+ fi
+
+ # If keyring install failed, provide manual instructions
+ if [ "$has_cuda_repo" = false ]; then
+ echo ""
+ echo "⚠️ Automatic CUDA repository setup failed. Please add it manually:"
+ echo " wget https://developer.download.nvidia.com/compute/cuda/repos/${ubuntu_version}/x86_64/cuda-keyring_1.1-1_all.deb"
+ echo " sudo dpkg -i cuda-keyring_1.1-1_all.deb"
+ echo " sudo apt-get update"
+ echo ""
+ fi
+ else
+ echo "✅ NVIDIA CUDA repository already configured"
+ fi
+
+ # Try to install CUDA packages - prioritize detected version
+ local cuda_installed=false
+
+ if [ -n "$DETECTED_CUDA_VERSION" ]; then
+ # Convert version like "12.4" to package suffix like "12-4"
+ local version_suffix=$(echo "$DETECTED_CUDA_VERSION" | sed 's/\./-/')
+ echo "🎯 Attempting to install CUDA $DETECTED_CUDA_VERSION packages..."
+
+ # IMPORTANT: We need BOTH cuda-compiler (for complete headers) AND cuda-cudart-dev (for runtime)
+ # Try to install both together first
+ echo "📦 Installing cuda-compiler-${version_suffix} and cuda-cudart-dev-${version_suffix}..."
+ if sudo apt-get install -y cuda-compiler-${version_suffix} cuda-cudart-dev-${version_suffix}; then
+ echo "✅ CUDA $DETECTED_CUDA_VERSION compiler and runtime development packages installed!"
+ cuda_installed=true
+ else
+ # If combined install fails, try separately
+ echo "⚠️ Combined install failed, trying packages separately..."
+ local compiler_installed=false
+ local cudart_installed=false
+
+ if sudo apt-get install -y cuda-compiler-${version_suffix}; then
+ echo "✅ cuda-compiler-${version_suffix} installed"
+ compiler_installed=true
+ else
+ echo "❌ Failed to install cuda-compiler-${version_suffix}"
+ fi
+
+ if sudo apt-get install -y cuda-cudart-dev-${version_suffix}; then
+ echo "✅ cuda-cudart-dev-${version_suffix} installed"
+ cudart_installed=true
+ else
+ echo "❌ Failed to install cuda-cudart-dev-${version_suffix}"
+ fi
+
+ if [ "$compiler_installed" = true ] || [ "$cudart_installed" = true ]; then
+ if [ "$compiler_installed" = false ]; then
+ echo "⚠️ Warning: cuda-compiler not installed - headers may be incomplete!"
+ fi
+ if [ "$cudart_installed" = false ]; then
+ echo "⚠️ Warning: cuda-cudart-dev not installed - runtime dev files missing!"
+ fi
+ cuda_installed=true
+ fi
+ fi
+
+ # If version-specific install failed, try toolkit
+ if [ "$cuda_installed" = false ]; then
+ echo "📦 Trying cuda-toolkit-${version_suffix} as fallback..."
+ if sudo apt-get install -y cuda-toolkit-${version_suffix}; then
+ echo "✅ CUDA $DETECTED_CUDA_VERSION toolkit installed!"
+ cuda_installed=true
+ fi
+ fi
+ fi
+
+ # Fall back to trying various package names if version-specific install failed
+ if [ "$cuda_installed" = false ]; then
+ echo "🔄 Trying generic CUDA package installation..."
+
+ # List available CUDA packages for debugging
+ echo "🔍 Checking available CUDA packages..."
+ local available_cuda_pkgs=$(apt-cache search "^cuda-cudart-dev" 2>/dev/null | head -5)
+ if [ -n "$available_cuda_pkgs" ]; then
+ echo " Found packages:"
+ echo "$available_cuda_pkgs" | sed 's/^/ /'
+ fi
+
+ # Try installing with specific version numbers first, then fall back to generic
+ # Always try to get both compiler (for headers) and cudart-dev (for runtime)
+ if sudo apt-get install -y cuda-compiler-12-4 cuda-cudart-dev-12-4; then
+ echo "✅ CUDA 12.4 compiler and runtime development installed!"
+ cuda_installed=true
+ elif sudo apt-get install -y cuda-compiler-12-6 cuda-cudart-dev-12-6; then
+ echo "✅ CUDA 12.6 compiler and runtime development installed!"
+ cuda_installed=true
+ elif sudo apt-get install -y cuda-compiler-12-2 cuda-cudart-dev-12-2; then
+ echo "✅ CUDA 12.2 compiler and runtime development installed!"
+ cuda_installed=true
+ elif sudo apt-get install -y cuda-compiler-12-0 cuda-cudart-dev-12-0; then
+ echo "✅ CUDA 12.0 compiler and runtime development installed!"
+ cuda_installed=true
+ elif sudo apt-get install -y cuda-toolkit-12-4; then
+ echo "✅ CUDA 12.4 toolkit installed!"
+ cuda_installed=true
+ elif sudo apt-get install -y cuda-toolkit-12-6; then
+ echo "✅ CUDA 12.6 toolkit installed!"
+ cuda_installed=true
+ elif sudo apt-get install -y cuda-toolkit; then
+ echo "✅ CUDA toolkit (latest) installed!"
+ cuda_installed=true
+ elif sudo apt-get install -y cuda; then
+ echo "✅ CUDA (full package) installed!"
+ cuda_installed=true
+ fi
+ fi
+
+ if [ "$cuda_installed" = true ]; then
+ return 0
+ else
+ echo "❌ Failed to install CUDA packages for x86_64 system"
+ echo " 💡 You may need to manually install CUDA toolkit from:"
+ echo " https://developer.nvidia.com/cuda-downloads"
+ return 1
+ fi
+}
+
+# CUDA detection and installation - optimized for Jetson systems
+install_cuda_for_jetson() {
+ echo "🚀 Installing CUDA development packages for Jetson..."
+
+ # First, try to install CUDA development headers for existing CUDA installation
+ local success=false
+
+ # Check if we can install from JetPack repositories (try newer versions first)
+ if sudo apt-get install -y nvidia-jetpack-dev 2>/dev/null; then
+ echo "✅ JetPack development packages installed!"
+ success=true
+ elif sudo apt-get install -y cuda-toolkit-12-6-dev 2>/dev/null || \
+ sudo apt-get install -y cuda-toolkit-12-5-dev 2>/dev/null || \
+ sudo apt-get install -y cuda-toolkit-12-4-dev 2>/dev/null || \
+ sudo apt-get install -y cuda-toolkit-11-4-dev 2>/dev/null || \
+ sudo apt-get install -y cuda-toolkit-10-2-dev 2>/dev/null; then
+ echo "✅ CUDA toolkit development packages installed!"
+ success=true
+ elif sudo apt-get install -y cuda-compiler-12-6 cuda-cudart-dev-12-6 2>/dev/null || \
+ sudo apt-get install -y cuda-compiler-12-5 cuda-cudart-dev-12-5 2>/dev/null || \
+ sudo apt-get install -y cuda-compiler-12-4 cuda-cudart-dev-12-4 2>/dev/null || \
+ sudo apt-get install -y cuda-compiler-11-4 cuda-cudart-dev-11-4 2>/dev/null || \
+ sudo apt-get install -y cuda-compiler-10-2 cuda-cudart-dev-10-2 2>/dev/null; then
+ echo "✅ CUDA compiler and runtime dev packages installed!"
+ success=true
+ else
+ # Try generic packages that might work
+ echo "⚠️ Jetson-specific packages not found. Trying generic CUDA packages..."
+ if sudo apt-get install -y cuda-cudart-dev libcuda1-dev 2>/dev/null || \
+ sudo apt-get install -y cuda-toolkit 2>/dev/null; then
+ echo "✅ Generic CUDA development packages installed!"
+ success=true
+ fi
+ fi
+
+ # If all else fails, try to create symlinks to existing CUDA installation
+ if [ "$success" = false ]; then
+ echo "⚠️ Package installation failed. Trying to link existing CUDA installation..."
+
+ # Find existing CUDA installation (using shared variable)
+ for cuda_dir in "${CUDA_PATHS[@]}"; do
+ if [ -d "$cuda_dir/include" ]; then
+ echo "📍 Found CUDA at $cuda_dir, creating development symlinks..."
+ sudo mkdir -p /usr/include/cuda
+ sudo ln -sf $cuda_dir/include/* /usr/include/cuda/ 2>/dev/null || true
+ sudo ln -sf $cuda_dir/include/cuda_runtime.h /usr/include/ 2>/dev/null || true
+ echo "✅ CUDA headers linked successfully!"
+ success=true
+ break
+ fi
+ done
+ fi
+
+ return $([ "$success" = true ] && echo 0 || echo 1)
+}
+
+# Check CUDA installation status
+if check_cuda_toolkit; then
+ if command -v nvcc &> /dev/null; then
+ CUDA_VERSION=$(nvcc --version | grep "release" | sed 's/.*release \([0-9]\+\.[0-9]\+\).*/\1/')
+ echo "✅ CUDA Toolkit found: nvcc version $CUDA_VERSION"
+ else
+ # Found in custom path - add to PATH suggestion (using shared variable)
+ for cuda_path in "${CUDA_PATHS[@]}"; do
+ if [ -f "$cuda_path/bin/nvcc" ]; then
+ CUDA_VERSION=$($cuda_path/bin/nvcc --version | grep "release" | sed 's/.*release \([0-9]\+\.[0-9]\+\).*/\1/' 2>/dev/null || echo "unknown")
+ echo "✅ CUDA Toolkit found at: $cuda_path (version $CUDA_VERSION)"
+ echo " 💡 Consider adding $cuda_path/bin to your PATH"
+ break
+ fi
+ done
+ fi
+
+ # Even with toolkit found, verify runtime libraries and headers are available
+ echo "🔍 Verifying CUDA runtime libraries and headers are complete..."
+ if check_cuda_runtime; then
+ echo "✅ CUDA toolkit is complete with runtime libraries and headers!"
+ else
+ echo "⚠️ CUDA toolkit found but runtime libraries/headers missing!"
+
+ if [ "$IS_JETSON" = true ]; then
+ echo "🤖 Installing missing CUDA runtime development packages for Jetson..."
+ if install_cuda_for_jetson; then
+ echo "✅ Jetson CUDA runtime packages installed successfully!"
+ else
+ echo "❌ Jetson CUDA runtime installation failed"
+ echo " 💡 System may already have working CUDA runtime"
+ fi
+ fi
+ fi
+elif check_cuda_runtime; then
+ echo "✅ CUDA runtime libraries and headers found (sufficient for this project!)"
+ echo " ℹ️ Full toolkit not detected, but runtime + headers are all you need"
+else
+ # CUDA components missing - install them
+ echo "⚠️ CUDA components missing or incomplete. Installing CUDA runtime libraries..."
+
+ if [ "$IS_JETSON" = true ]; then
+ echo "🤖 Installing CUDA runtime development packages for Jetson..."
+ update_package_cache
+
+ # Install CUDA runtime development packages for Jetson
+ if sudo apt install -y cuda-cudart-dev-12-6 cuda-headers-12-6 2>/dev/null; then
+ echo "✅ CUDA 12.6 development packages installed!"
+ elif sudo apt install -y cuda-cudart-dev cuda-toolkit-12-6 2>/dev/null; then
+ echo "✅ CUDA development packages installed!"
+ elif sudo apt install -y libcudart-dev cuda-toolkit 2>/dev/null; then
+ echo "✅ Generic CUDA development packages installed!"
+ else
+ echo "❌ Failed to install CUDA development packages"
+ echo " Try manually: sudo apt install -y cuda-cudart-dev-12-6"
+ fi
+ else
+ # Non-Jetson installation logic (existing)
+ if [[ "$ARCH" == "aarch64" ]]; then
+ install_cuda_for_arm64
+ elif [[ "$ARCH" == "x86_64" ]]; then
+ install_cuda_for_x86_64
+ fi
+ fi
+
+ # Verify CUDA is now available
+ echo "🔍 Verifying CUDA installation after package installation..."
+ if check_cuda_runtime; then
+ echo "✅ CUDA runtime and headers now available!"
+ else
+ echo "❌ CUDA verification still failing - manual intervention may be needed"
+ fi
+fi
+
+# Initialize Git LFS
+echo "📁 Setting up Git LFS..."
+if git lfs install --force 2>/dev/null; then
+ echo "✅ Git LFS hooks installed successfully"
+else
+ echo "⚠️ Git LFS hook installation had issues, trying manual resolution..."
+ # Try to update existing hooks
+ if git lfs update --force 2>/dev/null; then
+ echo "✅ Git LFS hooks updated successfully"
+ else
+ echo "⚠️ Git LFS hooks may need manual attention"
+ echo " You can run 'git lfs update --force' later if needed"
+ fi
+fi
+
+echo ""
+echo "🎉 System dependencies installation complete!"
+echo ""
+
+if [ "$IS_JETSON" = true ]; then
+ echo "🤖 Jetson-specific setup completed!"
+ echo ""
+ echo "📋 Next steps for Jetson system:"
+ echo " 1. Ensure TensorRT is available (usually pre-installed with JetPack)"
+ echo " 2. Run 'source scripts/setup_env.sh' to configure paths for Jetson"
+ echo " 3. Run 'just build' to build the project"
+ echo ""
+ echo "💡 Jetson tips:"
+ echo " - CUDA is typically pre-installed at /usr/local/cuda-12.6, /usr/local/cuda-11.4 or /usr/local/cuda-10.2"
+ echo " - TensorRT is usually available at /usr/lib/aarch64-linux-gnu/"
+ echo " - If build fails, you may need to install JetPack SDK development components"
+ echo " - Monitor system temperature during compilation (use 'tegrastats')"
+ echo " - For CUDA 12.6 systems, ensure you have the latest JetPack SDK Manager"
+ echo ""
+
+ # Install JetPack for Jetson systems (includes all DLA libraries)
+ echo "🔧 Installing JetPack for complete Jetson development environment..."
+
+ update_package_cache
+
+ if sudo apt install -y nvidia-jetpack; then
+ echo "✅ JetPack installed successfully - includes all DLA libraries!"
+ echo " This resolves all TensorRT DLA dependencies"
+ else
+ echo "⚠️ JetPack installation failed (may have version conflicts)"
+ echo " 💡 Try: sudo apt update && sudo apt install -y nvidia-jetpack"
+ echo " 🔄 If issues persist, build should still work with existing libraries"
+ fi
+else
+ # Non-Jetson systems
+ echo "📋 Next steps for $ARCH system:"
+echo " 1. Make sure TensorRT is installed and TensorRT_ROOT is set"
+echo " 2. Run 'source scripts/setup_env.sh' to set up the environment"
+echo " 3. Run 'just build' to build the project"
+echo ""
+
+ if [[ "$ARCH" == "aarch64" ]]; then
+ echo "💡 ARM64 tips:"
+ echo " - CUDA may be installed at /usr/local/cuda or system locations"
+ echo " - TensorRT typically installed via package manager"
+ echo " - DLA libraries not needed on non-Jetson ARM64 systems"
+ elif [[ "$ARCH" == "x86_64" ]]; then
+ echo "💡 x86_64 tips:"
+ echo " - CUDA typically at /usr/local/cuda or via CUDA toolkit"
+ echo " - TensorRT available from NVIDIA or package repositories"
+ echo " - Use nvidia-smi to check GPU compatibility"
+ echo " - DLA libraries typically not needed on desktop GPUs"
+ fi
+fi
+
+echo ""
+echo "⚠️ If you encounter any issues:"
+if [ "$IS_JETSON" = true ]; then
+ echo " 🤖 Jetson-specific troubleshooting:"
+ echo " - Check JetPack version: jetson_release"
+ echo " - Verify CUDA installation: ls -la /usr/local/cuda*"
+ echo " - Monitor resources: tegrastats"
+ echo " - For DLA linking errors: Install full JetPack SDK"
+ echo " - For help: https://developer.nvidia.com/embedded/jetpack"
+elif [[ "$ARCH" == "aarch64" ]]; then
+ echo " 🔧 ARM64 troubleshooting:"
+ echo " - Check CUDA: ls -la /usr/local/cuda*"
+ echo " - Verify libraries: ldconfig -p | grep cuda"
+ echo " - DLA errors: DLA not supported on non-Jetson ARM64"
+elif [[ "$ARCH" == "x86_64" ]]; then
+ echo " 🖥️ x86_64 troubleshooting:"
+ echo " - Check GPU: nvidia-smi"
+ echo " - Verify CUDA: nvcc --version"
+ echo " - Check environment: echo \$CUDA_HOME \$TensorRT_ROOT"
+ echo " - DLA errors: DLA typically not supported on desktop GPUs"
+else
+ echo " - Check that all environment variables are set correctly"
+ echo " - Verify CUDA installation for your architecture"
+fi
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/install_ros2_humble.sh b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/install_ros2_humble.sh
new file mode 100644
index 0000000000000000000000000000000000000000..b0aba5f569a44daac673b601776708980ffd827c
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/install_ros2_humble.sh
@@ -0,0 +1,163 @@
+#!/bin/bash
+
+set -e
+
+echo "🤖 Installing ROS2 Humble..."
+
+# Detect system type and architecture
+ARCH=$(uname -m)
+OS_ID=$(lsb_release -si 2>/dev/null || echo "Unknown")
+OS_VERSION=$(lsb_release -sr 2>/dev/null || echo "Unknown")
+
+echo "🔍 System: $OS_ID $OS_VERSION ($ARCH)"
+
+# Check if running Ubuntu (ROS2 Humble officially supports Ubuntu 22.04)
+if [ "$OS_ID" != "Ubuntu" ]; then
+ echo "⚠️ Warning: ROS2 Humble is officially supported on Ubuntu 22.04 (Jammy Jellyfish)"
+ echo " Your system ($OS_ID $OS_VERSION) may have compatibility issues"
+ read -p "Continue anyway? (y/N) " -n 1 -r
+ echo
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
+ exit 1
+ fi
+fi
+
+if [ "$OS_VERSION" != "22.04" ] && [ "$OS_ID" = "Ubuntu" ]; then
+ echo "⚠️ Warning: ROS2 Humble is officially supported on Ubuntu 22.04"
+ echo " Your version ($OS_VERSION) may have compatibility issues"
+ read -p "Continue anyway? (y/N) " -n 1 -r
+ echo
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
+ exit 1
+ fi
+fi
+
+
+
+# Set locale
+echo "🌍 Setting up locale..."
+sudo apt-get update
+sudo apt-get install -y locales
+sudo locale-gen en_US en_US.UTF-8
+sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
+export LANG=en_US.UTF-8
+
+echo "✅ Locale configured"
+
+# Enable Ubuntu Universe repository
+echo "📦 Enabling Ubuntu Universe repository..."
+sudo apt-get install -y software-properties-common
+sudo add-apt-repository universe -y
+
+# Add ROS2 GPG key
+echo "🔑 Adding ROS2 GPG key..."
+sudo apt-get update
+sudo apt-get install -y curl gnupg lsb-release
+
+if [ ! -f /usr/share/keyrings/ros-archive-keyring.gpg ]; then
+ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
+ echo "✅ ROS2 GPG key added"
+else
+ echo "✅ ROS2 GPG key already exists"
+fi
+
+# Add ROS2 repository to sources list
+echo "📋 Adding ROS2 repository..."
+ROS2_LIST="/etc/apt/sources.list.d/ros2.list"
+
+if [ ! -f "$ROS2_LIST" ]; then
+ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee $ROS2_LIST > /dev/null
+ echo "✅ ROS2 repository added"
+else
+ echo "✅ ROS2 repository already configured"
+fi
+
+# Update apt cache
+echo "🔄 Updating package cache..."
+sudo apt-get update
+
+# Upgrade packages (optional but recommended)
+echo "⬆️ Upgrading packages..."
+sudo apt-get upgrade -y
+
+# Install ROS2 Humble Desktop (full installation with GUI tools)
+echo "📦 Installing ROS2 Humble Desktop..."
+echo " This may take several minutes..."
+
+if sudo apt-get install -y ros-humble-desktop; then
+ echo "✅ ROS2 Humble Desktop installed successfully!"
+else
+ echo "❌ Failed to install ROS2 Humble Desktop"
+ echo " Trying ROS2 Humble Base instead..."
+ if sudo apt-get install -y ros-humble-ros-base; then
+ echo "✅ ROS2 Humble Base installed successfully!"
+ else
+ echo "❌ Failed to install ROS2 Humble"
+ exit 1
+ fi
+fi
+
+# Install development tools
+echo "🔧 Installing ROS2 development tools..."
+sudo apt-get install -y \
+ ros-dev-tools \
+ python3-colcon-common-extensions \
+ python3-rosdep \
+ python3-vcstool \
+ python3-argcomplete
+
+echo "✅ Development tools installed"
+
+# Initialize rosdep
+echo "🔧 Initializing rosdep..."
+if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then
+ sudo rosdep init
+ echo "✅ rosdep initialized"
+else
+ echo "✅ rosdep already initialized"
+fi
+
+rosdep update
+echo "✅ rosdep updated"
+
+# Set up environment
+echo "🌱 Setting up ROS2 environment..."
+
+SETUP_SCRIPT="/opt/ros/humble/setup.bash"
+BASHRC="$HOME/.bashrc"
+
+# Check if ROS2 sourcing is already in .bashrc
+if ! grep -q "source $SETUP_SCRIPT" "$BASHRC"; then
+ echo "" >> "$BASHRC"
+ echo "# ROS2 Humble setup" >> "$BASHRC"
+ echo "source $SETUP_SCRIPT" >> "$BASHRC"
+ echo "✅ Added ROS2 Humble to .bashrc"
+else
+ echo "✅ ROS2 Humble already in .bashrc"
+fi
+
+# Source ROS2 setup for current session
+source $SETUP_SCRIPT
+
+echo ""
+echo "🎉 ROS2 Humble installation complete!"
+echo ""
+echo "📋 Installation Summary:"
+echo " - ROS2 Humble Desktop: Installed"
+echo " - Development tools: Installed"
+echo " - rosdep: Initialized and updated"
+echo " - Environment: Configured in ~/.bashrc"
+echo ""
+echo "🚀 Next steps:"
+echo " 1. Open a new terminal or run: source ~/.bashrc"
+echo " 2. Verify installation: ros2 --help"
+echo " 3. Test with: ros2 run demo_nodes_cpp talker"
+echo ""
+echo "📚 Useful commands:"
+echo " - Check ROS2 version: ros2 --version"
+echo " - List available packages: ros2 pkg list"
+echo " - Create a workspace: mkdir -p ~/ros2_ws/src && cd ~/ros2_ws && colcon build"
+echo ""
+echo "📖 Documentation: https://docs.ros.org/en/humble/"
+echo ""
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/restore_ubuntu_sources.sh b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/restore_ubuntu_sources.sh
new file mode 100644
index 0000000000000000000000000000000000000000..c62b475a44032978de11cf095fb3245d98d79203
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/restore_ubuntu_sources.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+# Script to restore official Ubuntu repositories
+# Removes Tsinghua University mirrors and restores official sources
+
+echo "Creating backup of current sources.list..."
+sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup.$(date +%Y%m%d_%H%M%S)
+
+echo "Restoring official Ubuntu repositories for Ubuntu 22.04 (Jammy) ARM64..."
+
+# Create new sources.list with official repositories
+sudo tee /etc/apt/sources.list > /dev/null << 'SOURCES'
+# Official Ubuntu repositories for ARM64 (ports.ubuntu.com)
+deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted
+deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted
+deb http://ports.ubuntu.com/ubuntu-ports/ jammy universe
+deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates universe
+deb http://ports.ubuntu.com/ubuntu-ports/ jammy multiverse
+deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates multiverse
+deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
+deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted
+deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security universe
+deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security multiverse
+
+# Source repositories (uncomment if you need source packages)
+# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted
+# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted
+# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy universe
+# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates universe
+# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy multiverse
+# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates multiverse
+# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
+# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted
+# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security universe
+# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security multiverse
+SOURCES
+
+echo "Updated sources.list with official Ubuntu repositories"
+echo "Updating package lists..."
+sudo apt update
+
+echo "Done! Ubuntu repositories restored to official sources."
+echo "Backup saved as: /etc/apt/sources.list.backup.$(date +%Y%m%d_%H%M%S)"
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/setup_env.sh b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/setup_env.sh
new file mode 100644
index 0000000000000000000000000000000000000000..842efa5699f7329a3e067182040a7ec571fee35a
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/setup_env.sh
@@ -0,0 +1,351 @@
+#!/bin/bash
+
+# Environment setup script to replace shell.nix functionality
+# Source this file: source scripts/setup_env.sh
+
+echo "🔧 Setting up G1 Deploy environment..."
+
+# Run jetson_clocks on Jetson systems (bare-metal only)
+if command -v jetson_clocks &> /dev/null; then
+ if [ -f "/.dockerenv" ]; then
+ # Inside Docker - skip (jetson_clocks needs host access)
+ echo "ℹ️ Inside Docker - jetson_clocks should be run on host"
+ else
+ # Bare-metal Jetson - set max performance
+ echo "🚀 Setting Jetson to max performance..."
+ sudo jetson_clocks 2>/dev/null || echo "⚠️ jetson_clocks failed (needs sudo)"
+ fi
+fi
+
+# Detect system architecture for platform-specific setup
+ARCH=$(uname -m)
+
+# Set up ONNX Runtime environment - check multiple possible locations
+ONNX_RUNTIME_PATHS=(
+ "/opt/onnxruntime"
+ "/usr/local/onnxruntime"
+ "/usr/lib/onnxruntime"
+ "$HOME/.local/onnxruntime"
+ "/opt/intel/openvino/runtime/3rdparty/onnx_runtime"
+)
+
+ONNX_FOUND=false
+for path in "${ONNX_RUNTIME_PATHS[@]}"; do
+ if [ -d "$path" ]; then
+ export onnxruntime_DIR="$path/lib/cmake/onnxruntime"
+ echo "✅ ONNX Runtime found at: $path"
+ ONNX_FOUND=true
+ break
+ fi
+done
+
+if [ "$ONNX_FOUND" = false ]; then
+ # Try to use system package manager installation
+ if pkg-config --exists libonnxruntime 2>/dev/null; then
+ echo "✅ ONNX Runtime found via system package manager"
+ else
+ echo "⚠️ ONNX Runtime not found in common locations:"
+ printf " %s\n" "${ONNX_RUNTIME_PATHS[@]}"
+ echo " Please run scripts/install_deps.sh or install ONNX Runtime manually"
+ fi
+fi
+
+# Auto-detect system architecture and library paths for different distributions
+DISTRO_ID=""
+
+# Detect Linux distribution
+if [ -f /etc/os-release ]; then
+ DISTRO_ID=$(grep "^ID=" /etc/os-release | cut -d'=' -f2 | tr -d '"')
+elif [ -f /etc/redhat-release ]; then
+ DISTRO_ID="rhel"
+elif [ -f /etc/debian_version ]; then
+ DISTRO_ID="debian"
+fi
+
+# Set system library directory based on distribution and architecture
+case "$DISTRO_ID" in
+ ubuntu|debian|linuxmint)
+ # Debian-based distributions use multiarch paths
+ if [ "$ARCH" = "x86_64" ]; then
+ SYSTEM_LIB_DIR="/usr/lib/x86_64-linux-gnu"
+ elif [ "$ARCH" = "aarch64" ]; then
+ SYSTEM_LIB_DIR="/usr/lib/aarch64-linux-gnu"
+ else
+ SYSTEM_LIB_DIR="/usr/lib"
+ fi
+ ;;
+ fedora|rhel|centos|rocky|almalinux)
+ # Red Hat-based distributions typically use lib64 for 64-bit
+ if [[ "$ARCH" == "x86_64" || "$ARCH" == "aarch64" ]]; then
+ SYSTEM_LIB_DIR="/usr/lib64"
+ else
+ SYSTEM_LIB_DIR="/usr/lib"
+ fi
+ ;;
+ opensuse*|sles)
+ # SUSE distributions also use lib64
+ if [[ "$ARCH" == "x86_64" || "$ARCH" == "aarch64" ]]; then
+ SYSTEM_LIB_DIR="/usr/lib64"
+ else
+ SYSTEM_LIB_DIR="/usr/lib"
+ fi
+ ;;
+ arch|manjaro)
+ # Arch Linux uses standard lib structure
+ SYSTEM_LIB_DIR="/usr/lib"
+ ;;
+ *)
+ # Generic fallback - try to detect best path
+ if [ -d "/usr/lib/$ARCH-linux-gnu" ]; then
+ SYSTEM_LIB_DIR="/usr/lib/$ARCH-linux-gnu"
+ elif [ -d "/usr/lib64" ] && [[ "$ARCH" == "x86_64" || "$ARCH" == "aarch64" ]]; then
+ SYSTEM_LIB_DIR="/usr/lib64"
+ else
+ SYSTEM_LIB_DIR="/usr/lib"
+ fi
+ ;;
+esac
+
+echo "🔍 Detected: $DISTRO_ID on $ARCH, using library path: $SYSTEM_LIB_DIR"
+
+# Set up CMake paths - use dynamically detected paths
+CMAKE_PATHS="$SYSTEM_LIB_DIR/cmake"
+
+# Add ONNX Runtime path if we found one
+if [ -n "$onnxruntime_DIR" ]; then
+ ONNX_BASE_PATH=$(dirname $(dirname $onnxruntime_DIR)) # Remove /lib/cmake/onnxruntime to get base path
+ CMAKE_PATHS="$ONNX_BASE_PATH:$CMAKE_PATHS"
+fi
+
+export CMAKE_PREFIX_PATH="$CMAKE_PATHS:$CMAKE_PREFIX_PATH"
+export OPENSSL_ROOT_DIR="/usr"
+
+# ROS2 Environment Setup - dynamically find ROS2 installation
+ROS2_FOUND=false
+
+# Common ROS2 distributions in order of preference (newest first)
+ROS2_DISTROS=("jazzy" "iron" "humble" "galactic" "foxy" "eloquent" "dashing" "crystal")
+ROS2_INSTALL_PATHS=("/opt/ros" "/usr/local/ros" "$HOME/ros2_ws/install")
+
+for install_path in "${ROS2_INSTALL_PATHS[@]}"; do
+ if [ "$ROS2_FOUND" = true ]; then
+ break
+ fi
+
+ for distro in "${ROS2_DISTROS[@]}"; do
+ ros2_setup_file="$install_path/$distro/setup.bash"
+ if [ -f "$ros2_setup_file" ]; then
+ source "$ros2_setup_file"
+ export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
+ # Remove problematic system library path that conflicts with system GLIBC
+ export LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | tr ':' '\n' | grep -v "$SYSTEM_LIB_DIR" | tr '\n' ':' | sed 's/:$//')
+ echo "✅ ROS2 $distro found at $install_path/$distro - system manages all ROS2 dependencies"
+ export HAS_ROS2=1
+ export ROS_LOCALHOST_ONLY=1
+ ROS2_FOUND=true
+ break
+ fi
+ done
+done
+
+if [ "$ROS2_FOUND" = false ]; then
+ echo "⚠️ ROS2 not found in common locations:"
+ printf " %s/\n" "${ROS2_INSTALL_PATHS[@]}"
+ echo " Install ROS2 system-wide for ROS2InputHandler support"
+ echo " Building will continue without ROS2InputHandler"
+ export HAS_ROS2=0
+fi
+
+# Set up production FastRTPS profile
+if [ -f "src/g1/g1_deploy_onnx_ref/config/fastrtps_profile.xml" ]; then
+ export FASTRTPS_DEFAULT_PROFILES_FILE="$(pwd)/src/g1/g1_deploy_onnx_ref/config/fastrtps_profile.xml"
+ echo "✅ FastRTPS production profile configured"
+fi
+
+# TensorRT Environment Setup
+# Check if TensorRT_ROOT is already set, if not try to load from .bashrc
+if [ -z "$TensorRT_ROOT" ] && [ -f "$HOME/.bashrc" ]; then
+ # Extract TensorRT_ROOT from .bashrc if it exists
+ BASHRC_TENSORRT=$(grep -o 'export TensorRT_ROOT=.*' "$HOME/.bashrc" | head -n1 | cut -d'=' -f2 | tr -d '"' | envsubst)
+ if [ -n "$BASHRC_TENSORRT" ]; then
+ export TensorRT_ROOT="$BASHRC_TENSORRT"
+ echo "📋 Loaded TensorRT_ROOT from ~/.bashrc: $TensorRT_ROOT"
+ fi
+fi
+
+if [ -n "$TensorRT_ROOT" ]; then
+ export LD_LIBRARY_PATH="$TensorRT_ROOT/lib:$LD_LIBRARY_PATH"
+ echo "✅ TensorRT environment configured"
+
+ # For Jetson systems, ensure DLA libraries are accessible for runtime
+ if [[ "$ARCH" == "aarch64" ]] && [[ -f "/etc/nv_tegra_release" || -d "/usr/src/jetson_multimedia_api" ]]; then
+ echo "🤖 Jetson system detected - setting up DLA library paths for runtime"
+
+ # Create missing libcudla.so.1 symlink if needed (TensorRT expects this name)
+ if [ -f "/usr/lib/aarch64-linux-gnu/nvidia/libnvcudla.so" ] && [ ! -f "/usr/lib/aarch64-linux-gnu/nvidia/libcudla.so.1" ]; then
+ echo " 🔗 Creating libcudla.so.1 symlink for TensorRT compatibility..."
+ sudo ln -sf libnvcudla.so /usr/lib/aarch64-linux-gnu/nvidia/libcudla.so.1 2>/dev/null || echo " ⚠️ Could not create symlink (may need sudo)"
+ sudo ln -sf libnvcudla.so /usr/lib/aarch64-linux-gnu/nvidia/libcudla.so 2>/dev/null || echo " ⚠️ Could not create symlink (may need sudo)"
+ echo " ✅ libcudla.so.1 → libnvcudla.so"
+ fi
+
+ # CRITICAL: Add DLA library path for runtime (this is why your executable can't run)
+ export LD_LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/nvidia:$LD_LIBRARY_PATH"
+ # Also add to LIBRARY_PATH so the build-time linker finds -lcudla here.
+ # GCC/ld doesn't search ldconfig paths for -l resolution by default; LIBRARY_PATH
+ # is the build-time analogue of LD_LIBRARY_PATH and feeds directly into -L search.
+ export LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/nvidia:${LIBRARY_PATH:-}"
+ echo " 📁 Added DLA library path to current session (runtime + build-time)"
+
+ # Make it persistent so you don't need to run setup_env.sh every time
+ if ! grep -q "/usr/lib/aarch64-linux-gnu/nvidia" ~/.bashrc 2>/dev/null; then
+ echo 'export LD_LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/nvidia:$LD_LIBRARY_PATH"' >> ~/.bashrc
+ echo " ✅ Added DLA library path to ~/.bashrc for future sessions"
+ fi
+
+ echo " ℹ️ Your executable should now be able to find DLA libraries at runtime"
+ fi
+else
+ echo "⚠️ TensorRT_ROOT is not set"
+ echo " Please install TensorRT and add 'export TensorRT_ROOT=/path/to/tensorrt' to your ~/.bashrc"
+ echo " Or source ~/.bashrc before running this script"
+fi
+
+# CUDA Environment Setup
+echo "🔧 Setting up CUDA environment..."
+
+# Function to detect and set CUDA toolkit root
+setup_cuda_toolkit() {
+ # Check if CUDAToolkit_ROOT is already set
+ if [ -n "$CUDAToolkit_ROOT" ] && [ -f "$CUDAToolkit_ROOT/bin/nvcc" ]; then
+ echo "✅ CUDA toolkit found: CUDAToolkit_ROOT already set to $CUDAToolkit_ROOT"
+ return 0
+ fi
+
+ # Check for nvcc in PATH first
+ if command -v nvcc &> /dev/null; then
+ NVCC_PATH=$(command -v nvcc)
+ CUDA_ROOT=$(dirname $(dirname "$NVCC_PATH"))
+ export CUDAToolkit_ROOT="$CUDA_ROOT"
+ echo "✅ CUDA toolkit found in PATH: $CUDAToolkit_ROOT"
+ return 0
+ fi
+
+ # Check common CUDA installation paths (including CUDA 12.6 for newer Jetson)
+ CUDA_PATHS=(
+ "/usr/local/cuda"
+ "/usr/local/cuda-12.6" # CUDA 12.6 on newer Jetson
+ "/usr/local/cuda-12.5" # CUDA 12.5 variant
+ "/usr/local/cuda-12.4" # CUDA 12.4 variant
+ "/usr/local/cuda-12"
+ "/usr/local/cuda-11.4" # Common on older Jetson
+ "/usr/local/cuda-11"
+ "/usr/local/cuda-10.2" # Common on older Jetson
+ "/usr/local/cuda-10"
+ "/opt/cuda"
+ "/usr/cuda"
+ )
+
+ for cuda_path in "${CUDA_PATHS[@]}"; do
+ if [ -f "$cuda_path/bin/nvcc" ]; then
+ export CUDAToolkit_ROOT="$cuda_path"
+ export CUDA_HOME="$cuda_path" # Alternative name CMake might use
+ export PATH="$cuda_path/bin:$PATH"
+ export LD_LIBRARY_PATH="$cuda_path/lib64:$cuda_path/lib:$LD_LIBRARY_PATH"
+ echo "✅ CUDA toolkit found at: $CUDAToolkit_ROOT"
+ echo " Added to PATH: $cuda_path/bin"
+ echo " Added CUDA libraries to LD_LIBRARY_PATH"
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+# Set up CUDA toolkit
+if setup_cuda_toolkit; then
+ # Add CUDA library paths
+ if [ -n "$CUDAToolkit_ROOT" ]; then
+ export LD_LIBRARY_PATH="$CUDAToolkit_ROOT/lib64:$CUDAToolkit_ROOT/lib:$LD_LIBRARY_PATH"
+
+ # For Jetson with CUDA 12.6+, also add the targets/aarch64-linux/lib path for libcudla
+ if [[ "$ARCH" == "aarch64" ]] && [ -d "$CUDAToolkit_ROOT/targets/aarch64-linux/lib" ]; then
+ export LD_LIBRARY_PATH="$CUDAToolkit_ROOT/targets/aarch64-linux/lib:$LD_LIBRARY_PATH"
+ echo " ✅ Added CUDA aarch64-linux libraries (includes libcudla for TensorRT DLA support)"
+ fi
+ fi
+else
+ echo "ℹ️ CUDA toolkit (nvcc) not found. This is OK - checking for runtime libraries..."
+ echo " Note: Full toolkit is preferred for development but runtime-only is sufficient for execution"
+fi
+
+# Set up CUDA runtime libraries (fallback)
+# Note: Only add nvidia path if we don't already have CUDA toolkit paths set up
+# This prevents conflicts where libnvcudla.so shadows the correct libcudla.so from CUDA toolkit
+if [ -z "$CUDAToolkit_ROOT" ] && [ -d "/usr/lib/aarch64-linux-gnu/nvidia/" ]; then
+ export LD_LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/nvidia/:$LD_LIBRARY_PATH"
+ echo "✅ CUDA runtime libraries found (aarch64)"
+elif [ -n "$CUDAToolkit_ROOT" ]; then
+ echo "✅ Using CUDA libraries from toolkit (prioritized over system runtime libs)"
+else
+ cuda_so_path=$(find /usr -name libcuda.so.1 2>/dev/null | head -n1)
+ if [ -n "$cuda_so_path" ]; then
+ export LD_PRELOAD="$cuda_so_path"
+ echo "✅ CUDA runtime library found at $cuda_so_path"
+ else
+ echo "========================================================================"
+ echo "⚠️ Warning: CUDA libraries not found. GPU functionality may be unavailable."
+ echo " Please install NVIDIA drivers and CUDA toolkit for GPU support."
+ echo "========================================================================"
+ fi
+fi
+
+# Add ONNX Runtime to library path if not already there
+if [ -d "/opt/onnxruntime/lib" ]; then
+ export LD_LIBRARY_PATH="/opt/onnxruntime/lib:$LD_LIBRARY_PATH"
+fi
+
+# Set up Git LFS (if not already done)
+if command -v git-lfs &> /dev/null; then
+ git lfs install &> /dev/null
+ echo "✅ Git LFS configured"
+
+ # Pull large files if in git repository
+ if [ -d ".git" ]; then
+ echo "📥 Pulling Git LFS files..."
+ git lfs pull
+ fi
+else
+ echo "⚠️ Git LFS not found. Please install git-lfs package."
+fi
+
+# Verify essential tools
+echo ""
+echo "🔍 Verifying essential tools:"
+
+check_command() {
+ if command -v "$1" &> /dev/null; then
+ echo "✅ $1: $(command -v $1)"
+ else
+ echo "❌ $1: not found"
+ fi
+}
+
+check_command cmake
+check_command clang
+check_command just
+check_command git
+
+echo ""
+echo "🎉 Environment setup complete!"
+echo ""
+echo "📝 You can now run:"
+echo " just build # Build the project"
+echo " just --list # See all available commands"
+echo ""
+
+# Optional: Add this setup to the current shell session persistence
+if [ -n "$BASH_VERSION" ]; then
+ export PS1="(g1_deploy) $PS1"
+fi
+
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/setup_wifi.sh b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/setup_wifi.sh
new file mode 100644
index 0000000000000000000000000000000000000000..186aa7cb82c0197f58f7273396480f589a4e1c3b
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/setup_wifi.sh
@@ -0,0 +1,265 @@
+#!/bin/bash
+
+echo "=== [WiFi Setup Script] Starting... ==="
+
+# WiFi network configuration (set via env or flags)
+# Usage:
+# WIFI_SSID="MyWifi" WIFI_PASSWORD="secret" WIFI_GATEWAY="192.168.x.x" ./setup_wifi.sh
+# ./setup_wifi.sh --ssid "MyWifi" --password "secret" --interface "wlan0" --gateway "192.168.x.x"
+WIFI_SSID="${WIFI_SSID:-}"
+WIFI_PASSWORD="${WIFI_PASSWORD:-}"
+CONNECTION_NAME="${CONNECTION_NAME:-}"
+WIFI_INTERFACE="${WIFI_INTERFACE:-}"
+FALLBACK_SSID="${FALLBACK_SSID:-}"
+
+usage() {
+ cat << 'USAGE_EOF'
+Usage: setup_wifi.sh [options]
+
+Options:
+ --ssid WiFi SSID (required)
+ --password WiFi password (required for secured networks)
+ --interface WiFi interface (optional; auto-detect if omitted)
+ --connection Connection profile name (optional; defaults to SSID)
+ --gateway Gateway IP (optional; sets route/DNS)
+ --fallback-ssid Fallback SSID (optional)
+ -h, --help Show this help
+
+You can also set environment variables:
+ WIFI_SSID, WIFI_PASSWORD, WIFI_INTERFACE, CONNECTION_NAME, FALLBACK_SSID, WIFI_GATEWAY,
+ ROUTE_CLEANUP_GW
+USAGE_EOF
+}
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ --ssid) WIFI_SSID="$2"; shift 2 ;;
+ --password) WIFI_PASSWORD="$2"; shift 2 ;;
+ --interface) WIFI_INTERFACE="$2"; shift 2 ;;
+ --connection) CONNECTION_NAME="$2"; shift 2 ;;
+ --fallback-ssid) FALLBACK_SSID="$2"; shift 2 ;;
+ --gateway) WIFI_GATEWAY="$2"; shift 2 ;;
+ -h|--help) usage; exit 0 ;;
+ *)
+ echo "[!] Unknown option: $1"
+ usage
+ exit 2
+ ;;
+ esac
+done
+
+if [ -z "$WIFI_SSID" ]; then
+ echo "[✗] Missing WiFi SSID. Provide --ssid or WIFI_SSID."
+ usage
+ exit 2
+fi
+
+if [ -z "$CONNECTION_NAME" ]; then
+ CONNECTION_NAME="$WIFI_SSID"
+fi
+
+if [ -z "$WIFI_INTERFACE" ]; then
+ WIFI_INTERFACE=$(nmcli -t -f DEVICE,TYPE device status | awk -F: '$2=="wifi"{print $1; exit}')
+fi
+
+if [ -z "$WIFI_INTERFACE" ]; then
+ echo "[✗] No WiFi interface detected. Provide --interface or WIFI_INTERFACE."
+ exit 2
+fi
+
+# Network configuration
+# If WIFI_GATEWAY is set, routing and DNS will be configured to use it.
+WIFI_GATEWAY="${WIFI_GATEWAY:-}"
+# Optional default gateway to remove from routing table.
+ROUTE_CLEANUP_GW="${ROUTE_CLEANUP_GW:-}"
+WIRED_CONNECTION="Wired connection 1"
+
+# Step 1: Unblock and enable WiFi
+echo "[1] Unblocking WiFi and enabling interface..."
+sudo rfkill unblock wifi
+sudo ip link set $WIFI_INTERFACE up
+
+# Step 2: Scan for networks to verify NetworkManager is working
+echo "[2] Scanning for WiFi networks..."
+sudo nmcli device wifi rescan
+sleep 3
+
+# Step 3: Check if the target network is visible
+echo "[3] Checking for '$WIFI_SSID' network..."
+if sudo nmcli device wifi list | grep -q "$WIFI_SSID"; then
+ echo "[✓] Network '$WIFI_SSID' found in scan"
+ # Try direct connection
+ echo "[4] Attempting direct connection to '$WIFI_SSID'..."
+ if [ -n "$WIFI_PASSWORD" ]; then
+ CONNECT_CMD=(sudo nmcli device wifi connect "$WIFI_SSID" password "$WIFI_PASSWORD")
+ else
+ CONNECT_CMD=(sudo nmcli device wifi connect "$WIFI_SSID")
+ fi
+ if "${CONNECT_CMD[@]}"; then
+ echo "[✓] Successfully connected directly"
+ CONNECTION_SUCCESS=true
+ else
+ echo "[!] Direct connection failed, trying manual profile method..."
+ CONNECTION_SUCCESS=false
+ fi
+else
+ echo "[!] Network '$WIFI_SSID' not found in scan (possibly hidden)"
+ CONNECTION_SUCCESS=false
+fi
+
+# Step 4: If direct connection failed or network not found, create manual connection profile
+if [ "$CONNECTION_SUCCESS" != "true" ]; then
+ echo "[4] Creating manual connection profile for '$WIFI_SSID'..."
+
+ # Remove existing connection profile if it exists
+ sudo nmcli connection delete "$CONNECTION_NAME" 2>/dev/null || true
+
+ # Create new connection profile
+ if [ -n "$WIFI_PASSWORD" ]; then
+ ADD_ARGS=(wifi-sec.key-mgmt wpa-psk wifi-sec.psk "$WIFI_PASSWORD")
+ else
+ ADD_ARGS=()
+ fi
+ if sudo nmcli connection add type wifi con-name "$CONNECTION_NAME" ifname "$WIFI_INTERFACE" ssid "$WIFI_SSID" "${ADD_ARGS[@]}"; then
+ echo "[✓] Connection profile created successfully"
+
+ echo "[5] Activating connection profile..."
+ if sudo nmcli connection up "$CONNECTION_NAME"; then
+ echo "[✓] Connection profile activated successfully"
+ CONNECTION_SUCCESS=true
+ else
+ echo "[✗] Failed to activate connection profile"
+ CONNECTION_SUCCESS=false
+ fi
+ else
+ echo "[✗] Failed to create connection profile"
+ CONNECTION_SUCCESS=false
+ fi
+fi
+
+# Step 5: Configure network routing priorities if connection successful
+if [ "$CONNECTION_SUCCESS" = "true" ]; then
+ echo "[5] Configuring network routing priorities..."
+
+ # Set WiFi connection to high priority (low metric)
+ echo " Setting WiFi connection priority to 100..."
+ sudo nmcli connection modify "$CONNECTION_NAME" ipv4.route-metric 100
+
+ # Set wired connection to very low priority (high metric)
+ echo " Setting wired connection priority to 30000..."
+ sudo nmcli connection modify "$WIRED_CONNECTION" ipv4.route-metric 30000 2>/dev/null || true
+
+ # Remove any problematic default routes
+ echo " Cleaning up routing table..."
+ if [ -n "$ROUTE_CLEANUP_GW" ]; then
+ sudo ip route del default via "$ROUTE_CLEANUP_GW" 2>/dev/null || true
+ fi
+
+ # Ensure WiFi route has highest priority
+ if [ -n "$WIFI_GATEWAY" ]; then
+ sudo ip route add default via "$WIFI_GATEWAY" dev "$WIFI_INTERFACE" metric 50 2>/dev/null || true
+
+ # Configure DNS to use router and public DNS
+ echo " Configuring DNS..."
+ sudo tee /etc/resolv.conf > /dev/null << DNS_EOF
+nameserver $WIFI_GATEWAY
+nameserver 8.8.8.8
+nameserver 1.1.1.1
+DNS_EOF
+ fi
+
+ echo "[✓] Network routing configured for WiFi priority"
+fi
+
+# Step 6: Verify connection status
+echo "[6] Checking connection status..."
+if [ "$CONNECTION_SUCCESS" = "true" ]; then
+ CURRENT_CONNECTION=$(nmcli device status | grep "$WIFI_INTERFACE" | awk '{print $4}')
+ if [[ "$CURRENT_CONNECTION" == "$CONNECTION_NAME" ]] || [[ "$CURRENT_CONNECTION" == "$WIFI_SSID" ]]; then
+ echo "[✓] Successfully connected to '$WIFI_SSID'"
+ echo " Interface: $WIFI_INTERFACE"
+ echo " Connection: $CURRENT_CONNECTION"
+ else
+ echo "[!] Connection status unclear"
+ CONNECTION_SUCCESS=false
+ fi
+fi
+
+# Step 7: Test internet connectivity
+if [ "$CONNECTION_SUCCESS" = "true" ]; then
+ echo "[7] Testing internet connectivity..."
+ MAX_RETRIES=3
+ COUNT=0
+ INTERNET_OK=false
+
+ while [ "$COUNT" -lt "$MAX_RETRIES" ]; do
+ if ping -c 2 -W 5 8.8.8.8 >/dev/null 2>&1; then
+ echo "[✓] Internet connectivity verified (ping test)"
+
+ # Also test DNS resolution
+ if curl -s --connect-timeout 5 -I http://google.com >/dev/null 2>&1; then
+ echo "[✓] DNS resolution and HTTP connectivity verified"
+ INTERNET_OK=true
+ break
+ else
+ echo "[!] DNS/HTTP test failed, but ping works. Retrying... ($((COUNT+1))/$MAX_RETRIES)"
+ fi
+ else
+ echo "[!] Internet test failed. Retrying... ($((COUNT+1))/$MAX_RETRIES)"
+ fi
+
+ sleep 3
+ ((COUNT++))
+ done
+
+ if [ "$INTERNET_OK" != "true" ]; then
+ echo "[!] Internet connectivity test failed after $MAX_RETRIES attempts"
+ CONNECTION_SUCCESS=false
+ fi
+fi
+
+# Step 8: Fallback to previous network if connection failed
+if [ "$CONNECTION_SUCCESS" != "true" ] && [ -n "$FALLBACK_SSID" ]; then
+ echo "[8] Connection to '$WIFI_SSID' failed. Attempting fallback to '$FALLBACK_SSID'..."
+
+ # Try to connect to fallback network
+ if sudo nmcli device wifi list | grep -q "$FALLBACK_SSID"; then
+ echo "[!] Attempting to connect to fallback network '$FALLBACK_SSID'..."
+ if sudo nmcli device wifi connect "$FALLBACK_SSID"; then
+ echo "[✓] Connected to fallback network '$FALLBACK_SSID'"
+
+ # Apply routing fixes for fallback network too
+ echo " Applying routing fixes for fallback network..."
+ if [ -n "$ROUTE_CLEANUP_GW" ]; then
+ sudo ip route del default via "$ROUTE_CLEANUP_GW" 2>/dev/null || true
+ fi
+ sudo nmcli connection modify "$WIRED_CONNECTION" ipv4.route-metric 30000 2>/dev/null || true
+ else
+ echo "[✗] Failed to connect to fallback network"
+ fi
+ else
+ echo "[!] Fallback network '$FALLBACK_SSID' not available"
+ fi
+fi
+
+# Step 9: Final status report
+echo "[9] Final WiFi status:"
+nmcli device status | grep wifi
+echo ""
+echo "Active connections:"
+nmcli connection show --active | head -5
+echo ""
+echo "Current routing table:"
+ip route show | head -5
+echo ""
+echo "DNS configuration:"
+cat /etc/resolv.conf | grep nameserver
+
+echo "=== [WiFi Setup Script] Completed ==="
+
+# Exit with appropriate code
+if [ "$CONNECTION_SUCCESS" = "true" ]; then
+ exit 0
+else
+ exit 1
+fi
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/CMakeLists.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..9471d2f33713ad47cdbff8bbe975258950b41b95
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_subdirectory(TRTInference)
+add_subdirectory(g1)
+add_subdirectory(audio_thread)
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/TRTInference/CMakeLists.txt b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/TRTInference/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..57077dbac705e5976493c3553513d7fa0f3a3686
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/TRTInference/CMakeLists.txt
@@ -0,0 +1,38 @@
+message(STATUS "blah = ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake")
+
+set(SRC_FILES
+ "InferenceEngine.cpp"
+ "InferenceEngine.h"
+ "InferenceEngine.inl"
+ "Utility.h"
+)
+
+source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC_FILES})
+
+add_library(TRTInference ${SRC_FILES})
+
+# Explicitly set C++ standard for this library
+set_target_properties(TRTInference PROPERTIES
+ CXX_STANDARD 20
+ CXX_STANDARD_REQUIRED ON
+ CXX_EXTENSIONS OFF
+)
+
+# Set up include directories
+set(CUDA_INCLUDES "")
+if(CUDAToolkit_FOUND)
+ set(CUDA_INCLUDES ${CUDAToolkit_INCLUDE_DIRS})
+elseif(CUDA_INCLUDE_DIR)
+ set(CUDA_INCLUDES ${CUDA_INCLUDE_DIR})
+endif()
+
+target_include_directories(TRTInference
+ PRIVATE ${PROJECT_SOURCE_DIR}/src
+ PRIVATE ${TensorRT_INCLUDE_DIRS}
+ PRIVATE ${CUDA_INCLUDES})
+
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
+ target_compile_options(TRTInference PRIVATE -Wno-deprecated-declarations -std=c++20)
+endif()
+
+target_link_libraries(TRTInference ${TensorRT_LIBRARIES} ${CUDA_LIBRARIES})
diff --git a/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/TRTInference/InferenceEngine.cpp b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/TRTInference/InferenceEngine.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..12435008cfed752e18946c8179b4e04bdee7af6a
--- /dev/null
+++ b/third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/TRTInference/InferenceEngine.cpp
@@ -0,0 +1,794 @@
+#include "InferenceEngine.h"
+#include "Log.h"
+#include "picosha2.h"
+
+#include
+#include
+#include
+#include
+#include