### Install and Launch MuJoCo Viewer Source: https://github.com/project-instinct/instinctlab/blob/main/source/instinctlab/instinctlab/assets/resources/unitree_g1/README.md Installs the MuJoCo Python bindings and launches the MuJoCo viewer. Ensure you have Python and pip installed. ```bash pip install mujoco python -m mujoco.viewer ``` -------------------------------- ### Multi Reward Configuration Example Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md This configuration defines multiple reward terms and groups them for use with the MultiRewardManager. It includes imitation rewards, regularization rewards, and demonstrates how to structure reward groups for single or multi-critic RL setups. ```python from instinctlab.managers import MultiRewardCfg from isaaclab.managers import RewardTermCfg as RewTermCfg from isaaclab.managers import SceneEntityCfg from isaaclab.utils import configclass import instinctlab.envs.mdp as instinct_mdp import isaaclab.envs.mdp as mdp # Define individual reward terms @configclass class RewardsCfg: # Imitation rewards (motion matching) base_position_imitation_gauss = RewTermCfg( func=instinct_mdp.base_position_imitation_gauss, weight=0.5, params={"std": 0.3}, ) base_rot_imitation_gauss = RewTermCfg( func=instinct_mdp.base_rot_imitation_gauss, weight=0.5, params={"std": 0.4, "difference_type": "axis_angle"}, ) link_pos_imitation_gauss = RewTermCfg( func=instinct_mdp.link_pos_imitation_gauss, weight=1.0, params={ "combine_method": "mean_prod", "in_base_frame": False, "in_relative_world_frame": True, "std": 0.3, }, ) # Regularization rewards action_rate_l2 = RewTermCfg(func=mdp.action_rate_l2, weight=-0.1) joint_limit = RewTermCfg( func=mdp.joint_pos_limits, weight=-10.0, params={"asset_cfg": SceneEntityCfg("robot", joint_names=[".*"])}, ) undesired_contacts = RewTermCfg( func=mdp.undesired_contacts, weight=-0.1, params={ "sensor_cfg": SceneEntityCfg("contact_forces", body_names=[".*"]), "threshold": 1.0, }, ) # Define reward groups (must inherit from MultiRewardCfg) @configclass class RewardGroupsCfg(MultiRewardCfg): # Single reward group containing all terms rewards = RewardsCfg() # Optional: Define multiple groups for multi-critic RL # rewards_group_1 = RewardsCfg() # First critic # rewards_group_2 = RewardsCfg() # Second critic # In your environment configuration @configclass class EnvCfg(InstinctLabRLEnvCfg): rewards: RewardGroupsCfg = RewardGroupsCfg() # ... other configs ... ``` -------------------------------- ### Install pre-commit Source: https://github.com/project-instinct/instinctlab/blob/main/README.md Install the pre-commit package using pip. This is the first step to enable automatic code formatting. ```bash pip install pre-commit ``` -------------------------------- ### Training Configuration Setup Source: https://github.com/project-instinct/instinctlab/blob/main/source/instinctlab/instinctlab/tasks/shadowing/beyondmimic/README.md Imports and instantiates environment and agent configurations for training BeyondMimic policies. ```python from instinctlab.tasks.shadowing.beyondmimic.config.g1.beyondmimic_plane_cfg import G1BeyondMimicPlaneEnvCfg from instinctlab.tasks.shadowing.beyondmimic.config.g1.agents.beyondmimic_ppo_cfg import G1BeyondMimicPPORunnerCfg # Create environment configuration env_cfg = G1BeyondMimicPlaneEnvCfg() # Create agent configuration agent_cfg = G1BeyondMimicPPORunnerCfg() ``` -------------------------------- ### Install pre-commit hook Source: https://github.com/project-instinct/instinctlab/blob/main/README.md Set up pre-commit to automatically run on every commit. This command installs the necessary Git hooks. ```bash pre-commit install ``` -------------------------------- ### Install InstinctLab Library Source: https://github.com/project-instinct/instinctlab/blob/main/README.md Install the instinctlab library in editable mode using pip. This command should be run using a Python interpreter that has Isaac Lab installed. ```bash python -m pip install -e source/instinctlab ``` -------------------------------- ### Instantiate Noisy Grouped RayCaster Camera Configuration Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md Example of how to import and instantiate configuration classes for the Noisy Grouped RayCaster Camera and its base Grouped RayCaster. ```python from instinctlab.sensors import GroupedRayCasterCfg, NoisedGroupedRayCasterCameraCfg ``` -------------------------------- ### Reward Configuration Examples Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md Defines reward terms for tracking base position, imitating joint positions, and tracking shadowing commands. Ensure necessary imports are present. ```python from instinctlab.envs.mdp import RewTermCfg from isaaclab.managers import SceneEntityCfg import instinctlab.envs.mdp as instinct_mdp @configclass class RewardsCfg: # Tracking reward - checks timing base_position_tracking = RewTermCfg( func=instinct_mdp.base_position_tracking_gauss, params={ "asset_cfg": SceneEntityCfg("robot"), "reference_cfg": SceneEntityCfg("motion_reference"), "check_at_keyframe_threshold": -1, # Check at expected time "tracking_sigma": 0.2, }, ) # Imitation reward - checks every timestep joint_pos_imitation = RewTermCfg( func=instinct_mdp.joint_pos_imitation_gauss, params={ "asset_cfg": SceneEntityCfg("robot"), "reference_cfg": SceneEntityCfg("motion_reference"), "std": 0.7, "masked": True, # Only compute for unmasked joints }, ) # Shadowing command reward - tracks command only track_shadowing_cmd = RewTermCfg( func=instinct_mdp.track_pose_ref_shadowing_cmd_gauss, params={ "command_cfg": SceneEntityCfg("pose_ref_command"), "asset_cfg": SceneEntityCfg("robot"), }, ) ``` -------------------------------- ### Install Instinct-RL Library Source: https://github.com/project-instinct/instinctlab/blob/main/README.md Install the instinct_rl library in editable mode using pip. This makes the library available for use in your Python projects. ```bash python -m pip install -e instinct_rl ``` -------------------------------- ### CMakeLists.txt for Unitree G1 Description Source: https://github.com/project-instinct/instinctlab/blob/main/source/instinctlab/instinctlab/assets/resources/unitree_g1/CMakeLists.txt This snippet defines the CMake build system configuration for the Unitree G1 robot description package. It specifies the minimum CMake version, project name, and finds required ROS packages like catkin and roslaunch. It also includes directives for installing launch files and meshes. ```cmake cmake_minimum_required(VERSION 2.8.3) project(g1_description) find_package(catkin REQUIRED) catkin_package() find_package(roslaunch) foreach(dir launch meshes) install(DIRECTORY ${dir}/ DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/${dir}) endforeach(dir) ``` -------------------------------- ### Clone Instinct-RL Repository Source: https://github.com/project-instinct/instinctlab/blob/main/README.md Clone the instinct_rl repository to your local machine. This is a prerequisite for installing and using the instinct_rl library. ```bash git clone https://github.com/project-instinct/instinct_rl.git ``` -------------------------------- ### Register a new RL environment task Source: https://github.com/project-instinct/instinctlab/blob/main/README.md Example of registering a new reinforcement learning environment task using gymnasium. It specifies the entry point for the environment and configuration. ```python import gymnasium as gym from . import agents task_entry = "instinctlab.tasks.shadowing.perceptive.config.g1" gym.register( id="Instinct-Perceptive-Shadowing-G1-Play-v0", entry_point="instinctlab.envs:InstinctRlEnv", disable_env_checker=True, kwargs={ "env_cfg_entry_point": f"{__name__}.perceptive_shadowing_cfg:G1PerceptiveShadowingEnvCfg_PLAY", "instinct_rl_cfg_entry_point": f"{agents.__name__}.instinct_rl_ppo_cfg:G1PerceptiveShadowingPPORunnerCfg", }, ) ``` -------------------------------- ### Clone InstinctLab Repository (HTTPS) Source: https://github.com/project-instinct/instinctlab/blob/main/README.md Clone the instinctlab repository using HTTPS. Ensure this is done separately from the Isaac Lab installation directory. ```bash git clone https://github.com/project-instinct/instinctlab.git ``` -------------------------------- ### Clone InstinctLab Repository (SSH) Source: https://github.com/project-instinct/instinctlab/blob/main/README.md Clone the instinctlab repository using SSH. Ensure this is done separately from the Isaac Lab installation directory. ```bash git clone git@github.com:project-instinct/instinctlab.git ``` -------------------------------- ### Play Perceptive Shadowing Policy (PPO) Source: https://github.com/project-instinct/instinctlab/blob/main/source/instinctlab/instinctlab/tasks/shadowing/README.md Use this command to play a trained Perceptive shadowing policy using PPO. A 'load_run' name is required to load a checkpoint. ```bash # PPO version python source/instinctlab/instinctlab/tasks/shadowing/play.py --task=Instinct-Perceptive-Shadowing-G1-v0 --load_run= ``` -------------------------------- ### Run pre-commit on all files Source: https://github.com/project-instinct/instinctlab/blob/main/README.md Execute pre-commit to format all files in the repository. This ensures consistent code style across the project. ```bash pre-commit run --all-files ``` -------------------------------- ### Play BeyondMimic Shadowing Policy Source: https://github.com/project-instinct/instinctlab/blob/main/source/instinctlab/instinctlab/tasks/shadowing/README.md Use this command to play a trained BeyondMimic shadowing policy. A 'load_run' name is required to load a checkpoint. ```bash python scripts/instinct_rl/play.py --task=Instinct-BeyondMimic-Plane-G1-v0 --load_run= ``` -------------------------------- ### Play Whole Body Shadowing Policy Source: https://github.com/project-instinct/instinctlab/blob/main/source/instinctlab/instinctlab/tasks/shadowing/README.md Use this command to play a trained Whole Body shadowing policy. A 'load_run' name is required to load a checkpoint. ```bash python scripts/instinct_rl/play.py --task=Instinct-Shadowing-WholeBody-Plane-G1-v0 --load_run= ``` -------------------------------- ### Playing Trained Policies Source: https://github.com/project-instinct/instinctlab/blob/main/source/instinctlab/instinctlab/tasks/shadowing/beyondmimic/README.md Command to run the play script for trained BeyondMimic policies, specifying a checkpoint path. ```bash python source/instinctlab/instinctlab/tasks/shadowing/beyondmimic/play.py --checkpoint /path/to/checkpoint.pt ``` -------------------------------- ### Train Perceptive Shadowing Policy (PPO) Source: https://github.com/project-instinct/instinctlab/blob/main/source/instinctlab/instinctlab/tasks/shadowing/README.md Use this command to train the Perceptive shadowing policy using PPO. Ensure the task ID is correctly specified. ```bash # PPO version python scripts/instinct_rl/train.py --headless --task=Instinct-Perceptive-Shadowing-G1-v0 ``` -------------------------------- ### Play Trained Parkour Policy Source: https://github.com/project-instinct/instinctlab/blob/main/source/instinctlab/instinctlab/tasks/parkour/README.md Execute this command to play a trained Parkour policy. A `load_run` name is required to load a checkpoint. Use `--no_resume` to visualize the untrained policy. ```bash python source/instinctlab/instinctlab/tasks/parkour/scripts/play.py --task=Instinct-Parkour-Target-Amp-G1-v0 --load_run= ``` -------------------------------- ### Train Parkour Policy Source: https://github.com/project-instinct/instinctlab/blob/main/source/instinctlab/instinctlab/tasks/parkour/README.md Use this command to train the Parkour policy. Ensure the task ID is correctly specified in the configuration file. ```bash python scripts/instinct_rl/train.py --headless --task=Instinct-Parkour-Target-Amp-G1-v0 ``` -------------------------------- ### Train BeyondMimic Shadowing Policy Source: https://github.com/project-instinct/instinctlab/blob/main/source/instinctlab/instinctlab/tasks/shadowing/README.md Use this command to train the BeyondMimic shadowing policy. Ensure the task ID is correctly specified. ```bash python scripts/instinct_rl/train.py --headless --task=Instinct-BeyondMimic-Plane-G1-v0 ``` -------------------------------- ### Train RL Task with Instinct-RL Source: https://github.com/project-instinct/instinctlab/blob/main/README.md Execute the training script for an Instinct-RL task. The `--task` argument specifies the reinforcement learning task, and `--headless` runs Isaac Sim without a graphical interface. ```bash python scripts/instinct_rl/train.py --task=Instinct-Shadowing-WholeBody-Plane-G1-Play-v0 --headless ``` -------------------------------- ### Register Virtual Obstacles with Sensor Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md Register virtual obstacles with the sensor during environment initialization to enable penetration detection. This should be called as a startup event. ```python sensor.register_virtual_obstacles(terrain.virtual_obstacles) ``` ```python register_virtual_obstacles = EventTerm( func=instinct_mdp.register_virtual_obstacle_to_sensor, mode="startup", params={ "sensor_cfgs": SceneEntityCfg("leg_volume_points"), }, ) ``` -------------------------------- ### Register Virtual Obstacles with Sensors Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md Register virtual obstacles to a sensor at environment startup using EventTerm. This allows sensors to detect and report interactions with these obstacles. ```python from instinctlab.envs.mdp import EventTerm from instinctlab.envs.mdp.events import register_virtual_obstacle_to_sensor from isaaclab.managers import SceneEntityCfg # In your EventsCfg class class EventsCfg: # Register virtual obstacles to volume points sensor at startup register_virtual_obstacles = EventTerm( func=register_virtual_obstacle_to_sensor, mode="startup", # Register once at environment startup params={ "sensor_cfgs": SceneEntityCfg("leg_volume_points"), # Or multiple sensors: # "sensor_cfgs": [ # SceneEntityCfg("leg_volume_points"), # SceneEntityCfg("arm_volume_points"), # ], }, ) ``` -------------------------------- ### Terrain Importer Configuration with Virtual Obstacles Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md This snippet shows the import statements for configuring terrain importers and various virtual obstacle types. It sets up the necessary classes for defining terrain generation and virtual obstacle parameters. ```python from instinctlab.terrains import TerrainImporterCfg from instinctlab.terrains.virtual_obstacle import ( PluckerEdgeCylinderCfg, RansacEdgeCylinderCfg, GreedyconcatEdgeCylinderCfg, RayEdgeCylinderCfg, ) from isaaclab.terrains import TerrainGeneratorCfg from isaaclab.sensors import patterns ``` -------------------------------- ### Train Whole Body Shadowing Policy Source: https://github.com/project-instinct/instinctlab/blob/main/source/instinctlab/instinctlab/tasks/shadowing/README.md Use this command to train the Whole Body shadowing policy. Ensure the task ID is correctly specified. ```bash python scripts/instinct_rl/train.py --headless --task=Instinct-Shadowing-WholeBody-Plane-G1-v0 ``` -------------------------------- ### Matching Motion Reference with Scene Terrain Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md Configures an event to match a motion reference with the scene terrain during startup. This is useful for aligning simulated environments with real-world motion data. ```python from instinctlab.terrains import MotionMatchedTerrainCfg # Add this to your event cfg class EventsCfg: match_motion_ref_with_scene = EventTermCfg( func=instinct_mdp.match_motion_ref_with_scene, mode="startup", params={ "motion_ref_cfg": SceneEntityCfg("motion_reference"), }, ) ``` -------------------------------- ### Terrain Importer Configuration with Virtual Obstacles Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md Configure the TerrainImporterCfg to include various virtual obstacle detection methods like Plucker, RANSAC, Greedy, and Ray-based edge detection. Each method has specific parameters for thresholding, radius, and resolution. ```python terrain_cfg = TerrainImporterCfg( prim_path="/World/ground", terrain_type="generator", # or "hacked_generator" for custom generator terrain_generator=TerrainGeneratorCfg( # ... terrain generator config ... ), virtual_obstacles={ # Plucker-based edge detection (merges collinear edges) "edges_plucker": PluckerEdgeCylinderCfg( angle_threshold=70.0, # degrees cylinder_radius=0.2, # meters num_grid_cells=64**3, # spatial grid resolution ), # RANSAC-based edge detection (robust to noise) "edges_ransac": RansacEdgeCylinderCfg( angle_threshold=70.0, cylinder_radius=0.2, max_iter=500, point_distance_threshold=0.04, min_points=5, cluster_eps=0.08, ), # Greedy concatenation (connects adjacent edges) "edges_greedy": GreedyconcatEdgeCylinderCfg( angle_threshold=70.0, cylinder_radius=0.2, adjacent_angle_threshold=30.0, min_points=5, ), # Ray-based edge detection (from multiple viewpoints) "edges_ray": RayEdgeCylinderCfg( cylinder_radius=0.2, max_iter=500, point_distance_threshold=0.005, min_points=15, cluster_eps=0.08, ray_pattern=patterns.GridPatternCfg( resolution=0.01, size=[6, 6], direction=(0.0, 0.0, -1.0), ), ray_offset_pos=[0.0, 0.0, 1.0], max_ray_depth=8.0, depth_canny_thresholds=[250, 300], normal_canny_thresholds=[80, 250], cutoff_z_height=0.1, ), # Disable a virtual obstacle by setting to None # "edges": None, }, ) ``` ``` -------------------------------- ### Configure Noisy Camera Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md Configures a NoisyGroupedRayCasterCameraCfg to simulate a noisy camera, like a RealSense D435i. It includes mesh targets, a detailed offset configuration with trigonometric calculations, and a comprehensive noise pipeline. ```python noisy_camera = NoisyGroupedRayCasterCameraCfg( prim_path="{ENV_REGEX_NS}/Robot/torso_link", mesh_prim_paths=[ "/World/ground", # NOTE: Don't forget to add the robot links in robot-specific configuration file. # NoisyGroupedRayCasterCameraCfg.RaycastTargetCfg(prim_expr="/World/envs/env_.*/Robot/torso_link/visuals") ], offset=NoisyGroupedRayCasterCameraCfg.OffsetCfg( pos=( 0.04764571478 + 0.0039635 - 0.0042 * math.cos(math.radians(48)), 0.015, 0.46268178553 - 0.044 + 0.0042 * math.sin(math.radians(48)) + 0.016, ), rot=( math.cos(math.radians(0.5) / 2) * math.cos(math.radians(48) / 2), math.sin(math.radians(0.5) / 2), math.sin(math.radians(48) / 2), 0.0, ), convention="world", ), ray_alignment="yaw", pattern_cfg=patterns.PinholeCameraPatternCfg( focal_length=1.0, horizontal_aperture=2 * math.tan(math.radians(87) / 2), # fovx vertical_aperture=2 * math.tan(math.radians(58) / 2), # fovy height=int(270 / 10), width=int(480 / 10), ), data_types=["distance_to_image_plane"], noise_pipeline={ # "depth_contour_noise": DepthContourNoiseCfg( # contour_threshold=1.8, # in [m] # maxpool_kernel_size=1, # ), "depth_artifact_noise": DepthArtifactNoiseCfg(), "stereo_noise": RangeBasedGaussianNoiseCfg( max_value=1.2, min_value=0.12, noise_std=0.02, ), "sky_artifact_noise": DepthSkyArtifactNoiseCfg(), # "stereo_too_close_noise": StereoTooCloseNoiseCfg(), # These last two noise model will affect the processing on the onboard device. "gaussian_blur_noise": GaussianBlurNoiseCfg( kernel_size=3, sigma=0.5, ), "normalize": DepthNormalizationCfg( depth_range=(0.0, 1.5), normalize=True, ), "crop_and_resize": CropAndResizeCfg( crop_region=(2, 2, 2, 2), resize_shape=(18, 32), ), }, # data_histories={"distance_to_image_plane": 5}, update_period=1 / 60, debug_vis=False, depth_clipping_behavior="max", # clip to the maximum value min_distance=0.05, max_distance=2.0, ) ``` -------------------------------- ### Export Parkour Policy to ONNX Source: https://github.com/project-instinct/instinctlab/blob/main/source/instinctlab/instinctlab/tasks/parkour/README.md This command exports the trained Parkour policy to ONNX format for onboard deployment. It requires a `load_run` name and uses `--exportonnx` and `--useonnx` flags. ```bash python source/instinctlab/instinctlab/tasks/parkour/scripts/play.py --task=Instinct-Parkour-Target-Amp-G1-v0 --load_run= --exportonnx --useonnx ``` -------------------------------- ### Configure Pylance extraPaths in VSCode Source: https://github.com/project-instinct/instinctlab/blob/main/README.md Add the path to your extension repository to VSCode's Pylance settings to resolve indexing issues. This helps Pylance correctly analyze your project's code. ```json { "python.analysis.extraPaths": [ "/source/instinctlab" ] } ``` -------------------------------- ### Configure Grouped Ray Caster Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md Configures a GroupedRayCasterCfg for scene entity querying. It specifies the prim path, offset, ray alignment, pattern, and mesh targets. Useful for general-purpose ray casting in a scene. ```python grouped_ray_caster = GroupedRayCasterCfg( prim_path="{ENV_REGEX_NS}/Robot/torso_link", offset=RayCasterCfg.OffsetCfg(pos=(0.0, 0.0, 20.0)), ray_alignment="yaw", pattern_cfg=patterns.GridPatternCfg(resolution=0.1, size=[1.6, 1.0]), debug_vis=False, mesh_prim_paths=[ "/World/ground", # NOTE: Don't forget to add the robot links in robot-specific configuration file. # GroupedRayCasterCfg.RaycastTargetCfg(prim_expr="/World/envs/env_.*/Robot/torso_link/visuals") ], ) ``` -------------------------------- ### Base Pose Reference Command Configuration Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md Defines a base pose reference command, including position and orientation, relative to the robot's anchor frame. It uses axis-angle representation and does not include real-time updates or the current state command. ```python from isaaclab.envs.mdp import PoseRefCommandCfg, JointPosRefCommandCfg from isaaclab.managers import SceneEntityCfg # Base pose reference command (position + orientation) pose_ref_command = PoseRefCommandCfg( motion_reference=SceneEntityCfg("motion_reference"), asset_cfg=SceneEntityCfg("robot"), anchor_frame="robot", # Reference in robot's local frame rotation_mode="axis_angle", # Use axis-angle representation realtime_mode=0, # No real-time updates current_state_command=False, # Don't include current state ) ``` -------------------------------- ### Export Policy as ONNX Model Source: https://github.com/project-instinct/instinctlab/blob/main/README.md Add the `--exportonnx` flag to the `play.py` script to export the trained policy as an ONNX model. This exported model can then be used with the `instinct_onboard` workflow for deployment on a robot. ```bash python play.py --exportonnx ``` -------------------------------- ### Joint Position Reference Command Configuration Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md Configures a joint position reference command that includes the robot's current joint positions. This is useful for tasks requiring precise joint control based on motion reference data. ```python from isaaclab.envs.mdp import PoseRefCommandCfg, JointPosRefCommandCfg from isaaclab.managers import SceneEntityCfg # Joint position reference command joint_pos_ref_command = JointPosRefCommandCfg( motion_reference=SceneEntityCfg("motion_reference"), asset_cfg=SceneEntityCfg("robot"), current_state_command=True, # Include current joint positions ) ``` -------------------------------- ### Accessing Virtual Obstacles in Rewards Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md Define reward terms that penalize penetration into virtual obstacles using volume_points_penetration or volume_points_step_safety functions. These require sensor configurations and optionally contact force sensors. ```python from instinctlab.envs.mdp import RewTermCfg import instinctlab.envs.mdp as instinct_mdp # Reward that penalizes penetration into virtual obstacles volume_points_penetration = RewTermCfg( func=instinct_mdp.volume_points_penetration, params={ "sensor_cfgs": [SceneEntityCfg("leg_volume_points"), SceneEntityCfg("arm_volume_points")], }, ) # Reward that penalizes penetration into virtual obstacles volume_points_step_safety = RewTermCfg( func=instinct_mdp.volume_points_step_safety, params={ "sensor_cfgs": [SceneEntityCfg("leg_volume_points"), SceneEntityCfg("arm_volume_points")], "contact_forces_cfg": SceneEntityCfg("contact_forces"), }, ) ``` -------------------------------- ### Configure AMASS Motion Data Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md Configures the motion buffer for the AMASS dataset, specifying the path, buffer length, frame interval, and sampling strategy for motion data. ```python from instinctlab.motion_reference import MotionReferenceManagerCfg from instinctlab.motion_reference import AmassMotionCfgBase # Configure motion buffer (e.g., AMASS dataset) class AMASSMotionCfg(AmassMotionCfgBase): path = "~/Datasets/AMASS_dataset" motion_bin_length_s = 1.0 frame_interval_s = 0.1 env_starting_stub_sampling_strategy = "concat_motion_bins" # Configure motion reference manager and put it in SceneCfg motion_reference_cfg = MotionReferenceManagerCfg( prim_path="{ENV_REGEX_NS}/Robot/torso_link", robot_model_path="path/to/robot.urdf", reference_prim_path="/World/envs/env_.*/RobotReference/torso_link", link_of_interests=[ "pelvis", "torso_link", "left_shoulder_roll_link", "right_shoulder_roll_link", "left_elbow_link", "right_elbow_link", # ... more links ], frame_interval_s=0.1, # 10 Hz frame rate update_period=0.02, # Update every 0.02s (50 Hz) num_frames=10, # Look ahead 10 frames (1 second) data_start_from="current_time", # Start from current timestep motion_buffers={ "AMASSMotion": AMASSMotionCfg(), }, ) ``` -------------------------------- ### Termination Term for Motion Reference Exhaustion Source: https://github.com/project-instinct/instinctlab/blob/main/DOCS.md Configures a termination term to detect when the motion reference data is exhausted. This is applied per motion reference manager. ```python from isaaclab.managers import TerminationTermCfg # Add this to your termination cfg class TerminationsCfg: motion_reference_exhausted = TerminationTermCfg( func=instinct_mdp.dataset_exhausted, params={ "reference_cfg": SceneEntityCfg("motion_reference"), # "reset_without_notice": True, #### If True, this termination term will only reset the exhausted env in the motion reference manager, but not return any True to reset the environment. }, ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.