### Verify UnitreeCppEnv Installation Source: https://github.com/hansz8/robojudo/blob/release/docs/unitree_setup.md Run this command to verify the installation of the UnitreeCppEnv. If an error occurs, check the installation of unitree_sdk2 and unitree_cpp. ```bash python -c "from robojudo.environment import UnitreeCppEnv" ``` -------------------------------- ### Verify UnitreeEnv Installation Source: https://github.com/hansz8/robojudo/blob/release/docs/unitree_setup.md Run this command to verify the installation of the UnitreeEnv. If an error occurs, check the unitree_sdk2py installation. ```bash python -c "from robojudo.environment import UnitreeEnv" ``` -------------------------------- ### Install RoboJuDo Modules Source: https://github.com/hansz8/robojudo/blob/release/README.md Installs all required modules for RoboJuDo. Alternatively, specify individual modules to install using arguments. ```bash # Install all required modules python submodule_install.py # Or specify modules to install with args # python submodule_install.py unitree_cpp ``` -------------------------------- ### Install UnitreeCpp Submodule Source: https://github.com/hansz8/robojudo/blob/release/docs/unitree_setup.md Install the unitree_cpp package as a submodule within RoboJuDo. Ensure unitree_sdk2 is installed first. ```bash python submodule_install.py unitree_cpp ``` -------------------------------- ### Install RoboJuDo Source: https://github.com/hansz8/robojudo/blob/release/README.md Install RoboJuDo using pip. An optional step is included to install the CPU version of PyTorch for faster performance if a GPU is not available or preferred. ```bash # Optional, install cpu version for speed up pip install torch --index-url https://download.pytorch.org/whl/cpu pip install -e . ``` -------------------------------- ### Run RoboJuDo on Real Robot Source: https://github.com/hansz8/robojudo/blob/release/README.md Starts the RoboJuDo pipeline on a real robot, using the 'g1_real' configuration. Assumes the robot is on the ground and prepared. ```bash python scripts/run_pipeline.py -c g1_real ``` -------------------------------- ### KeyboardCtrl Example Ctrl Data Source: https://github.com/hansz8/robojudo/blob/release/docs/controller.md Example structure for keyboard control data, including key presses and releases with timestamps. Used by KeyboardCtrl. ```text [{'type': 'keyboard', 'name': 's', 'pressed': True, 'timestamp': 1758888074.643119}] ``` -------------------------------- ### KeyboardCtrl Hotkey Configuration Source: https://github.com/hansz8/robojudo/blob/release/docs/controller.md Configure custom hotkeys for KeyboardCtrl to trigger specific commands. This example shows mapping keys and key combinations to commands. ```python KeyboardCtrl( cfg_ctrl=KeyboardCtrlCfg( triggers_extra={ "Key.space": "[TEST]", "\x01": "[CTRL_A]", } ) ) ``` -------------------------------- ### JoystickCtrl Example Ctrl Data Source: https://github.com/hansz8/robojudo/blob/release/docs/controller.md Example structure for Xbox Joystick control data, including axes and button events. Used by JoystickCtrl. ```json {"axes": {"LeftX": 0.0, "LeftY": 0.0, "RightX": 0.0, "RightY": 0.0, "LT": 0.0, "RT": 0.0}, "button_event": [{"type": "button", "name": "A", "pressed": False, "timestamp": 1758886189.6776087}]} ``` -------------------------------- ### JoystickCtrl Hotkey Configuration Source: https://github.com/hansz8/robojudo/blob/release/docs/controller.md Configure custom hotkeys for JoystickCtrl to trigger specific commands. This example shows mapping button combinations to commands. ```python JoystickCtrlCfg( triggers_extra={ "RB+Down": "[POLICY_SWITCH],0", "LB+RB+A": "COMBO_TEST", } ), ``` -------------------------------- ### Run ProtoMotions Tracker Pipeline (Simulation) Source: https://github.com/hansz8/robojudo/blob/release/docs/policy.md Launches the ProtoMotions tracker pipeline for MuJoCo simulation. Specify the motion path and index. ```bash python scripts/run_tracker_pipeline.py -c g1_protomotions_tracker \ --motion-path assets/motions/g1/g1_bones_seed_mini.pt \ --motion-index 0 ``` -------------------------------- ### Run ProtoMotions Tracker Pipeline (Real Robot) Source: https://github.com/hansz8/robojudo/blob/release/docs/policy.md Launches the ProtoMotions tracker pipeline for real G1 robot deployment. Specify the motion path and index. ```bash python scripts/run_tracker_pipeline.py -c g1_protomotions_tracker_real \ --motion-path assets/motions/g1/g1_bones_seed_mini.pt \ --motion-index 0 ``` -------------------------------- ### Run ProtoMotions Tracker Pipeline Source: https://github.com/hansz8/robojudo/blob/release/README.md Execute the ProtoMotions tracker pipeline with specified motion path and index. ```bash python scripts/run_tracker_pipeline.py -c g1_protomotions_tracker \ --motion-path assets/motions/g1/g1_bones_seed_mini.pt \ --motion-index 0 ``` -------------------------------- ### Run ProtoMotions Tracker Pipeline with Custom ONNX Source: https://github.com/hansz8/robojudo/blob/release/docs/policy.md Launches the ProtoMotions tracker pipeline, allowing you to specify a custom ONNX path for your exported tracker. ```bash python scripts/run_tracker_pipeline.py -c g1_protomotions_tracker \ --motion-path assets/motions/g1/g1_bones_seed_mini.pt \ --motion-index 0 \ --onnx-path /path/to/unified_pipeline.onnx ``` -------------------------------- ### Deploy BeyondMimic and ASAP Policies Source: https://github.com/hansz8/robojudo/blob/release/README.md Launches RoboJuDo with the BeyondMimic and ASAP policies. These provide advanced policy options for robot control. ```bash python scripts/run_pipeline.py -c g1_beyondmimic python scripts/run_pipeline.py -c g1_asap ``` -------------------------------- ### Run RoboJuDo Simulation (Default) Source: https://github.com/hansz8/robojudo/blob/release/README.md Launches the default G1 simulation environment for RoboJuDo. Requires an Xbox controller for navigation. ```bash # run the default g1 sim2sim cfg python scripts/run_pipeline.py ``` -------------------------------- ### Configure UnitreeEnv for Real Robot Deployment (g1_real_env_cfg.py) Source: https://github.com/hansz8/robojudo/blob/release/docs/unitree_setup.md Update the global configuration for G1 in g1_real_env_cfg.py to specify the environment type and network interface for UnitreeEnv. ```python class G1RealEnvCfg(G1EnvCfg, UnitreeEnvCfg): env_type: str = UnitreeEnvCfg.model_fields["env_type"].default # ====== ENV CONFIGURATION ====== unitree: UnitreeEnvCfg.UnitreeCfg = UnitreeEnvCfg.UnitreeCfg( net_if="eth0", # EDIT HERE robot="g1", msg_type="hg", ) ``` -------------------------------- ### Run Loco-Mimic Pipeline Configurations Source: https://github.com/hansz8/robojudo/blob/release/README.md Execute the Loco-Mimic pipeline with specified configurations for beyond-mimic and ASAP scenarios. ```bash python scripts/run_pipeline.py -c g1_locomimic_beyondmimic ``` ```bash python scripts/run_pipeline.py -c g1_locomimic_asap ``` -------------------------------- ### Configure UnitreeEnv for Real Robot Deployment (g1_cfg.py) Source: https://github.com/hansz8/robojudo/blob/release/docs/unitree_setup.md Modify the g1_real configuration in g1_cfg.py to set the environment type and network interface for UnitreeEnv. ```python class g1_real(g1): env: G1RealEnvCfg = G1RealEnvCfg( env_type="UnitreeEnv", # For unitree_sdk2py # env_type="UnitreeCppEnv", # For unitree_cpp, check README for more details unitree=UnitreeEnvCfg.UnitreeCfg( net_if="eth0", # note: change to your network interface robot="g1", msg_type="hg", ), ) ``` -------------------------------- ### Run Multi-Policy Pipeline Source: https://github.com/hansz8/robojudo/blob/release/README.md Executes the RoboJuDo pipeline with the 'g1_switch' configuration, enabling multi-policy switching between Unitree and AMO policies using an Xbox controller. ```bash python scripts/run_pipeline.py -c g1_switch ``` -------------------------------- ### Configure Real Robot Environment Source: https://github.com/hansz8/robojudo/blob/release/README.md Python code snippet showing how to configure the environment for a real robot, specifically for the G1 model. It involves setting the environment type and network interface. ```python class g1_real(g1): env: G1RealEnvCfg = G1RealEnvCfg( env_type="UnitreeEnv", # For unitree_sdk2py # env_type="UnitreeCppEnv", # For unitree_cpp, check README for more details unitree=G1UnitreeCfg( net_if="eth0", # note: change to your network interface ), ) ``` -------------------------------- ### Clone Repository and Create Python Environment Source: https://github.com/hansz8/robojudo/blob/release/README.md Clone the RoboJuDo repository and set up a dedicated Conda environment for the project. This ensures dependency isolation. ```bash git clone https://github.com/HansZ8/RoboJuDo.git cd RoboJuDo/ # Example using conda conda create -n robojudo python=3.11 -y conda activate robojudo ``` -------------------------------- ### Configure MotionCtrl with G1MotionCtrlCfg Source: https://github.com/hansz8/robojudo/blob/release/docs/controller.md Use G1MotionCtrlCfg to configure MotionCtrl. Specify the motion_name to load a specific motion file. ```python G1MotionCtrlCfg( motion_name="amass_all", ) ``` -------------------------------- ### Configure BeyondMimicCtrl with G1BeyondmimicCtrlCfg Source: https://github.com/hansz8/robojudo/blob/release/docs/controller.md Use G1BeyondmimicCtrlCfg to configure BeyondMimicCtrl. The motion_name parameter is used when the policy's use_motion_from_model is set to False. ```python G1BeyondmimicCtrlCfg( motion_name="dance1_subject2", # only when policy: use_motion_from_model=False ) ``` -------------------------------- ### UnitreePolicy Command Generation Source: https://github.com/hansz8/robojudo/blob/release/docs/policy.md Generates movement commands for the robot using joystick or Unitree controller input. Maps joystick axes to forward/backward, left/right, and turning commands. ```python def _get_commands(self, ctrl_data: dict) -> list[float]: commands = np.zeros(3) for key in ctrl_data.keys(): if key in ["JoystickCtrl", "UnitreeCtrl"]: axes = ctrl_data[key]["axes"] lx, ly, rx, ry = axes["LeftX"], axes["LeftY"], axes["RightX"], axes["RightY"] commands[0] = command_remap(ly, self.commands_map[0]) commands[1] = command_remap(lx, self.commands_map[1]) commands[2] = command_remap(rx, self.commands_map[2]) break return commands ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.