diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/modelCfg/humanoid.py b/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/modelCfg/humanoid.py deleted file mode 100644 index a6840b6..0000000 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/modelCfg/humanoid.py +++ /dev/null @@ -1,44 +0,0 @@ -# Code for specifying custom model parameters - -import isaaclab.sim as sim_utils -from isaaclab.actuators import ImplicitActuatorCfg -from isaaclab.assets.articulation import ArticulationCfg - -HAND_CFG = ArticulationCfg( - spawn=sim_utils.UsdFileCfg( - usd_path="/home/hy/Downloads/Humanoid_Wato/ModelAssets/hand.usd", - rigid_props=sim_utils.RigidBodyPropertiesCfg( - disable_gravity=False, - max_depenetration_velocity=5.0, - ), - activate_contact_sensors=False, - ), - init_state=ArticulationCfg.InitialStateCfg( - joint_pos={ - "Revolute_1": 0.0, - "Revolute_2": 0.0, - "Revolute_3": 0.0, - "Revolute_4": 0.0, - "Revolute_5": 0.0, - "Revolute_6": 0.0, - "Revolute_7": 0.0, - "Revolute_8": 0.0, - "Revolute_9": 0.0, - "Revolute_10": 0.0, - "Revolute_11": 0.0, - "Revolute_12": 0.0, - "Revolute_13": 0.0, - "Revolute_14": 0.0, - "Revolute_15": 0.0, - } - ), - actuators={ - "arm": ImplicitActuatorCfg( - joint_names_expr=[".*"], - # velocity_limit=100.0, - # effort_limit=87.0, - stiffness=0.5, - damping=0.5, - ), - }, -) diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/agents/__init__.py b/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/agents/__init__.py deleted file mode 100644 index 1228528..0000000 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/agents/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2022-2025, The Isaac Lab Project Developers. -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause - -# From Isaac Lab -# source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/config//agents/__init__.py diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/joint_pos_env_cfg.py b/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/joint_pos_env_cfg.py deleted file mode 100644 index 5dd1da9..0000000 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/joint_pos_env_cfg.py +++ /dev/null @@ -1,116 +0,0 @@ -import math -from isaaclab.utils import configclass -import HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp as mdp -from HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.reach_env_cfg import ReachEnvCfg -from HumanoidRLPackage.HumanoidRLSetup.modelCfg.universal_robots import UR10_CFG -from HumanoidRLPackage.HumanoidRLSetup.modelCfg.humanoid import HAND_CFG - - -@configclass -class HumanoidHandReachEnvCfg(ReachEnvCfg): - def __post_init__(self): - # post init of parent - super().__post_init__() - - # self.scene.robot = UR10_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") - self.scene.robot = HAND_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") - - marker_scale = 0.02 - - self.commands.ee_pose.goal_pose_visualizer_cfg.markers["frame"].scale = ( - marker_scale, marker_scale, marker_scale) - self.commands.ee_pose.current_pose_visualizer_cfg.markers["frame"].scale = ( - marker_scale, marker_scale, marker_scale) - - self.commands.ee_pose_2.goal_pose_visualizer_cfg.markers["frame"].scale = ( - marker_scale, marker_scale, marker_scale) - self.commands.ee_pose_2.current_pose_visualizer_cfg.markers["frame"].scale = ( - marker_scale, marker_scale, marker_scale) - - self.commands.ee_pose_3.goal_pose_visualizer_cfg.markers["frame"].scale = ( - marker_scale, marker_scale, marker_scale) - self.commands.ee_pose_3.current_pose_visualizer_cfg.markers["frame"].scale = ( - marker_scale, marker_scale, marker_scale) - - self.commands.ee_pose_4.goal_pose_visualizer_cfg.markers["frame"].scale = ( - marker_scale, marker_scale, marker_scale) - self.commands.ee_pose_4.current_pose_visualizer_cfg.markers["frame"].scale = ( - marker_scale, marker_scale, marker_scale) - - self.commands.ee_pose_5.goal_pose_visualizer_cfg.markers["frame"].scale = ( - marker_scale, marker_scale, marker_scale) - self.commands.ee_pose_5.current_pose_visualizer_cfg.markers["frame"].scale = ( - marker_scale, marker_scale, marker_scale) - - # override events - self.events.reset_robot_joints.params["position_range"] = (0.75, 1.25) - # override rewards - self.rewards.end_effector_position_tracking.params["asset_cfg"].body_names = [ - "TIP_B_1"] - self.rewards.end_effector_position_tracking_fine_grained.params["asset_cfg"].body_names = [ - "TIP_B_1"] - # self.rewards.end_effector_orientation_tracking.params["asset_cfg"].body_names = ["TIP_B_1"] - - self.rewards.end_effector_2_position_tracking.params["asset_cfg"].body_names = [ - "TIP_B_2"] - self.rewards.end_effector_2_position_tracking_fine_grained.params["asset_cfg"].body_names = [ - "TIP_B_2"] - # self.rewards.end_effector_2_orientation_tracking.params["asset_cfg"].body_names = ["TIP_B_2"] - - self.rewards.end_effector_3_position_tracking.params["asset_cfg"].body_names = [ - "TIP_B_3"] - self.rewards.end_effector_3_position_tracking_fine_grained.params["asset_cfg"].body_names = [ - "TIP_B_3"] - # self.rewards.end_effector_3_orientation_tracking.params["asset_cfg"].body_names = ["TIP_B_3"] - - self.rewards.end_effector_4_position_tracking.params["asset_cfg"].body_names = [ - "TIP_B_4"] - self.rewards.end_effector_4_position_tracking_fine_grained.params["asset_cfg"].body_names = [ - "TIP_B_4"] - # self.rewards.end_effector_4_orientation_tracking.params["asset_cfg"].body_names = ["TIP_B_4"] - - self.rewards.end_effector_5_position_tracking.params["asset_cfg"].body_names = [ - "TIP_B_5"] - self.rewards.end_effector_5_position_tracking_fine_grained.params["asset_cfg"].body_names = [ - "TIP_B_5"] - # self.rewards.end_effector_5_orientation_tracking.params["asset_cfg"].body_names = ["TIP_B_5"] - - # override actions - self.actions.arm_action = mdp.JointPositionActionCfg( - asset_name="robot", joint_names=[".*"], scale=0.5, use_default_offset=True) - # override command generator body - # end-effector is along x-direction - self.commands.ee_pose.body_name = "TIP_B_1" - # self.commands.ee_pose.ranges.pitch = (math.pi / 2, math.pi / 2) # - # this rotate the pose - - self.commands.ee_pose_2.body_name = "TIP_B_2" - # self.commands.ee_pose_2.ranges.pitch = (math.pi / 2, math.pi / 2) - - self.commands.ee_pose_3.body_name = "TIP_B_3" - # self.commands.ee_pose_3.ranges.pitch = (math.pi / 2, math.pi / 2) - - self.commands.ee_pose_4.body_name = "TIP_B_4" - # self.commands.ee_pose_4.ranges.pitch = (math.pi / 2, math.pi / 2) - - self.commands.ee_pose_5.body_name = "TIP_B_5" - # self.commands.ee_pose_5.ranges.pitch = (math.pi / 2, math.pi / 2) - - # self.commands.ee_pose.ranges.yaw = (-math.pi / 2, -math.pi / 2) - # self.commands.ee_pose_2.ranges.yaw = (-math.pi / 2, -math.pi / 2) - - -@configclass -class HumanoidHandReachEnvCfg_PLAY(HumanoidHandReachEnvCfg): - def __post_init__(self): - # post init of parent - super().__post_init__() - # make a smaller scene for play - self.scene.num_envs = 50 - self.scene.env_spacing = 2.5 - # disable randomization for play - self.observations.policy.enable_corruption = False - -# (env_isaaclab) hy@hy-LOQ-15IRX9:~/Downloads/Humanoid_Wato/HumanoidRL$ PYTHONPATH=$(pwd) /home/hy/IsaacLab/isaaclab.sh -p HumanoidRLPackage/rsl_rl_scripts/train.py --task=Isaac-Reach-Humanoid-Hand-v0 --headless - -# (env_isaaclab) hy@hy-LOQ-15IRX9:~/Downloads/Humanoid_Wato/HumanoidRL$ PYTHONPATH=$(pwd) /home/hy/IsaacLab/isaaclab.sh -p HumanoidRLPackage/rsl_rl_scripts/play.py --task=Isaac-Reach-Humanoid-Hand-v0 --num_envs=1 diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/reach_env_cfg.py b/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/reach_env_cfg.py deleted file mode 100644 index 1d1840c..0000000 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/reach_env_cfg.py +++ /dev/null @@ -1,394 +0,0 @@ -from dataclasses import MISSING - -import isaaclab.sim as sim_utils -from isaaclab.assets import ArticulationCfg, AssetBaseCfg -from isaaclab.envs import ManagerBasedRLEnvCfg -from isaaclab.managers import ActionTermCfg as ActionTerm -from isaaclab.managers import CurriculumTermCfg as CurrTerm -from isaaclab.managers import EventTermCfg as EventTerm -from isaaclab.managers import ObservationGroupCfg as ObsGroup -from isaaclab.managers import ObservationTermCfg as ObsTerm -from isaaclab.managers import RewardTermCfg as RewTerm -from isaaclab.managers import SceneEntityCfg -from isaaclab.managers import TerminationTermCfg as DoneTerm -from isaaclab.scene import InteractiveSceneCfg -from isaaclab.utils import configclass -from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR -from isaaclab.utils.noise import AdditiveUniformNoiseCfg as Unoise - -import HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp as mdp - - -@configclass -class ReachSceneCfg(InteractiveSceneCfg): - """Configuration for the scene with a robotic arm.""" - - # world - ground = AssetBaseCfg( - prim_path="/World/ground", - spawn=sim_utils.GroundPlaneCfg(), - init_state=AssetBaseCfg.InitialStateCfg(pos=(0.0, 0.0, -1.05)), - ) - - table = AssetBaseCfg( - prim_path="{ENV_REGEX_NS}/Table", - spawn=sim_utils.UsdFileCfg( - usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Mounts/SeattleLabTable/table_instanceable.usd", - ), - init_state=AssetBaseCfg.InitialStateCfg( - pos=( - 0.55, - 0.0, - 0.0), - rot=( - 0.70711, - 0.0, - 0.0, - 0.70711)), - ) - - # robots - robot: ArticulationCfg = MISSING - - # lights - light = AssetBaseCfg( - prim_path="/World/light", - spawn=sim_utils.DomeLightCfg( - color=( - 0.75, - 0.75, - 0.75), - intensity=2500.0), - ) - - -## -# MDP settings -## - - -@configclass -class CommandsCfg: - """Command terms for the MDP.""" - - ee_pose = mdp.UniformPoseCommandCfg( - asset_name="robot", - body_name="TIP_B_1", # end_effector name - resampling_time_range=(4.0, 4.0), - debug_vis=True, - ranges=mdp.UniformPoseCommandCfg.Ranges( # within task space of finger - pos_x=(0.07346, 0.07346), - pos_y=(0.13, 0.1455), - pos_z=(0.09, 0.1005), - # no rotational variation - roll=(0.0, 0.0), - pitch=(0.0, 0.0), - yaw=(0.0, 0.0), - ), - ) - - ee_pose_2 = mdp.UniformPoseCommandCfg( - asset_name="robot", - body_name="TIP_B_2", - resampling_time_range=(4.0, 4.0), - debug_vis=True, - ranges=mdp.UniformPoseCommandCfg.Ranges( - pos_x=(0.04746, 0.04746), - # pos_y=(0.135, 0.14), - pos_y=(0.15406, 0.15558), - # pos_z=(0.09, 0.136), - pos_z=(0.098, 0.10058), - roll=(0.0, 0.0), - pitch=(0.0, 0.0), - yaw=(0.0, 0.0), - ), - ) - - ee_pose_3 = mdp.UniformPoseCommandCfg( - asset_name="robot", - body_name="TIP_B_3", - resampling_time_range=(4.0, 4.0), - debug_vis=True, - ranges=mdp.UniformPoseCommandCfg.Ranges( - pos_x=(0.01996, 0.01996), - pos_y=(0.134, 0.145), - pos_z=(0.09, 0.11), - roll=(0.0, 0.0), - pitch=(0.0, 0.0), - yaw=(0.0, 0.0), - ), - ) - - ee_pose_4 = mdp.UniformPoseCommandCfg( - asset_name="robot", - body_name="TIP_B_4", - resampling_time_range=(4.0, 4.0), - debug_vis=True, - ranges=mdp.UniformPoseCommandCfg.Ranges( - pos_x=(-0.00754, -0.00754), - pos_y=(0.119, 0.13), - pos_z=(0.09, 0.1), - roll=(0.0, 0.0), - pitch=(0.0, 0.0), - yaw=(0.0, 0.0), - ), - ) - - ee_pose_5 = mdp.UniformPoseCommandCfg( - asset_name="robot", - body_name="TIP_B_5", - resampling_time_range=(4.0, 4.0), - debug_vis=True, - ranges=mdp.UniformPoseCommandCfg.Ranges( - pos_x=(0.0869, 0.0869), - pos_y=(0.04, 0.052), - pos_z=(0.17, 0.17248), - roll=(0.0, 0.0), - pitch=(0.0, 0.0), - yaw=(0.0, 0.0), - ), - ) - - -@configclass -class ActionsCfg: - """Action specifications for the MDP.""" - - arm_action: ActionTerm = MISSING - gripper_action: ActionTerm | None = None - - -@configclass -class ObservationsCfg: - """Observation specifications for the MDP.""" - - @configclass - class PolicyCfg(ObsGroup): - """Observations for policy group.""" - - # observation terms (order preserved) - joint_pos = ObsTerm( - func=mdp.joint_pos_rel, - noise=Unoise( - n_min=-0.01, - n_max=0.01)) - joint_vel = ObsTerm( - func=mdp.joint_vel_rel, - noise=Unoise( - n_min=-0.01, - n_max=0.01)) - - pose_command = ObsTerm( - func=mdp.generated_commands, params={ - "command_name": "ee_pose"}) - pose_command_2 = ObsTerm( - func=mdp.generated_commands, params={ - "command_name": "ee_pose_2"}) - pose_command_3 = ObsTerm( - func=mdp.generated_commands, params={ - "command_name": "ee_pose_3"}) - pose_command_4 = ObsTerm( - func=mdp.generated_commands, params={ - "command_name": "ee_pose_4"}) - pose_command_5 = ObsTerm( - func=mdp.generated_commands, params={ - "command_name": "ee_pose_5"}) - - actions = ObsTerm(func=mdp.last_action) - - def __post_init__(self): - self.enable_corruption = True - self.concatenate_terms = True - - # observation groups - policy: PolicyCfg = PolicyCfg() - - -@configclass -class EventCfg: - """Configuration for events.""" - - reset_robot_joints = EventTerm( - func=mdp.reset_joints_by_scale, - mode="reset", - params={ - "position_range": (0.5, 1.5), - "velocity_range": (0.0, 0.0), - }, - ) - - -@configclass -class RewardsCfg: - """Reward terms for the MDP.""" - - # task terms - end_effector_position_tracking = RewTerm( - func=mdp.position_command_error, - weight=-0.2, - params={"asset_cfg": SceneEntityCfg( - "robot", body_names="TIP_B_1"), "command_name": "ee_pose"}, - ) - end_effector_2_position_tracking = RewTerm( - func=mdp.position_command_error, - weight=-0.2, - params={"asset_cfg": SceneEntityCfg( - "robot", body_names="TIP_B_2"), "command_name": "ee_pose_2"}, - ) - end_effector_3_position_tracking = RewTerm( - func=mdp.position_command_error, - weight=-0.2, - params={"asset_cfg": SceneEntityCfg( - "robot", body_names="TIP_B_3"), "command_name": "ee_pose_3"}, - ) - end_effector_4_position_tracking = RewTerm( - func=mdp.position_command_error, - weight=-0.2, - params={"asset_cfg": SceneEntityCfg( - "robot", body_names="TIP_B_4"), "command_name": "ee_pose_4"}, - ) - end_effector_5_position_tracking = RewTerm( - func=mdp.position_command_error, - weight=-0.2, - params={"asset_cfg": SceneEntityCfg( - "robot", body_names="TIP_B_5"), "command_name": "ee_pose_5"}, - ) - - end_effector_position_tracking_fine_grained = RewTerm( - func=mdp.position_command_error_tanh, - weight=0.1, - params={ - "asset_cfg": SceneEntityCfg( - "robot", - body_names="TIP_B_1"), - "std": 0.1, - "command_name": "ee_pose"}, - ) - end_effector_2_position_tracking_fine_grained = RewTerm( - func=mdp.position_command_error_tanh, - weight=0.1, - params={ - "asset_cfg": SceneEntityCfg( - "robot", - body_names="TIP_B_2"), - "std": 0.1, - "command_name": "ee_pose_2"}, - ) - end_effector_3_position_tracking_fine_grained = RewTerm( - func=mdp.position_command_error_tanh, - weight=0.1, - params={ - "asset_cfg": SceneEntityCfg( - "robot", - body_names="TIP_B_3"), - "std": 0.1, - "command_name": "ee_pose_3"}, - ) - end_effector_4_position_tracking_fine_grained = RewTerm( - func=mdp.position_command_error_tanh, - weight=0.1, - params={ - "asset_cfg": SceneEntityCfg( - "robot", - body_names="TIP_B_4"), - "std": 0.1, - "command_name": "ee_pose_4"}, - ) - end_effector_5_position_tracking_fine_grained = RewTerm( - func=mdp.position_command_error_tanh, - weight=0.1, - params={ - "asset_cfg": SceneEntityCfg( - "robot", - body_names="TIP_B_5"), - "std": 0.1, - "command_name": "ee_pose_5"}, - ) - - # end_effector_orientation_tracking = RewTerm( - # func=mdp.orientation_command_error, - # weight=-0.1, - # params={"asset_cfg": SceneEntityCfg("robot", body_names="TIP_B_1"), "command_name": "ee_pose"}, - # ) - # end_effector_2_orientation_tracking = RewTerm( - # func=mdp.orientation_command_error, - # weight=-0.1, - # params={"asset_cfg": SceneEntityCfg("robot", body_names="TIP_B_2"), "command_name": "ee_pose_2"}, - # ) - # end_effector_3_orientation_tracking = RewTerm( - # func=mdp.orientation_command_error, - # weight=-0.1, - # params={"asset_cfg": SceneEntityCfg("robot", body_names="TIP_B_3"), "command_name": "ee_pose_3"}, - # ) - # end_effector_4_orientation_tracking = RewTerm( - # func=mdp.orientation_command_error, - # weight=-0.1, - # params={"asset_cfg": SceneEntityCfg("robot", body_names="TIP_B_4"), "command_name": "ee_pose_4"}, - # ) - # end_effector_5_orientation_tracking = RewTerm( - # func=mdp.orientation_command_error, - # weight=-0.1, - # params={"asset_cfg": SceneEntityCfg("robot", body_names="TIP_B_5"), "command_name": "ee_pose_5"}, - # ) - - # action penalty - action_rate = RewTerm(func=mdp.action_rate_l2, weight=-0.0001) - joint_vel = RewTerm( - func=mdp.joint_vel_l2, - weight=-0.0001, - params={"asset_cfg": SceneEntityCfg("robot")}, - ) - - -@configclass -class TerminationsCfg: - """Termination terms for the MDP.""" - - time_out = DoneTerm(func=mdp.time_out, time_out=True) - - -@configclass -class CurriculumCfg: - """Curriculum terms for the MDP.""" - - action_rate = CurrTerm( - func=mdp.modify_reward_weight, params={ - "term_name": "action_rate", "weight": -0.005, "num_steps": 4500} - ) - - joint_vel = CurrTerm( - func=mdp.modify_reward_weight, params={ - "term_name": "joint_vel", "weight": -0.001, "num_steps": 4500} - ) - - -## -# Environment configuration -## - - -@configclass -class ReachEnvCfg(ManagerBasedRLEnvCfg): - """Configuration for the reach end-effector pose tracking environment.""" - - # Scene settings - scene: ReachSceneCfg = ReachSceneCfg(num_envs=4096, env_spacing=2.5) - # Basic settings - observations: ObservationsCfg = ObservationsCfg() - actions: ActionsCfg = ActionsCfg() - commands: CommandsCfg = CommandsCfg() - # MDP settings - rewards: RewardsCfg = RewardsCfg() - terminations: TerminationsCfg = TerminationsCfg() - events: EventCfg = EventCfg() - curriculum: CurriculumCfg = CurriculumCfg() - - def __post_init__(self): - """Post initialization.""" - # general settings - self.decimation = 2 - self.sim.render_interval = self.decimation - self.episode_length_s = 12.0 - self.viewer.eye = (3.5, 3.5, 3.5) - # simulation settings - self.sim.dt = 1.0 / 60.0 diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/outputs/2025-07-02/23-27-01/.hydra/config.yaml b/autonomy/simulation/Humanoid_RL/HumanoidRL/outputs/2025-07-02/23-27-01/.hydra/config.yaml deleted file mode 100644 index e6be28a..0000000 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/outputs/2025-07-02/23-27-01/.hydra/config.yaml +++ /dev/null @@ -1,1046 +0,0 @@ -env: - viewer: - eye: - - 3.5 - - 3.5 - - 3.5 - lookat: - - 0.0 - - 0.0 - - 0.0 - cam_prim_path: /OmniverseKit_Persp - resolution: - - 1280 - - 720 - origin_type: world - env_index: 0 - asset_name: null - body_name: null - sim: - physics_prim_path: /physicsScene - device: cuda:0 - dt: 0.016666666666666666 - render_interval: 2 - gravity: - - 0.0 - - 0.0 - - -9.81 - enable_scene_query_support: false - use_fabric: true - physx: - solver_type: 1 - min_position_iteration_count: 1 - max_position_iteration_count: 255 - min_velocity_iteration_count: 0 - max_velocity_iteration_count: 255 - enable_ccd: false - enable_stabilization: true - enable_enhanced_determinism: false - bounce_threshold_velocity: 0.5 - friction_offset_threshold: 0.04 - friction_correlation_distance: 0.025 - gpu_max_rigid_contact_count: 8388608 - gpu_max_rigid_patch_count: 163840 - gpu_found_lost_pairs_capacity: 2097152 - gpu_found_lost_aggregate_pairs_capacity: 33554432 - gpu_total_aggregate_pairs_capacity: 2097152 - gpu_collision_stack_size: 67108864 - gpu_heap_capacity: 67108864 - gpu_temp_buffer_capacity: 16777216 - gpu_max_num_partitions: 8 - gpu_max_soft_body_contacts: 1048576 - gpu_max_particle_contacts: 1048576 - physics_material: - func: isaaclab.sim.spawners.materials.physics_materials:spawn_rigid_body_material - static_friction: 0.5 - dynamic_friction: 0.5 - restitution: 0.0 - improve_patch_friction: true - friction_combine_mode: average - restitution_combine_mode: average - compliant_contact_stiffness: 0.0 - compliant_contact_damping: 0.0 - render: - enable_translucency: null - enable_reflections: null - enable_global_illumination: null - antialiasing_mode: null - enable_dlssg: null - enable_dl_denoiser: null - dlss_mode: null - enable_direct_lighting: null - samples_per_pixel: null - enable_shadows: null - enable_ambient_occlusion: null - carb_settings: null - rendering_mode: null - ui_window_class_type: isaaclab.envs.ui.manager_based_rl_env_window:ManagerBasedRLEnvWindow - seed: null - decimation: 2 - scene: - num_envs: 4096 - env_spacing: 2.5 - lazy_sensor_update: true - replicate_physics: true - filter_collisions: true - robot: - class_type: isaaclab.assets.articulation.articulation:Articulation - prim_path: '{ENV_REGEX_NS}/Robot' - spawn: - func: isaaclab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - deformable_props: null - rigid_props: - rigid_body_enabled: null - kinematic_enabled: null - disable_gravity: false - linear_damping: null - angular_damping: null - max_linear_velocity: null - max_angular_velocity: null - max_depenetration_velocity: 5.0 - max_contact_impulse: null - enable_gyroscopic_forces: null - retain_accelerations: null - solver_position_iteration_count: null - solver_velocity_iteration_count: null - sleep_threshold: null - stabilization_threshold: null - collision_props: null - activate_contact_sensors: false - scale: null - articulation_props: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: /home/hy/Downloads/Humanoid_Wato/ModelAssets/hand.usd - variants: null - init_state: - pos: - - 0.0 - - 0.0 - - 0.0 - rot: - - 1.0 - - 0.0 - - 0.0 - - 0.0 - lin_vel: - - 0.0 - - 0.0 - - 0.0 - ang_vel: - - 0.0 - - 0.0 - - 0.0 - joint_pos: - Revolute_1: 0.0 - Revolute_2: 0.0 - Revolute_3: 0.0 - Revolute_4: 0.0 - Revolute_5: 0.0 - Revolute_6: 0.0 - Revolute_7: 0.0 - Revolute_8: 0.0 - Revolute_9: 0.0 - Revolute_10: 0.0 - Revolute_11: 0.0 - Revolute_12: 0.0 - Revolute_13: 0.0 - Revolute_14: 0.0 - Revolute_15: 0.0 - joint_vel: - .*: 0.0 - collision_group: 0 - debug_vis: false - soft_joint_pos_limit_factor: 1.0 - actuators: - arm: - class_type: isaaclab.actuators.actuator_pd:ImplicitActuator - joint_names_expr: - - .* - effort_limit: null - velocity_limit: null - effort_limit_sim: null - velocity_limit_sim: null - stiffness: 0.5 - damping: 0.5 - armature: null - friction: null - ground: - class_type: null - prim_path: /World/ground - spawn: - func: isaaclab.sim.spawners.from_files.from_files:spawn_ground_plane - visible: true - semantic_tags: null - copy_from_source: true - usd_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.5/Isaac/Environments/Grid/default_environment.usd - color: - - 0.0 - - 0.0 - - 0.0 - size: - - 100.0 - - 100.0 - physics_material: - func: isaaclab.sim.spawners.materials.physics_materials:spawn_rigid_body_material - static_friction: 0.5 - dynamic_friction: 0.5 - restitution: 0.0 - improve_patch_friction: true - friction_combine_mode: average - restitution_combine_mode: average - compliant_contact_stiffness: 0.0 - compliant_contact_damping: 0.0 - init_state: - pos: - - 0.0 - - 0.0 - - -1.05 - rot: - - 1.0 - - 0.0 - - 0.0 - - 0.0 - collision_group: 0 - debug_vis: false - table: - class_type: null - prim_path: '{ENV_REGEX_NS}/Table' - spawn: - func: isaaclab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - deformable_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - scale: null - articulation_props: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.5/Isaac/Props/Mounts/SeattleLabTable/table_instanceable.usd - variants: null - init_state: - pos: - - 0.55 - - 0.0 - - 0.0 - rot: - - 0.70711 - - 0.0 - - 0.0 - - 0.70711 - collision_group: 0 - debug_vis: false - light: - class_type: null - prim_path: /World/light - spawn: - func: isaaclab.sim.spawners.lights.lights:spawn_light - visible: true - semantic_tags: null - copy_from_source: true - prim_type: DomeLight - color: - - 0.75 - - 0.75 - - 0.75 - enable_color_temperature: false - color_temperature: 6500.0 - normalize: false - exposure: 0.0 - intensity: 2500.0 - texture_file: null - texture_format: automatic - visible_in_primary_ray: true - init_state: - pos: - - 0.0 - - 0.0 - - 0.0 - rot: - - 1.0 - - 0.0 - - 0.0 - - 0.0 - collision_group: 0 - debug_vis: false - recorders: - dataset_file_handler_class_type: isaaclab.utils.datasets.hdf5_dataset_file_handler:HDF5DatasetFileHandler - dataset_export_dir_path: /tmp/isaaclab/logs - dataset_filename: dataset - dataset_export_mode: - _value_: 1 - _name_: EXPORT_ALL - export_in_record_pre_reset: true - observations: - policy: - concatenate_terms: true - enable_corruption: true - history_length: null - flatten_history_dim: true - joint_pos: - func: isaaclab.envs.mdp.observations:joint_pos_rel - params: {} - modifiers: null - noise: - func: isaaclab.utils.noise.noise_model:uniform_noise - operation: add - n_min: -0.01 - n_max: 0.01 - clip: null - scale: null - history_length: 0 - flatten_history_dim: true - joint_vel: - func: isaaclab.envs.mdp.observations:joint_vel_rel - params: {} - modifiers: null - noise: - func: isaaclab.utils.noise.noise_model:uniform_noise - operation: add - n_min: -0.01 - n_max: 0.01 - clip: null - scale: null - history_length: 0 - flatten_history_dim: true - pose_command: - func: isaaclab.envs.mdp.observations:generated_commands - params: - command_name: ee_pose - modifiers: null - noise: null - clip: null - scale: null - history_length: 0 - flatten_history_dim: true - pose_command_2: - func: isaaclab.envs.mdp.observations:generated_commands - params: - command_name: ee_pose_2 - modifiers: null - noise: null - clip: null - scale: null - history_length: 0 - flatten_history_dim: true - pose_command_3: - func: isaaclab.envs.mdp.observations:generated_commands - params: - command_name: ee_pose_3 - modifiers: null - noise: null - clip: null - scale: null - history_length: 0 - flatten_history_dim: true - pose_command_4: - func: isaaclab.envs.mdp.observations:generated_commands - params: - command_name: ee_pose_4 - modifiers: null - noise: null - clip: null - scale: null - history_length: 0 - flatten_history_dim: true - pose_command_5: - func: isaaclab.envs.mdp.observations:generated_commands - params: - command_name: ee_pose_5 - modifiers: null - noise: null - clip: null - scale: null - history_length: 0 - flatten_history_dim: true - actions: - func: isaaclab.envs.mdp.observations:last_action - params: {} - modifiers: null - noise: null - clip: null - scale: null - history_length: 0 - flatten_history_dim: true - actions: - arm_action: - class_type: isaaclab.envs.mdp.actions.joint_actions:JointPositionAction - asset_name: robot - debug_vis: false - clip: null - joint_names: - - .* - scale: 0.5 - offset: 0.0 - preserve_order: false - use_default_offset: true - gripper_action: null - events: - reset_robot_joints: - func: isaaclab.envs.mdp.events:reset_joints_by_scale - params: - position_range: - - 0.75 - - 1.25 - velocity_range: - - 0.0 - - 0.0 - mode: reset - interval_range_s: null - is_global_time: false - min_step_count_between_reset: 0 - rerender_on_reset: false - wait_for_textures: true - xr: null - is_finite_horizon: false - episode_length_s: 12.0 - rewards: - end_effector_position_tracking: - func: HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp.rewards:position_command_error - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: slice(None,None,None) - fixed_tendon_names: null - fixed_tendon_ids: slice(None,None,None) - body_names: - - TIP_B_1 - body_ids: slice(None,None,None) - object_collection_names: null - object_collection_ids: slice(None,None,None) - preserve_order: false - command_name: ee_pose - weight: -0.2 - end_effector_2_position_tracking: - func: HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp.rewards:position_command_error - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: slice(None,None,None) - fixed_tendon_names: null - fixed_tendon_ids: slice(None,None,None) - body_names: - - TIP_B_2 - body_ids: slice(None,None,None) - object_collection_names: null - object_collection_ids: slice(None,None,None) - preserve_order: false - command_name: ee_pose_2 - weight: -0.2 - end_effector_3_position_tracking: - func: HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp.rewards:position_command_error - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: slice(None,None,None) - fixed_tendon_names: null - fixed_tendon_ids: slice(None,None,None) - body_names: - - TIP_B_3 - body_ids: slice(None,None,None) - object_collection_names: null - object_collection_ids: slice(None,None,None) - preserve_order: false - command_name: ee_pose_3 - weight: -0.2 - end_effector_4_position_tracking: - func: HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp.rewards:position_command_error - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: slice(None,None,None) - fixed_tendon_names: null - fixed_tendon_ids: slice(None,None,None) - body_names: - - TIP_B_4 - body_ids: slice(None,None,None) - object_collection_names: null - object_collection_ids: slice(None,None,None) - preserve_order: false - command_name: ee_pose_4 - weight: -0.2 - end_effector_5_position_tracking: - func: HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp.rewards:position_command_error - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: slice(None,None,None) - fixed_tendon_names: null - fixed_tendon_ids: slice(None,None,None) - body_names: - - TIP_B_5 - body_ids: slice(None,None,None) - object_collection_names: null - object_collection_ids: slice(None,None,None) - preserve_order: false - command_name: ee_pose_5 - weight: -0.2 - end_effector_position_tracking_fine_grained: - func: HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp.rewards:position_command_error_tanh - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: slice(None,None,None) - fixed_tendon_names: null - fixed_tendon_ids: slice(None,None,None) - body_names: - - TIP_B_1 - body_ids: slice(None,None,None) - object_collection_names: null - object_collection_ids: slice(None,None,None) - preserve_order: false - std: 0.1 - command_name: ee_pose - weight: 0.1 - end_effector_2_position_tracking_fine_grained: - func: HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp.rewards:position_command_error_tanh - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: slice(None,None,None) - fixed_tendon_names: null - fixed_tendon_ids: slice(None,None,None) - body_names: - - TIP_B_2 - body_ids: slice(None,None,None) - object_collection_names: null - object_collection_ids: slice(None,None,None) - preserve_order: false - std: 0.1 - command_name: ee_pose_2 - weight: 0.1 - end_effector_3_position_tracking_fine_grained: - func: HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp.rewards:position_command_error_tanh - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: slice(None,None,None) - fixed_tendon_names: null - fixed_tendon_ids: slice(None,None,None) - body_names: - - TIP_B_3 - body_ids: slice(None,None,None) - object_collection_names: null - object_collection_ids: slice(None,None,None) - preserve_order: false - std: 0.1 - command_name: ee_pose_3 - weight: 0.1 - end_effector_4_position_tracking_fine_grained: - func: HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp.rewards:position_command_error_tanh - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: slice(None,None,None) - fixed_tendon_names: null - fixed_tendon_ids: slice(None,None,None) - body_names: - - TIP_B_4 - body_ids: slice(None,None,None) - object_collection_names: null - object_collection_ids: slice(None,None,None) - preserve_order: false - std: 0.1 - command_name: ee_pose_4 - weight: 0.1 - end_effector_5_position_tracking_fine_grained: - func: HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp.rewards:position_command_error_tanh - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: slice(None,None,None) - fixed_tendon_names: null - fixed_tendon_ids: slice(None,None,None) - body_names: - - TIP_B_5 - body_ids: slice(None,None,None) - object_collection_names: null - object_collection_ids: slice(None,None,None) - preserve_order: false - std: 0.1 - command_name: ee_pose_5 - weight: 0.1 - action_rate: - func: isaaclab.envs.mdp.rewards:action_rate_l2 - params: {} - weight: -0.0001 - joint_vel: - func: isaaclab.envs.mdp.rewards:joint_vel_l2 - params: - asset_cfg: - name: robot - joint_names: null - joint_ids: slice(None,None,None) - fixed_tendon_names: null - fixed_tendon_ids: slice(None,None,None) - body_names: null - body_ids: slice(None,None,None) - object_collection_names: null - object_collection_ids: slice(None,None,None) - preserve_order: false - weight: -0.0001 - terminations: - time_out: - func: isaaclab.envs.mdp.terminations:time_out - params: {} - time_out: true - curriculum: - action_rate: - func: isaaclab.envs.mdp.curriculums:modify_reward_weight - params: - term_name: action_rate - weight: -0.005 - num_steps: 4500 - joint_vel: - func: isaaclab.envs.mdp.curriculums:modify_reward_weight - params: - term_name: joint_vel - weight: -0.001 - num_steps: 4500 - commands: - ee_pose: - class_type: isaaclab.envs.mdp.commands.pose_command:UniformPoseCommand - resampling_time_range: - - 4.0 - - 4.0 - debug_vis: true - asset_name: robot - body_name: TIP_B_1 - make_quat_unique: false - ranges: - pos_x: - - 0.07346 - - 0.07346 - pos_y: - - 0.13 - - 0.1455 - pos_z: - - 0.09 - - 0.1005 - roll: - - 0.0 - - 0.0 - pitch: - - 0.0 - - 0.0 - yaw: - - 0.0 - - 0.0 - goal_pose_visualizer_cfg: - prim_path: /Visuals/Command/goal_pose - markers: - frame: - func: isaaclab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - deformable_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - scale: - - 0.02 - - 0.02 - - 0.02 - articulation_props: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.5/Isaac/Props/UIElements/frame_prim.usd - variants: null - current_pose_visualizer_cfg: - prim_path: /Visuals/Command/body_pose - markers: - frame: - func: isaaclab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - deformable_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - scale: - - 0.02 - - 0.02 - - 0.02 - articulation_props: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.5/Isaac/Props/UIElements/frame_prim.usd - variants: null - ee_pose_2: - class_type: isaaclab.envs.mdp.commands.pose_command:UniformPoseCommand - resampling_time_range: - - 4.0 - - 4.0 - debug_vis: true - asset_name: robot - body_name: TIP_B_2 - make_quat_unique: false - ranges: - pos_x: - - 0.04746 - - 0.04746 - pos_y: - - 0.15406 - - 0.15558 - pos_z: - - 0.098 - - 0.10058 - roll: - - 0.0 - - 0.0 - pitch: - - 0.0 - - 0.0 - yaw: - - 0.0 - - 0.0 - goal_pose_visualizer_cfg: - prim_path: /Visuals/Command/goal_pose - markers: - frame: - func: isaaclab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - deformable_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - scale: - - 0.02 - - 0.02 - - 0.02 - articulation_props: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.5/Isaac/Props/UIElements/frame_prim.usd - variants: null - current_pose_visualizer_cfg: - prim_path: /Visuals/Command/body_pose - markers: - frame: - func: isaaclab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - deformable_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - scale: - - 0.02 - - 0.02 - - 0.02 - articulation_props: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.5/Isaac/Props/UIElements/frame_prim.usd - variants: null - ee_pose_3: - class_type: isaaclab.envs.mdp.commands.pose_command:UniformPoseCommand - resampling_time_range: - - 4.0 - - 4.0 - debug_vis: true - asset_name: robot - body_name: TIP_B_3 - make_quat_unique: false - ranges: - pos_x: - - 0.01996 - - 0.01996 - pos_y: - - 0.134 - - 0.145 - pos_z: - - 0.09 - - 0.11 - roll: - - 0.0 - - 0.0 - pitch: - - 0.0 - - 0.0 - yaw: - - 0.0 - - 0.0 - goal_pose_visualizer_cfg: - prim_path: /Visuals/Command/goal_pose - markers: - frame: - func: isaaclab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - deformable_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - scale: - - 0.02 - - 0.02 - - 0.02 - articulation_props: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.5/Isaac/Props/UIElements/frame_prim.usd - variants: null - current_pose_visualizer_cfg: - prim_path: /Visuals/Command/body_pose - markers: - frame: - func: isaaclab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - deformable_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - scale: - - 0.02 - - 0.02 - - 0.02 - articulation_props: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.5/Isaac/Props/UIElements/frame_prim.usd - variants: null - ee_pose_4: - class_type: isaaclab.envs.mdp.commands.pose_command:UniformPoseCommand - resampling_time_range: - - 4.0 - - 4.0 - debug_vis: true - asset_name: robot - body_name: TIP_B_4 - make_quat_unique: false - ranges: - pos_x: - - -0.00754 - - -0.00754 - pos_y: - - 0.119 - - 0.13 - pos_z: - - 0.09 - - 0.1 - roll: - - 0.0 - - 0.0 - pitch: - - 0.0 - - 0.0 - yaw: - - 0.0 - - 0.0 - goal_pose_visualizer_cfg: - prim_path: /Visuals/Command/goal_pose - markers: - frame: - func: isaaclab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - deformable_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - scale: - - 0.02 - - 0.02 - - 0.02 - articulation_props: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.5/Isaac/Props/UIElements/frame_prim.usd - variants: null - current_pose_visualizer_cfg: - prim_path: /Visuals/Command/body_pose - markers: - frame: - func: isaaclab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - deformable_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - scale: - - 0.02 - - 0.02 - - 0.02 - articulation_props: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.5/Isaac/Props/UIElements/frame_prim.usd - variants: null - ee_pose_5: - class_type: isaaclab.envs.mdp.commands.pose_command:UniformPoseCommand - resampling_time_range: - - 4.0 - - 4.0 - debug_vis: true - asset_name: robot - body_name: TIP_B_5 - make_quat_unique: false - ranges: - pos_x: - - 0.0869 - - 0.0869 - pos_y: - - 0.04 - - 0.052 - pos_z: - - 0.17 - - 0.17248 - roll: - - 0.0 - - 0.0 - pitch: - - 0.0 - - 0.0 - yaw: - - 0.0 - - 0.0 - goal_pose_visualizer_cfg: - prim_path: /Visuals/Command/goal_pose - markers: - frame: - func: isaaclab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - deformable_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - scale: - - 0.02 - - 0.02 - - 0.02 - articulation_props: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.5/Isaac/Props/UIElements/frame_prim.usd - variants: null - current_pose_visualizer_cfg: - prim_path: /Visuals/Command/body_pose - markers: - frame: - func: isaaclab.sim.spawners.from_files.from_files:spawn_from_usd - visible: true - semantic_tags: null - copy_from_source: true - mass_props: null - deformable_props: null - rigid_props: null - collision_props: null - activate_contact_sensors: false - scale: - - 0.02 - - 0.02 - - 0.02 - articulation_props: null - fixed_tendons_props: null - joint_drive_props: null - visual_material_path: material - visual_material: null - usd_path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/4.5/Isaac/Props/UIElements/frame_prim.usd - variants: null -agent: - seed: 42 - device: cuda:0 - num_steps_per_env: 24 - max_iterations: 1000 - empirical_normalization: false - policy: - class_name: ActorCritic - init_noise_std: 1.0 - noise_std_type: scalar - actor_hidden_dims: - - 64 - - 64 - critic_hidden_dims: - - 64 - - 64 - activation: elu - algorithm: - class_name: PPO - num_learning_epochs: 8 - num_mini_batches: 4 - learning_rate: 0.001 - schedule: adaptive - gamma: 0.99 - lam: 0.95 - entropy_coef: 0.01 - desired_kl: 0.01 - max_grad_norm: 1.0 - value_loss_coef: 1.0 - use_clipped_value_loss: true - clip_param: 0.2 - normalize_advantage_per_mini_batch: false - symmetry_cfg: null - rnd_cfg: null - clip_actions: null - save_interval: 50 - experiment_name: reach_humanoid_hand - run_name: '' - logger: tensorboard - neptune_project: isaaclab - wandb_project: isaaclab - resume: false - load_run: .* - load_checkpoint: model_.*.pt diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/outputs/2025-07-02/23-27-01/.hydra/hydra.yaml b/autonomy/simulation/Humanoid_RL/HumanoidRL/outputs/2025-07-02/23-27-01/.hydra/hydra.yaml deleted file mode 100644 index 600800b..0000000 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/outputs/2025-07-02/23-27-01/.hydra/hydra.yaml +++ /dev/null @@ -1,154 +0,0 @@ -hydra: - run: - dir: outputs/${now:%Y-%m-%d}/${now:%H-%M-%S} - sweep: - dir: multirun/${now:%Y-%m-%d}/${now:%H-%M-%S} - subdir: ${hydra.job.num} - launcher: - _target_: hydra._internal.core_plugins.basic_launcher.BasicLauncher - sweeper: - _target_: hydra._internal.core_plugins.basic_sweeper.BasicSweeper - max_batch_size: null - params: null - help: - app_name: ${hydra.job.name} - header: '${hydra.help.app_name} is powered by Hydra. - - ' - footer: 'Powered by Hydra (https://hydra.cc) - - Use --hydra-help to view Hydra specific help - - ' - template: '${hydra.help.header} - - == Configuration groups == - - Compose your configuration from those groups (group=option) - - - $APP_CONFIG_GROUPS - - - == Config == - - Override anything in the config (foo.bar=value) - - - $CONFIG - - - ${hydra.help.footer} - - ' - hydra_help: - template: 'Hydra (${hydra.runtime.version}) - - See https://hydra.cc for more info. - - - == Flags == - - $FLAGS_HELP - - - == Configuration groups == - - Compose your configuration from those groups (For example, append hydra/job_logging=disabled - to command line) - - - $HYDRA_CONFIG_GROUPS - - - Use ''--cfg hydra'' to Show the Hydra config. - - ' - hydra_help: ??? - hydra_logging: - version: 1 - formatters: - simple: - format: '[%(asctime)s][HYDRA] %(message)s' - handlers: - console: - class: logging.StreamHandler - formatter: simple - stream: ext://sys.stdout - root: - level: INFO - handlers: - - console - loggers: - logging_example: - level: DEBUG - disable_existing_loggers: false - job_logging: - version: 1 - formatters: - simple: - format: '[%(asctime)s][%(name)s][%(levelname)s] - %(message)s' - handlers: - console: - class: logging.StreamHandler - formatter: simple - stream: ext://sys.stdout - file: - class: logging.FileHandler - formatter: simple - filename: ${hydra.runtime.output_dir}/${hydra.job.name}.log - root: - level: INFO - handlers: - - console - - file - disable_existing_loggers: false - env: {} - mode: RUN - searchpath: [] - callbacks: {} - output_subdir: .hydra - overrides: - hydra: - - hydra.mode=RUN - task: [] - job: - name: hydra - chdir: null - override_dirname: '' - id: ??? - num: ??? - config_name: Isaac-Reach-Humanoid-Hand-v0 - env_set: {} - env_copy: [] - config: - override_dirname: - kv_sep: '=' - item_sep: ',' - exclude_keys: [] - runtime: - version: 1.3.2 - version_base: '1.3' - cwd: /home/hy/Downloads/Humanoid_Wato/HumanoidRL - config_sources: - - path: hydra.conf - schema: pkg - provider: hydra - - path: isaaclab_tasks.utils - schema: pkg - provider: main - - path: '' - schema: structured - provider: schema - output_dir: /home/hy/Downloads/Humanoid_Wato/HumanoidRL/outputs/2025-07-02/23-27-01 - choices: - hydra/env: default - hydra/callbacks: null - hydra/job_logging: default - hydra/hydra_logging: default - hydra/hydra_help: default - hydra/help: default - hydra/sweeper: basic - hydra/launcher: basic - hydra/output: default - verbose: false diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/outputs/2025-07-02/23-27-01/.hydra/overrides.yaml b/autonomy/simulation/Humanoid_RL/HumanoidRL/outputs/2025-07-02/23-27-01/.hydra/overrides.yaml deleted file mode 100644 index fe51488..0000000 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/outputs/2025-07-02/23-27-01/.hydra/overrides.yaml +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/outputs/2025-07-02/23-27-01/hydra.log b/autonomy/simulation/Humanoid_RL/HumanoidRL/outputs/2025-07-02/23-27-01/hydra.log deleted file mode 100644 index e69de29..0000000 diff --git a/autonomy/simulation/Humanoid_RL/models/reach_model.pt b/autonomy/simulation/Humanoid_RL/models/reach_model.pt deleted file mode 100644 index 400c9b9..0000000 Binary files a/autonomy/simulation/Humanoid_RL/models/reach_model.pt and /dev/null differ diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/config/extension.toml b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/config/extension.toml similarity index 100% rename from autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/config/extension.toml rename to autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/config/extension.toml diff --git a/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/modelCfg/humanoid.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/modelCfg/humanoid.py new file mode 100644 index 0000000..fe50dab --- /dev/null +++ b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/modelCfg/humanoid.py @@ -0,0 +1,164 @@ +import os + +import isaaclab.sim as sim_utils +from isaaclab.actuators import ImplicitActuatorCfg +from isaaclab.assets.articulation import ArticulationCfg + +_HUMANOID_WATO_ROOT = os.path.abspath( + os.path.join(os.path.dirname(__file__), "..", "..", "..", "..", "..") +) +_MODEL_ASSETS = os.path.join(_HUMANOID_WATO_ROOT, "ModelAssets") + +HAND_CFG = ArticulationCfg( + spawn=sim_utils.UsdFileCfg( + usd_path=os.path.join(_MODEL_ASSETS, "hand.usd"), + rigid_props=sim_utils.RigidBodyPropertiesCfg( + disable_gravity=False, + max_depenetration_velocity=5.0, + ), + activate_contact_sensors=False, + ), + init_state = ArticulationCfg.InitialStateCfg( + joint_pos={ + "Revolute_1": 0.0, + "Revolute_2": 0.0, + "Revolute_3": 0.0, + "Revolute_4": 0.0, + "Revolute_5": 0.0, + "Revolute_6": 0.0, + "Revolute_7": 0.0, + "Revolute_8": 0.0, + "Revolute_9": 0.0, + "Revolute_10": 0.0, + "Revolute_11": 0.0, + "Revolute_12": 0.0, + "Revolute_13": 0.0, + "Revolute_14": 0.0, + "Revolute_15": 0.0, + } + ), + actuators={ + "arm": ImplicitActuatorCfg( + joint_names_expr=[".*"], + # velocity_limit=100.0, + # effort_limit=87.0, + stiffness=0.5, + damping=0.5, + ), + }, +) + +# Hand Arm +_ARM_USD_PATH = os.path.join(_MODEL_ASSETS, "arm.usd") +ARM_CFG = ArticulationCfg( + spawn=sim_utils.UsdFileCfg( + usd_path=_ARM_USD_PATH, + rigid_props=sim_utils.RigidBodyPropertiesCfg( + disable_gravity=False, + max_depenetration_velocity=5.0, + ), + activate_contact_sensors=False, + articulation_props=sim_utils.ArticulationRootPropertiesCfg( + enabled_self_collisions=True + ), + ), + init_state=ArticulationCfg.InitialStateCfg( + joint_pos={ + "shoulder_flexion_extension": 0.0, + "shoulder_abduction_adduction": 0.0, + "shoulder_rotation": 0.0, + "elbow_flexion_extension": 0.0, + "forearm_rotation": 0.0, + "wrist_extension": 0.0, + "mcp_index": 0.0, + "pip_index": 0.0, + "dip_index": 0.0, + "mcp_middle": 0.0, + "pip_middle": 0.0, + "dip_middle": 0.0, + "mcp_ring": 0.0, + "pip_ring": 0.0, + "dip_ring": 0.0, + "mcp_pinky": 0.0, + "pip_pinky": 0.0, + "dip_pinky": 0.0, + "cmc_thumb": 0.0, + "mcp_thumb": 0.79, # within limits [0.785, 2.531] + "ip_thumb": 0.0, + } + ), + actuators={ + # J≈1.20 kg·m², f=4.0 Hz, ζ=1.0 → k=757.6, d=60.3 + "shoulder_fe": ImplicitActuatorCfg( + joint_names_expr=["shoulder_flexion_extension"], + stiffness=757.6, + damping=60.3, + ), + # J≈0.95 kg·m², f=4.0 Hz, ζ=1.0 → k=600.0, d=47.7 + "shoulder_aa": ImplicitActuatorCfg( + joint_names_expr=["shoulder_abduction_adduction"], + stiffness=600.0, + damping=47.7, + ), + # J≈0.77 kg·m², f=4.5 Hz, ζ=1.0 → k=615.5, d=43.5 + "shoulder_rot": ImplicitActuatorCfg( + joint_names_expr=["shoulder_rotation"], + stiffness=615.5, + damping=43.5, + ), + # J≈0.77 kg·m², f=4.5 Hz, ζ=1.0 → k=615.5, d=43.5 + "elbow": ImplicitActuatorCfg( + joint_names_expr=["elbow_flexion_extension"], + stiffness=615.5, + damping=43.5, + ), + # J≈0.45 kg·m², f=5.0 Hz, ζ=1.0 → k=444.1, d=28.3 + "forearm": ImplicitActuatorCfg( + joint_names_expr=["forearm_rotation"], + stiffness=444.1, + damping=28.3, + ), + # J≈0.12 kg·m², f=6.0 Hz, ζ=1.0 → k=170.5, d=9.0 + "wrist": ImplicitActuatorCfg( + joint_names_expr=["wrist_extension"], + stiffness=170.5, + damping=9.0, + ), + # J≈0.0012 kg·m², f=8.0 Hz, ζ=1.0 → k=3.0, d=0.12 + "finger_mcp": ImplicitActuatorCfg( + joint_names_expr=["mcp_index", "mcp_middle", "mcp_ring", "mcp_pinky"], + stiffness=3.0, + damping=0.12, + ), + # J≈0.0006 kg·m², f=8.0 Hz, ζ=1.0 → k=1.5, d=0.06 + "finger_pip": ImplicitActuatorCfg( + joint_names_expr=["pip_index", "pip_middle", "pip_ring", "pip_pinky"], + stiffness=1.5, + damping=0.06, + ), + # J≈0.0002 kg·m², f=8.0 Hz, ζ=1.0 → k=0.5, d=0.02 + "finger_dip": ImplicitActuatorCfg( + joint_names_expr=["dip_index", "dip_middle", "dip_ring", "dip_pinky"], + stiffness=0.5, + damping=0.02, + ), + # J≈0.003 kg·m², f=8.0 Hz, ζ=1.0 → k=7.6, d=0.30 + "thumb_cmc": ImplicitActuatorCfg( + joint_names_expr=["cmc_thumb"], + stiffness=7.6, + damping=0.30, + ), + # J≈0.001 kg·m², f=8.0 Hz, ζ=1.0 → k=2.5, d=0.10 + "thumb_mcp": ImplicitActuatorCfg( + joint_names_expr=["mcp_thumb"], + stiffness=2.5, + damping=0.10, + ), + # J≈0.0002 kg·m², f=8.0 Hz, ζ=1.0 → k=0.5, d=0.02 + "thumb_ip": ImplicitActuatorCfg( + joint_names_expr=["ip_thumb"], + stiffness=0.5, + damping=0.02, + ), + }, +) \ No newline at end of file diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/setup.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/setup.py similarity index 89% rename from autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/setup.py rename to autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/setup.py index d0d327f..52c55b4 100644 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/setup.py +++ b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/setup.py @@ -13,11 +13,7 @@ # Obtain the extension data from the extension.toml file EXTENSION_PATH = os.path.dirname(os.path.realpath(__file__)) # Read the extension.toml file -EXTENSION_TOML_DATA = toml.load( - os.path.join( - EXTENSION_PATH, - "config", - "extension.toml")) +EXTENSION_TOML_DATA = toml.load(os.path.join(EXTENSION_PATH, "config", "extension.toml")) # Minimum dependencies required prior to installation INSTALL_REQUIRES = [ @@ -26,8 +22,7 @@ "torch==2.5.1", "torchvision>=0.14.1", # ensure compatibility with torch 1.13.1 # 5.26.0 introduced a breaking change, so we restricted it for now. - # See issue https://github.com/tensorflow/tensorboard/issues/6808 for - # details. + # See issue https://github.com/tensorflow/tensorboard/issues/6808 for details. "protobuf>=3.20.2, < 5.0.0", # basic logger "tensorboard", @@ -57,4 +52,4 @@ zip_safe=False, ) -# From Isaac Lab source/isaaclab_tasks/setup.py +# From Isaac Lab source/isaaclab_tasks/setup.py \ No newline at end of file diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/__init__.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/__init__.py similarity index 100% rename from autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/__init__.py rename to autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/__init__.py diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/__init__.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/__init__.py similarity index 100% rename from autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/__init__.py rename to autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/__init__.py diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/__init__.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/__init__.py similarity index 80% rename from autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/__init__.py rename to autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/__init__.py index 37d9b69..f3b1e13 100644 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/__init__.py +++ b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/__init__.py @@ -2,25 +2,25 @@ from . import agents gym.register( - id="Isaac-Reach-Humanoid-Hand-v0", + id="Isaac-Reach-Humanoid-Arm-v0", entry_point="isaaclab.envs:ManagerBasedRLEnv", disable_env_checker=True, kwargs={ - "env_cfg_entry_point": f"{__name__}.joint_pos_env_cfg:HumanoidHandReachEnvCfg", + "env_cfg_entry_point": f"{__name__}.joint_pos_env_cfg:HumanoidArmReachEnvCfg", "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", - "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:HumanoidHandReachPPORunnerCfg", + "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:HumanoidArmReachPPORunnerCfg", "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", }, ) gym.register( - id="Isaac-Reach-UR10-Play-v0", + id="Isaac-Reach-Humanoid-Arm-Play-v0", entry_point="isaaclab.envs:ManagerBasedRLEnv", disable_env_checker=True, kwargs={ - "env_cfg_entry_point": f"{__name__}.joint_pos_env_cfg:HumanoidHandReachEnvCfg_PLAY", + "env_cfg_entry_point": f"{__name__}.joint_pos_env_cfg:HumanoidArmReachEnvCfg_PLAY", "rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml", - "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:HumanoidHandReachPPORunnerCfg", + "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:HumanoidArmReachPPORunnerCfg", "skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml", }, ) diff --git a/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/agents/__init__.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/agents/__init__.py new file mode 100644 index 0000000..82e11e9 --- /dev/null +++ b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/agents/__init__.py @@ -0,0 +1,6 @@ +# Copyright (c) 2022-2025, The Isaac Lab Project Developers. +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause + +# From Isaac Lab source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/config//agents/__init__.py \ No newline at end of file diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/agents/rsl_rl_ppo_cfg.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/agents/rsl_rl_ppo_cfg.py similarity index 82% rename from autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/agents/rsl_rl_ppo_cfg.py rename to autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/agents/rsl_rl_ppo_cfg.py index ec8a196..0840515 100644 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/agents/rsl_rl_ppo_cfg.py +++ b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/agents/rsl_rl_ppo_cfg.py @@ -3,16 +3,16 @@ @configclass -class HumanoidHandReachPPORunnerCfg(RslRlOnPolicyRunnerCfg): +class HumanoidArmReachPPORunnerCfg(RslRlOnPolicyRunnerCfg): num_steps_per_env = 24 max_iterations = 1000 save_interval = 50 - experiment_name = "reach_humanoid_hand" + experiment_name = "reach_humanoid_arm" run_name = "" resume = False - empirical_normalization = False + empirical_normalization = True policy = RslRlPpoActorCriticCfg( - init_noise_std=1.0, + init_noise_std=0.5, actor_hidden_dims=[64, 64], critic_hidden_dims=[64, 64], activation="elu", diff --git a/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/joint_pos_env_cfg.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/joint_pos_env_cfg.py new file mode 100644 index 0000000..bee47db --- /dev/null +++ b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/HumanoidRLEnv/joint_pos_env_cfg.py @@ -0,0 +1,95 @@ +import math +from isaaclab.utils import configclass +import HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp as mdp +from HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.reach_env_cfg import ReachEnvCfg +# from HumanoidRLPackage.HumanoidRLSetup.modelCfg.universal_robots import UR10_CFG +from HumanoidRLPackage.HumanoidRLSetup.modelCfg.humanoid import ARM_CFG + + +@configclass +class HumanoidArmReachEnvCfg(ReachEnvCfg): + def __post_init__(self): + super().__post_init__() + + # self.scene.robot = UR10_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") + self.scene.robot = ARM_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") + + marker_scale = 0.02 + + self.commands.ee_pose.goal_pose_visualizer_cfg.markers["frame"].scale = (marker_scale, marker_scale, marker_scale) + self.commands.ee_pose.current_pose_visualizer_cfg.markers["frame"].scale = (marker_scale, marker_scale, marker_scale) + + # self.commands.ee_pose_2.goal_pose_visualizer_cfg.markers["frame"].scale = (marker_scale, marker_scale, marker_scale) + # self.commands.ee_pose_2.current_pose_visualizer_cfg.markers["frame"].scale = (marker_scale, marker_scale, marker_scale) + + # self.commands.ee_pose_3.goal_pose_visualizer_cfg.markers["frame"].scale = (marker_scale, marker_scale, marker_scale) + # self.commands.ee_pose_3.current_pose_visualizer_cfg.markers["frame"].scale = (marker_scale, marker_scale, marker_scale) + + # self.commands.ee_pose_4.goal_pose_visualizer_cfg.markers["frame"].scale = (marker_scale, marker_scale, marker_scale) + # self.commands.ee_pose_4.current_pose_visualizer_cfg.markers["frame"].scale = (marker_scale, marker_scale, marker_scale) + + # self.commands.ee_pose_5.goal_pose_visualizer_cfg.markers["frame"].scale = (marker_scale, marker_scale, marker_scale) + # self.commands.ee_pose_5.current_pose_visualizer_cfg.markers["frame"].scale = (marker_scale, marker_scale, marker_scale) + + # override events + self.events.reset_robot_joints.params["position_range"] = (0.75, 1.25) + # override rewards + self.rewards.end_effector_position_tracking.params["asset_cfg"].body_names = ["DIP_INDEX_v1_.*"] + self.rewards.end_effector_position_tracking_fine_grained.params["asset_cfg"].body_names = ["DIP_INDEX_v1_.*"] + # self.rewards.end_effector_orientation_tracking.params["asset_cfg"].body_names = ["DIP_INDEX_v1_.*"] + + # self.rewards.end_effector_2_position_tracking.params["asset_cfg"].body_names = ["DIP_MIDDLE_v1_.*"] + # self.rewards.end_effector_2_position_tracking_fine_grained.params["asset_cfg"].body_names = ["DIP_MIDDLE_v1_.*"] + # self.rewards.end_effector_2_orientation_tracking.params["asset_cfg"].body_names = ["DIP_MIDDLE_v1_.*"] + + # self.rewards.end_effector_3_position_tracking.params["asset_cfg"].body_names = ["DIP_RING_v1_.*"] + # self.rewards.end_effector_3_position_tracking_fine_grained.params["asset_cfg"].body_names = ["DIP_RING_v1_.*"] + # self.rewards.end_effector_3_orientation_tracking.params["asset_cfg"].body_names = ["DIP_RING_v1_.*"] + + # self.rewards.end_effector_4_position_tracking.params["asset_cfg"].body_names = ["DIP_PINKY_v1_.*"] + # self.rewards.end_effector_4_position_tracking_fine_grained.params["asset_cfg"].body_names = ["DIP_PINKY_v1_.*"] + # self.rewards.end_effector_4_orientation_tracking.params["asset_cfg"].body_names = ["DIP_PINKY_v1_.*"] + + # self.rewards.end_effector_5_position_tracking.params["asset_cfg"].body_names = ["IP_THUMB_v1_.*"] + # self.rewards.end_effector_5_position_tracking_fine_grained.params["asset_cfg"].body_names = ["IP_THUMB_v1_.*"] + # self.rewards.end_effector_5_orientation_tracking.params["asset_cfg"].body_names = ["TIP_B_5"] + + # override actions + self.actions.arm_action = mdp.JointPositionActionCfg( + asset_name="robot", joint_names=[".*"], scale=0.5, use_default_offset=True + ) + # override command generator body + # end-effector is along x-direction + self.commands.ee_pose.body_name = "DIP_INDEX_v1_.*" + # self.commands.ee_pose.ranges.pitch = (math.pi / 2, math.pi / 2) # this rotate the pose + + # self.commands.ee_pose_2.body_name = "DIP_MIDDLE_v1_.*" + # self.commands.ee_pose_2.ranges.pitch = (math.pi / 2, math.pi / 2) + + # self.commands.ee_pose_3.body_name = "DIP_RING_v1_.*" + # self.commands.ee_pose_3.ranges.pitch = (math.pi / 2, math.pi / 2) + + # self.commands.ee_pose_4.body_name = "DIP_PINKY_v1_.*" + # self.commands.ee_pose_4.ranges.pitch = (math.pi / 2, math.pi / 2) + + # self.commands.ee_pose_5.body_name = "IP_THUMB_v1_.*" + # self.commands.ee_pose_5.ranges.pitch = (math.pi / 2, math.pi / 2) + + # self.commands.ee_pose.ranges.yaw = (-math.pi / 2, -math.pi / 2) + # self.commands.ee_pose_2.ranges.yaw = (-math.pi / 2, -math.pi / 2) + + +@configclass +class HumanoidArmReachEnvCfg_PLAY(HumanoidArmReachEnvCfg): + def __post_init__(self): + # post init of parent + super().__post_init__() + # make a smaller scene for play + self.scene.num_envs = 50 + self.scene.env_spacing = 2.5 + # disable randomization for play + self.observations.policy.enable_corruption = False + +# (env_isaaclab) hy@hy-LOQ-15IRX9:~/Downloads/Humanoid_Wato/HumanoidRL$ PYTHONPATH=$(pwd) /home/hy/IsaacLab/isaaclab.sh -p HumanoidRLPackage/rsl_rl_scripts/train.py --task=Isaac-Reach-Humanoid-Arm-v0 --headless + +# (env_isaaclab) hy@hy-LOQ-15IRX9:~/Downloads/Humanoid_Wato/HumanoidRL$ PYTHONPATH=$(pwd) /home/hy/IsaacLab/isaaclab.sh -p HumanoidRLPackage/rsl_rl_scripts/play.py --task=Isaac-Reach-Humanoid-Arm-v0 --num_envs=1 \ No newline at end of file diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/__init__.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/__init__.py similarity index 100% rename from autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/__init__.py rename to autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/config/__init__.py diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/mdp/__init__.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/mdp/__init__.py similarity index 75% rename from autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/mdp/__init__.py rename to autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/mdp/__init__.py index 1c7d6fd..06b541d 100644 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/mdp/__init__.py +++ b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/mdp/__init__.py @@ -9,5 +9,4 @@ from .rewards import * # noqa: F401, F403 -# From Isaac Lab -# source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/mdp/__init__.py +# From Isaac Lab source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/mdp/__init__.py \ No newline at end of file diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/mdp/rewards.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/mdp/rewards.py similarity index 67% rename from autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/mdp/rewards.py rename to autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/mdp/rewards.py index 9fcf0fa..892f5a5 100644 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/mdp/rewards.py +++ b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/mdp/rewards.py @@ -16,10 +16,7 @@ from isaaclab.envs import ManagerBasedRLEnv -def position_command_error( - env: ManagerBasedRLEnv, - command_name: str, - asset_cfg: SceneEntityCfg) -> torch.Tensor: +def position_command_error(env: ManagerBasedRLEnv, command_name: str, asset_cfg: SceneEntityCfg) -> torch.Tensor: """Penalize tracking of the position error using L2-norm. The function computes the position error between the desired position (from the command) and the @@ -31,19 +28,14 @@ def position_command_error( command = env.command_manager.get_command(command_name) # obtain the desired and current positions des_pos_b = command[:, :3] - des_pos_w, _ = combine_frame_transforms( - asset.data.root_state_w[:, :3], asset.data.root_state_w[:, 3:7], des_pos_b) - curr_pos_w = asset.data.body_state_w[:, - asset_cfg.body_ids[0], - :3] # type: ignore + des_pos_w, _ = combine_frame_transforms(asset.data.root_state_w[:, :3], asset.data.root_state_w[:, 3:7], des_pos_b) + curr_pos_w = asset.data.body_state_w[:, asset_cfg.body_ids[0], :3] # type: ignore return torch.norm(curr_pos_w - des_pos_w, dim=1) def position_command_error_tanh( - env: ManagerBasedRLEnv, - std: float, - command_name: str, - asset_cfg: SceneEntityCfg) -> torch.Tensor: + env: ManagerBasedRLEnv, std: float, command_name: str, asset_cfg: SceneEntityCfg +) -> torch.Tensor: """Reward tracking of the position using the tanh kernel. The function computes the position error between the desired position (from the command) and the @@ -54,19 +46,13 @@ def position_command_error_tanh( command = env.command_manager.get_command(command_name) # obtain the desired and current positions des_pos_b = command[:, :3] - des_pos_w, _ = combine_frame_transforms( - asset.data.root_state_w[:, :3], asset.data.root_state_w[:, 3:7], des_pos_b) - curr_pos_w = asset.data.body_state_w[:, - asset_cfg.body_ids[0], - :3] # type: ignore + des_pos_w, _ = combine_frame_transforms(asset.data.root_state_w[:, :3], asset.data.root_state_w[:, 3:7], des_pos_b) + curr_pos_w = asset.data.body_state_w[:, asset_cfg.body_ids[0], :3] # type: ignore distance = torch.norm(curr_pos_w - des_pos_w, dim=1) return 1 - torch.tanh(distance / std) -def orientation_command_error( - env: ManagerBasedRLEnv, - command_name: str, - asset_cfg: SceneEntityCfg) -> torch.Tensor: +def orientation_command_error(env: ManagerBasedRLEnv, command_name: str, asset_cfg: SceneEntityCfg) -> torch.Tensor: """Penalize tracking orientation error using shortest path. The function computes the orientation error between the desired orientation (from the command) and the @@ -79,7 +65,5 @@ def orientation_command_error( # obtain the desired and current orientations des_quat_b = command[:, 3:7] des_quat_w = quat_mul(asset.data.root_state_w[:, 3:7], des_quat_b) - curr_quat_w = asset.data.body_state_w[:, - asset_cfg.body_ids[0], - 3:7] # type: ignore + curr_quat_w = asset.data.body_state_w[:, asset_cfg.body_ids[0], 3:7] # type: ignore return quat_error_magnitude(curr_quat_w, des_quat_w) diff --git a/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/reach_env_cfg.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/reach_env_cfg.py new file mode 100644 index 0000000..d74244b --- /dev/null +++ b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/HumanoidRLSetup/tasks/manipulation/reach_env_cfg.py @@ -0,0 +1,318 @@ +from dataclasses import MISSING + +import isaaclab.sim as sim_utils +from isaaclab.assets import ArticulationCfg, AssetBaseCfg +from isaaclab.envs import ManagerBasedRLEnvCfg +from isaaclab.managers import ActionTermCfg as ActionTerm +from isaaclab.managers import CurriculumTermCfg as CurrTerm +from isaaclab.managers import EventTermCfg as EventTerm +from isaaclab.managers import ObservationGroupCfg as ObsGroup +from isaaclab.managers import ObservationTermCfg as ObsTerm +from isaaclab.managers import RewardTermCfg as RewTerm +from isaaclab.managers import SceneEntityCfg +from isaaclab.managers import TerminationTermCfg as DoneTerm +from isaaclab.scene import InteractiveSceneCfg +from isaaclab.utils import configclass +from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR +from isaaclab.utils.noise import AdditiveUniformNoiseCfg as Unoise + +import HumanoidRLPackage.HumanoidRLSetup.tasks.manipulation.mdp as mdp + +@configclass +class ReachSceneCfg(InteractiveSceneCfg): + """Configuration for the scene with a robotic arm.""" + + # world + ground = AssetBaseCfg( + prim_path="/World/ground", + spawn=sim_utils.GroundPlaneCfg(), + init_state=AssetBaseCfg.InitialStateCfg(pos=(0.0, 0.0, -1.05)), + ) + + # robots + robot: ArticulationCfg = MISSING + + # lights + light = AssetBaseCfg( + prim_path="/World/light", + spawn=sim_utils.DomeLightCfg(color=(0.75, 0.75, 0.75), intensity=2500.0), + ) + + +## +# MDP settings +## + + +@configclass +class CommandsCfg: + """Command terms for the MDP.""" + + ee_pose = mdp.UniformPoseCommandCfg( + asset_name="robot", + body_name="DIP_INDEX_v1_.*", + resampling_time_range=(4.0, 4.0), + debug_vis=True, + ranges=mdp.UniformPoseCommandCfg.Ranges( + pos_x=(-0.5, 0.5), + pos_y=(0.62, 0.66), + pos_z=(0.3, 0.7), + roll=(0.0, 0.0), + pitch=(0.0, 0.0), + yaw=(0.0, 0.0), + ), + ) + + # ee_pose_2 = mdp.UniformPoseCommandCfg( + # asset_name="robot", + # body_name="DIP_MIDDLE_v1_.*", + # resampling_time_range=(4.0, 4.0), + # debug_vis=True, + # ranges=mdp.UniformPoseCommandCfg.Ranges( + # pos_x=(-0.20, -0.14), + # pos_y=(0.64, 0.68), + # pos_z=(0.38, 0.42), + # roll=(0.0, 0.0), + # pitch=(0.0, 0.0), + # yaw=(0.0, 0.0), + # ), + # ) + + # ee_pose_3 = mdp.UniformPoseCommandCfg( + # asset_name="robot", + # body_name="DIP_RING_v1_.*", + # resampling_time_range=(4.0, 4.0), + # debug_vis=True, + # ranges=mdp.UniformPoseCommandCfg.Ranges( + # pos_x=(-0.22, -0.16), + # pos_y=(0.62, 0.66), + # pos_z=(0.38, 0.42), + # roll=(0.0, 0.0), + # pitch=(0.0, 0.0), + # yaw=(0.0, 0.0), + # ), + # ) + + # ee_pose_4 = mdp.UniformPoseCommandCfg( + # asset_name="robot", + # body_name="DIP_PINKY_v1_.*", + # resampling_time_range=(4.0, 4.0), + # debug_vis=True, + # ranges=mdp.UniformPoseCommandCfg.Ranges( + # pos_x=(-0.24, -0.18), + # pos_y=(0.60, 0.64), + # pos_z=(0.38, 0.42), + # roll=(0.0, 0.0), + # pitch=(0.0, 0.0), + # yaw=(0.0, 0.0), + # ), + # ) + + # ee_pose_5 = mdp.UniformPoseCommandCfg( + # asset_name="robot", + # body_name="IP_THUMB_v1_.*", + # resampling_time_range=(4.0, 4.0), + # debug_vis=True, + # ranges=mdp.UniformPoseCommandCfg.Ranges( + # pos_x=(-0.16, -0.10), + # pos_y=(0.52, 0.58), + # pos_z=(0.44, 0.50), + # roll=(0.0, 0.0), + # pitch=(0.0, 0.0), + # yaw=(0.0, 0.0), + # ), + # ) + + +@configclass +class ActionsCfg: + """Action specifications for the MDP.""" + + arm_action: ActionTerm = MISSING + gripper_action: ActionTerm | None = None + + +@configclass +class ObservationsCfg: + """Observation specifications for the MDP.""" + + @configclass + class PolicyCfg(ObsGroup): + """Observations for policy group.""" + + # observation terms (order preserved) + joint_pos = ObsTerm(func=mdp.joint_pos_rel, noise=Unoise(n_min=-0.01, n_max=0.01)) + joint_vel = ObsTerm(func=mdp.joint_vel_rel, noise=Unoise(n_min=-0.01, n_max=0.01)) + + pose_command = ObsTerm(func=mdp.generated_commands, params={"command_name": "ee_pose"}) + # pose_command_2 = ObsTerm(func=mdp.generated_commands, params={"command_name": "ee_pose_2"}) + # pose_command_3 = ObsTerm(func=mdp.generated_commands, params={"command_name": "ee_pose_3"}) + # pose_command_4 = ObsTerm(func=mdp.generated_commands, params={"command_name": "ee_pose_4"}) + # pose_command_5 = ObsTerm(func=mdp.generated_commands, params={"command_name": "ee_pose_5"}) + + actions = ObsTerm(func=mdp.last_action) + + def __post_init__(self): + self.enable_corruption = True + self.concatenate_terms = True + + # observation groups + policy: PolicyCfg = PolicyCfg() + + +@configclass +class EventCfg: + """Configuration for events.""" + + reset_robot_joints = EventTerm( + func=mdp.reset_joints_by_scale, + mode="reset", + params={ + "position_range": (0.5, 1.5), + "velocity_range": (0.0, 0.0), + }, + ) + + +@configclass +class RewardsCfg: + """Reward terms for the MDP.""" + + # task terms + end_effector_position_tracking = RewTerm( + func=mdp.position_command_error, + weight=-0.2, + params={"asset_cfg": SceneEntityCfg("robot", body_names="DIP_INDEX_v1_.*"), "command_name": "ee_pose"}, + ) + # end_effector_2_position_tracking = RewTerm( + # func=mdp.position_command_error, + # weight=-0.2, + # params={"asset_cfg": SceneEntityCfg("robot", body_names="DIP_MIDDLE_v1_.*"), "command_name": "ee_pose_2"}, + # ) + # end_effector_3_position_tracking = RewTerm( + # func=mdp.position_command_error, + # weight=-0.2, + # params={"asset_cfg": SceneEntityCfg("robot", body_names="DIP_RING_v1_.*"), "command_name": "ee_pose_3"}, + # ) + # end_effector_4_position_tracking = RewTerm( + # func=mdp.position_command_error, + # weight=-0.2, + # params={"asset_cfg": SceneEntityCfg("robot", body_names="DIP_PINKY_v1_.*"), "command_name": "ee_pose_4"}, + # ) + # end_effector_5_position_tracking = RewTerm( + # func=mdp.position_command_error, + # weight=-0.2, + # params={"asset_cfg": SceneEntityCfg("robot", body_names="IP_THUMB_v1_.*"), "command_name": "ee_pose_5"}, + # ) + + end_effector_position_tracking_fine_grained = RewTerm( + func=mdp.position_command_error_tanh, + weight=0.2, + params={"asset_cfg": SceneEntityCfg("robot", body_names="DIP_INDEX_v1_.*"), "std": 0.1, "command_name": "ee_pose"}, + ) + # end_effector_2_position_tracking_fine_grained = RewTerm( + # func=mdp.position_command_error_tanh, + # weight=0.1, + # params={"asset_cfg": SceneEntityCfg("robot", body_names="DIP_MIDDLE_v1_.*"), "std": 0.1, "command_name": "ee_pose_2"}, + # ) + # end_effector_3_position_tracking_fine_grained = RewTerm( + # func=mdp.position_command_error_tanh, + # weight=0.1, + # params={"asset_cfg": SceneEntityCfg("robot", body_names="DIP_RING_v1_.*"), "std": 0.1, "command_name": "ee_pose_3"}, + # ) + # end_effector_4_position_tracking_fine_grained = RewTerm( + # func=mdp.position_command_error_tanh, + # weight=0.1, + # params={"asset_cfg": SceneEntityCfg("robot", body_names="DIP_PINKY_v1_.*"), "std": 0.1, "command_name": "ee_pose_4"}, + # ) + # end_effector_5_position_tracking_fine_grained = RewTerm( + # func=mdp.position_command_error_tanh, + # weight=0.1, + # params={"asset_cfg": SceneEntityCfg("robot", body_names="IP_THUMB_v1_.*"), "std": 0.1, "command_name": "ee_pose_5"}, + # ) + + # end_effector_orientation_tracking = RewTerm( + # func=mdp.orientation_command_error, + # weight=-0.1, + # params={"asset_cfg": SceneEntityCfg("robot", body_names="TIP_B_1"), "command_name": "ee_pose"}, + # ) + # end_effector_2_orientation_tracking = RewTerm( + # func=mdp.orientation_command_error, + # weight=-0.1, + # params={"asset_cfg": SceneEntityCfg("robot", body_names="TIP_B_2"), "command_name": "ee_pose_2"}, + # ) + # end_effector_3_orientation_tracking = RewTerm( + # func=mdp.orientation_command_error, + # weight=-0.1, + # params={"asset_cfg": SceneEntityCfg("robot", body_names="TIP_B_3"), "command_name": "ee_pose_3"}, + # ) + # end_effector_4_orientation_tracking = RewTerm( + # func=mdp.orientation_command_error, + # weight=-0.1, + # params={"asset_cfg": SceneEntityCfg("robot", body_names="TIP_B_4"), "command_name": "ee_pose_4"}, + # ) + # end_effector_5_orientation_tracking = RewTerm( + # func=mdp.orientation_command_error, + # weight=-0.1, + # params={"asset_cfg": SceneEntityCfg("robot", body_names="TIP_B_5"), "command_name": "ee_pose_5"}, + # ) + + # action penalty + action_rate = RewTerm(func=mdp.action_rate_l2, weight=-0.00001) + joint_vel = RewTerm( + func=mdp.joint_vel_l2, + weight=-0.0000001, + params={"asset_cfg": SceneEntityCfg("robot")}, + ) + + +@configclass +class TerminationsCfg: + """Termination terms for the MDP.""" + + time_out = DoneTerm(func=mdp.time_out, time_out=True) + + +@configclass +class CurriculumCfg: + """Curriculum terms for the MDP.""" + + action_rate = CurrTerm( + func=mdp.modify_reward_weight, params={"term_name": "action_rate", "weight": -0.0001, "num_steps": 4500} + ) + + joint_vel = CurrTerm( + func=mdp.modify_reward_weight, params={"term_name": "joint_vel", "weight": -0.001, "num_steps": 4500} + ) + + +## +# Environment configuration +## + + +@configclass +class ReachEnvCfg(ManagerBasedRLEnvCfg): + """Configuration for the reach end-effector pose tracking environment.""" + + # Scene settings + scene: ReachSceneCfg = ReachSceneCfg(num_envs=4096, env_spacing=2.5) + # Basic settings + observations: ObservationsCfg = ObservationsCfg() + actions: ActionsCfg = ActionsCfg() + commands: CommandsCfg = CommandsCfg() + # MDP settings + rewards: RewardsCfg = RewardsCfg() + terminations: TerminationsCfg = TerminationsCfg() + events: EventCfg = EventCfg() + curriculum: CurriculumCfg = CurriculumCfg() + + def __post_init__(self): + """Post initialization.""" + # general settings + self.decimation = 4 # policy every 4 physics steps (was 2) → smoother target updates + self.sim.render_interval = self.decimation + self.episode_length_s = 12.0 + self.viewer.eye = (3.5, 3.5, 3.5) + # simulation settings + self.sim.dt = 1.0 / 60.0 \ No newline at end of file diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/cli_args.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/cli_args.py similarity index 67% rename from autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/cli_args.py rename to autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/cli_args.py index 8647a9a..176d61b 100644 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/cli_args.py +++ b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/cli_args.py @@ -20,43 +20,26 @@ def add_rsl_rl_args(parser: argparse.ArgumentParser): parser: The parser to add the arguments to. """ # create a new argument group - arg_group = parser.add_argument_group( - "rsl_rl", description="Arguments for RSL-RL agent.") + arg_group = parser.add_argument_group("rsl_rl", description="Arguments for RSL-RL agent.") # -- experiment arguments arg_group.add_argument( - "--experiment_name", - type=str, - default=None, - help="Name of the experiment folder where logs will be stored.") - arg_group.add_argument("--run_name", type=str, default=None, - help="Run name suffix to the log directory.") + "--experiment_name", type=str, default=None, help="Name of the experiment folder where logs will be stored." + ) + arg_group.add_argument("--run_name", type=str, default=None, help="Run name suffix to the log directory.") # -- load arguments - arg_group.add_argument("--resume", type=bool, default=None, - help="Whether to resume from a checkpoint.") - arg_group.add_argument("--load_run", type=str, default=None, - help="Name of the run folder to resume from.") - arg_group.add_argument("--checkpoint", type=str, default=None, - help="Checkpoint file to resume from.") + arg_group.add_argument("--resume", type=bool, default=None, help="Whether to resume from a checkpoint.") + arg_group.add_argument("--load_run", type=str, default=None, help="Name of the run folder to resume from.") + arg_group.add_argument("--checkpoint", type=str, default=None, help="Checkpoint file to resume from.") # -- logger arguments arg_group.add_argument( - "--logger", - type=str, - default=None, - choices={ - "wandb", - "tensorboard", - "neptune"}, - help="Logger module to use.") + "--logger", type=str, default=None, choices={"wandb", "tensorboard", "neptune"}, help="Logger module to use." + ) arg_group.add_argument( - "--log_project_name", - type=str, - default=None, - help="Name of the logging project when using wandb or neptune.") + "--log_project_name", type=str, default=None, help="Name of the logging project when using wandb or neptune." + ) -def parse_rsl_rl_cfg( - task_name: str, - args_cli: argparse.Namespace) -> RslRlOnPolicyRunnerCfg: +def parse_rsl_rl_cfg(task_name: str, args_cli: argparse.Namespace) -> RslRlOnPolicyRunnerCfg: """Parse configuration for RSL-RL agent based on inputs. Args: @@ -69,15 +52,12 @@ def parse_rsl_rl_cfg( from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry # load the default configuration - rslrl_cfg: RslRlOnPolicyRunnerCfg = load_cfg_from_registry( - task_name, "rsl_rl_cfg_entry_point") + rslrl_cfg: RslRlOnPolicyRunnerCfg = load_cfg_from_registry(task_name, "rsl_rl_cfg_entry_point") rslrl_cfg = update_rsl_rl_cfg(rslrl_cfg, args_cli) return rslrl_cfg -def update_rsl_rl_cfg( - agent_cfg: RslRlOnPolicyRunnerCfg, - args_cli: argparse.Namespace): +def update_rsl_rl_cfg(agent_cfg: RslRlOnPolicyRunnerCfg, args_cli: argparse.Namespace): """Update configuration for RSL-RL agent based on inputs. Args: @@ -110,4 +90,4 @@ def update_rsl_rl_cfg( return agent_cfg -# From Isaac Lab scripts/reinforcement_learning/rsl_rl/cli_args.py +# From Isaac Lab scripts/reinforcement_learning/rsl_rl/cli_args.py \ No newline at end of file diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/play.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/play.py similarity index 74% rename from autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/play.py rename to autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/play.py index a6b3526..b982c23 100644 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/play.py +++ b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/play.py @@ -7,45 +7,28 @@ """Launch Isaac Sim Simulator first.""" - -from isaaclab_tasks.utils import get_checkpoint_path, parse_env_cfg -from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper, export_policy_as_jit, export_policy_as_onnx -from isaaclab.utils.pretrained_checkpoint import get_published_pretrained_checkpoint -from isaaclab.utils.dict import print_dict -from isaaclab.utils.assets import retrieve_file_path -from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent -from rsl_rl.runners import OnPolicyRunner -import torch -import time -import os -import gymnasium as gym -import cli_args # isort: skip import argparse + from isaaclab.app import AppLauncher # local imports +import cli_args # isort: skip # add argparse arguments parser = argparse.ArgumentParser(description="Train an RL agent with RSL-RL.") -parser.add_argument("--video", action="store_true", default=False, - help="Record videos during training.") -parser.add_argument("--video_length", type=int, default=200, - help="Length of the recorded video (in steps).") +parser.add_argument("--video", action="store_true", default=False, help="Record videos during training.") +parser.add_argument("--video_length", type=int, default=200, help="Length of the recorded video (in steps).") parser.add_argument( - "--disable_fabric", - action="store_true", - default=False, - help="Disable fabric and use USD I/O operations.") -parser.add_argument("--num_envs", type=int, default=None, - help="Number of environments to simulate.") + "--disable_fabric", action="store_true", default=False, help="Disable fabric and use USD I/O operations." +) +parser.add_argument("--num_envs", type=int, default=None, help="Number of environments to simulate.") parser.add_argument("--task", type=str, default=None, help="Name of the task.") parser.add_argument( "--use_pretrained_checkpoint", action="store_true", help="Use the pre-trained checkpoint from Nucleus.", ) -parser.add_argument("--real-time", action="store_true", default=False, - help="Run in real-time, if possible.") +parser.add_argument("--real-time", action="store_true", default=False, help="Run in real-time, if possible.") # append RSL-RL cli arguments cli_args.add_rsl_rl_args(parser) # append AppLauncher cli args @@ -61,45 +44,50 @@ """Rest everything follows.""" +import gymnasium as gym +import os +import time +import torch + +from rsl_rl.runners import OnPolicyRunner + +from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent +from isaaclab.utils.assets import retrieve_file_path +from isaaclab.utils.dict import print_dict +from isaaclab.utils.pretrained_checkpoint import get_published_pretrained_checkpoint + +from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper, export_policy_as_jit, export_policy_as_onnx import HumanoidRLPackage.HumanoidRLSetup.tasks # noqa: F401 +from isaaclab_tasks.utils import get_checkpoint_path, parse_env_cfg def main(): """Play with RSL-RL agent.""" # parse configuration env_cfg = parse_env_cfg( - args_cli.task, - device=args_cli.device, - num_envs=args_cli.num_envs, - use_fabric=not args_cli.disable_fabric) - agent_cfg: RslRlOnPolicyRunnerCfg = cli_args.parse_rsl_rl_cfg( - args_cli.task, args_cli) + args_cli.task, device=args_cli.device, num_envs=args_cli.num_envs, use_fabric=not args_cli.disable_fabric + ) + agent_cfg: RslRlOnPolicyRunnerCfg = cli_args.parse_rsl_rl_cfg(args_cli.task, args_cli) # specify directory for logging experiments log_root_path = os.path.join("logs", "rsl_rl", agent_cfg.experiment_name) log_root_path = os.path.abspath(log_root_path) print(f"[INFO] Loading experiment from directory: {log_root_path}") if args_cli.use_pretrained_checkpoint: - resume_path = get_published_pretrained_checkpoint( - "rsl_rl", args_cli.task) + resume_path = get_published_pretrained_checkpoint("rsl_rl", args_cli.task) if not resume_path: - print( - "[INFO] Unfortunately a pre-trained checkpoint is currently unavailable for this task.") + print("[INFO] Unfortunately a pre-trained checkpoint is currently unavailable for this task.") return elif args_cli.checkpoint: resume_path = retrieve_file_path(args_cli.checkpoint) else: - resume_path = get_checkpoint_path( - log_root_path, agent_cfg.load_run, agent_cfg.load_checkpoint) + resume_path = get_checkpoint_path(log_root_path, agent_cfg.load_run, agent_cfg.load_checkpoint) log_dir = os.path.dirname(resume_path) # create isaac environment - env = gym.make( - args_cli.task, - cfg=env_cfg, - render_mode="rgb_array" if args_cli.video else None) + env = gym.make(args_cli.task, cfg=env_cfg, render_mode="rgb_array" if args_cli.video else None) # convert to single-agent instance if required by the RL algorithm if isinstance(env.unwrapped, DirectMARLEnv): @@ -122,11 +110,7 @@ def main(): print(f"[INFO]: Loading model checkpoint from: {resume_path}") # load previously trained model - ppo_runner = OnPolicyRunner( - env, - agent_cfg.to_dict(), - log_dir=None, - device=agent_cfg.device) + ppo_runner = OnPolicyRunner(env, agent_cfg.to_dict(), log_dir=None, device=agent_cfg.device) ppo_runner.load(resume_path) # obtain the trained policy for inference @@ -136,13 +120,10 @@ def main(): # export policy to onnx/jit export_model_dir = os.path.join(os.path.dirname(resume_path), "exported") - export_policy_as_jit(policy_nn, ppo_runner.obs_normalizer, - path=export_model_dir, filename="policy.pt") + export_policy_as_jit(policy_nn, ppo_runner.obs_normalizer, path=export_model_dir, filename="policy.pt") export_policy_as_onnx( - policy_nn, - normalizer=ppo_runner.obs_normalizer, - path=export_model_dir, - filename="policy.onnx") + policy_nn, normalizer=ppo_runner.obs_normalizer, path=export_model_dir, filename="policy.onnx" + ) dt = env.unwrapped.physics_dt @@ -179,4 +160,4 @@ def main(): # close sim app simulation_app.close() -# From Isaac Lab scripts/reinforcement_learning/rsl_rl/play.py +# From Isaac Lab scripts/reinforcement_learning/rsl_rl/play.py \ No newline at end of file diff --git a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/train.py b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/train.py similarity index 76% rename from autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/train.py rename to autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/train.py index 64ac7ed..be4af5e 100644 --- a/autonomy/simulation/Humanoid_RL/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/train.py +++ b/autonomy/simulation/Humanoid_Wato/HumanoidRL/HumanoidRLPackage/rsl_rl_scripts/train.py @@ -7,47 +7,24 @@ """Launch Isaac Sim Simulator first.""" -from isaaclab_tasks.utils.hydra import hydra_task_config -from isaaclab_tasks.utils import get_checkpoint_path -from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper -from isaaclab.utils.io import dump_pickle, dump_yaml -from isaaclab.utils.dict import print_dict -from isaaclab.envs import ( - DirectMARLEnv, - DirectMARLEnvCfg, - DirectRLEnvCfg, - ManagerBasedRLEnvCfg, - multi_agent_to_single_agent, -) -from rsl_rl.runners import OnPolicyRunner -from datetime import datetime -import torch -import os -import gymnasium as gym -import cli_args # isort: skip -from isaaclab.app import AppLauncher import argparse import sys +from isaaclab.app import AppLauncher # local imports +import cli_args # isort: skip # add argparse arguments parser = argparse.ArgumentParser(description="Train an RL agent with RSL-RL.") -parser.add_argument("--video", action="store_true", default=False, - help="Record videos during training.") -parser.add_argument("--video_length", type=int, default=200, - help="Length of the recorded video (in steps).") -parser.add_argument("--video_interval", type=int, default=2000, - help="Interval between video recordings (in steps).") -parser.add_argument("--num_envs", type=int, default=None, - help="Number of environments to simulate.") +parser.add_argument("--video", action="store_true", default=False, help="Record videos during training.") +parser.add_argument("--video_length", type=int, default=200, help="Length of the recorded video (in steps).") +parser.add_argument("--video_interval", type=int, default=2000, help="Interval between video recordings (in steps).") +parser.add_argument("--num_envs", type=int, default=None, help="Number of environments to simulate.") parser.add_argument("--task", type=str, default=None, help="Name of the task.") -parser.add_argument("--seed", type=int, default=None, - help="Seed used for the environment") -parser.add_argument("--max_iterations", type=int, default=None, - help="RL Policy training iterations.") +parser.add_argument("--seed", type=int, default=None, help="Seed used for the environment") +parser.add_argument("--max_iterations", type=int, default=None, help="RL Policy training iterations.") # append RSL-RL cli arguments cli_args.add_rsl_rl_args(parser) # append AppLauncher cli args @@ -67,8 +44,28 @@ """Rest everything follows.""" +import gymnasium as gym +import os +import torch +from datetime import datetime + +from rsl_rl.runners import OnPolicyRunner + +from isaaclab.envs import ( + DirectMARLEnv, + DirectMARLEnvCfg, + DirectRLEnvCfg, + ManagerBasedRLEnvCfg, + multi_agent_to_single_agent, +) +from isaaclab.utils.dict import print_dict +from isaaclab.utils.io import dump_pickle, dump_yaml + +from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper import HumanoidRLPackage.HumanoidRLSetup.tasks # noqa: F401 +from isaaclab_tasks.utils import get_checkpoint_path +from isaaclab_tasks.utils.hydra import hydra_task_config torch.backends.cuda.matmul.allow_tf32 = True torch.backends.cudnn.allow_tf32 = True @@ -77,18 +74,17 @@ @hydra_task_config(args_cli.task, "rsl_rl_cfg_entry_point") -def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | - DirectMARLEnvCfg, agent_cfg: RslRlOnPolicyRunnerCfg): +def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agent_cfg: RslRlOnPolicyRunnerCfg): """Train with RSL-RL agent.""" # override configurations with non-hydra CLI arguments agent_cfg = cli_args.update_rsl_rl_cfg(agent_cfg, args_cli) env_cfg.scene.num_envs = args_cli.num_envs if args_cli.num_envs is not None else env_cfg.scene.num_envs agent_cfg.max_iterations = ( - args_cli.max_iterations if args_cli.max_iterations is not None else agent_cfg.max_iterations) + args_cli.max_iterations if args_cli.max_iterations is not None else agent_cfg.max_iterations + ) # set the environment seed - # note: certain randomizations occur in the environment initialization so - # we set the seed here + # note: certain randomizations occur in the environment initialization so we set the seed here env_cfg.seed = agent_cfg.seed env_cfg.sim.device = args_cli.device if args_cli.device is not None else env_cfg.sim.device @@ -105,10 +101,7 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | log_dir = os.path.join(log_root_path, log_dir) # create isaac environment - env = gym.make( - args_cli.task, - cfg=env_cfg, - render_mode="rgb_array" if args_cli.video else None) + env = gym.make(args_cli.task, cfg=env_cfg, render_mode="rgb_array" if args_cli.video else None) # convert to single-agent instance if required by the RL algorithm if isinstance(env.unwrapped, DirectMARLEnv): @@ -116,8 +109,7 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | # save resume path before creating a new log_dir if agent_cfg.resume: - resume_path = get_checkpoint_path( - log_root_path, agent_cfg.load_run, agent_cfg.load_checkpoint) + resume_path = get_checkpoint_path(log_root_path, agent_cfg.load_run, agent_cfg.load_checkpoint) # wrap for video recording if args_cli.video: @@ -135,11 +127,7 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | env = RslRlVecEnvWrapper(env) # create runner from rsl-rl - runner = OnPolicyRunner( - env, - agent_cfg.to_dict(), - log_dir=log_dir, - device=agent_cfg.device) + runner = OnPolicyRunner(env, agent_cfg.to_dict(), log_dir=log_dir, device=agent_cfg.device) # write git state to logs runner.add_git_repo_to_log(__file__) # load the checkpoint @@ -155,9 +143,7 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | dump_pickle(os.path.join(log_dir, "params", "agent.pkl"), agent_cfg) # run training - runner.learn( - num_learning_iterations=agent_cfg.max_iterations, - init_at_random_ep_len=True) + runner.learn(num_learning_iterations=agent_cfg.max_iterations, init_at_random_ep_len=True) # close the simulator env.close() @@ -169,4 +155,4 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | # close sim app simulation_app.close() -# From Isaac Lab scripts/reinforcement_learning/rsl_rl/train.py +# From Isaac Lab scripts/reinforcement_learning/rsl_rl/train.py \ No newline at end of file diff --git a/autonomy/simulation/Humanoid_RL/ModelAssets/.thumbs/256x256/Hand.usd.png b/autonomy/simulation/Humanoid_Wato/ModelAssets/.thumbs/256x256/Hand.usd.png similarity index 100% rename from autonomy/simulation/Humanoid_RL/ModelAssets/.thumbs/256x256/Hand.usd.png rename to autonomy/simulation/Humanoid_Wato/ModelAssets/.thumbs/256x256/Hand.usd.png diff --git a/autonomy/simulation/Humanoid_Wato/ModelAssets/.thumbs/256x256/arm.usd.png b/autonomy/simulation/Humanoid_Wato/ModelAssets/.thumbs/256x256/arm.usd.png new file mode 100644 index 0000000..705495d Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/ModelAssets/.thumbs/256x256/arm.usd.png differ diff --git a/autonomy/simulation/Humanoid_Wato/ModelAssets/arm.usd b/autonomy/simulation/Humanoid_Wato/ModelAssets/arm.usd new file mode 100644 index 0000000..41cec0f Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/ModelAssets/arm.usd differ diff --git a/autonomy/simulation/Humanoid_RL/ModelAssets/configuration/hand_base.usd b/autonomy/simulation/Humanoid_Wato/ModelAssets/configuration/hand_base.usd similarity index 100% rename from autonomy/simulation/Humanoid_RL/ModelAssets/configuration/hand_base.usd rename to autonomy/simulation/Humanoid_Wato/ModelAssets/configuration/hand_base.usd diff --git a/autonomy/simulation/Humanoid_RL/ModelAssets/configuration/hand_physics.usd b/autonomy/simulation/Humanoid_Wato/ModelAssets/configuration/hand_physics.usd similarity index 100% rename from autonomy/simulation/Humanoid_RL/ModelAssets/configuration/hand_physics.usd rename to autonomy/simulation/Humanoid_Wato/ModelAssets/configuration/hand_physics.usd diff --git a/autonomy/simulation/Humanoid_RL/ModelAssets/configuration/hand_sensor.usd b/autonomy/simulation/Humanoid_Wato/ModelAssets/configuration/hand_sensor.usd similarity index 100% rename from autonomy/simulation/Humanoid_RL/ModelAssets/configuration/hand_sensor.usd rename to autonomy/simulation/Humanoid_Wato/ModelAssets/configuration/hand_sensor.usd diff --git a/autonomy/simulation/Humanoid_RL/ModelAssets/hand.usd b/autonomy/simulation/Humanoid_Wato/ModelAssets/hand.usd similarity index 100% rename from autonomy/simulation/Humanoid_RL/ModelAssets/hand.usd rename to autonomy/simulation/Humanoid_Wato/ModelAssets/hand.usd diff --git a/autonomy/simulation/Humanoid_Wato/README.md b/autonomy/simulation/Humanoid_Wato/README.md new file mode 100644 index 0000000..ee6e16e --- /dev/null +++ b/autonomy/simulation/Humanoid_Wato/README.md @@ -0,0 +1 @@ +# Isaac Lab Humanoid RL diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly.urdf b/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly.urdf new file mode 100644 index 0000000..4b26329 --- /dev/null +++ b/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly.urdf @@ -0,0 +1,964 @@ + + + + + + + + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + + + + Gazebo/Silver + 0.2 + 0.2 + true + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + Gazebo/Silver + 0.2 + 0.2 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly/arm_assembly.usd b/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly/arm_assembly.usd new file mode 100644 index 0000000..3909667 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly/arm_assembly.usd differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly/configuration/arm_assembly_base.usd b/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly/configuration/arm_assembly_base.usd new file mode 100644 index 0000000..7c2fd5b Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly/configuration/arm_assembly_base.usd differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly/configuration/arm_assembly_physics.usd b/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly/configuration/arm_assembly_physics.usd new file mode 100644 index 0000000..aefb337 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly/configuration/arm_assembly_physics.usd differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly/configuration/arm_assembly_sensor.usd b/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly/configuration/arm_assembly_sensor.usd new file mode 100644 index 0000000..0070565 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/arm_assembly/configuration/arm_assembly_sensor.usd differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/CMC_THUMB_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/CMC_THUMB_v1_1.stl new file mode 100755 index 0000000..3459fa4 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/CMC_THUMB_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/DIP_INDEX_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/DIP_INDEX_v1_1.stl new file mode 100755 index 0000000..cf46e81 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/DIP_INDEX_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/DIP_MIDDLE_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/DIP_MIDDLE_v1_1.stl new file mode 100755 index 0000000..8cb1587 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/DIP_MIDDLE_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/DIP_PINKY_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/DIP_PINKY_v1_1.stl new file mode 100755 index 0000000..a1ea0d5 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/DIP_PINKY_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/DIP_RING_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/DIP_RING_v1_1.stl new file mode 100755 index 0000000..dcb2eef Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/DIP_RING_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/IP_THUMB_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/IP_THUMB_v1_1.stl new file mode 100755 index 0000000..0818794 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/IP_THUMB_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_INDEX_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_INDEX_v1_1.stl new file mode 100755 index 0000000..4cee7de Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_INDEX_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_MIDDLE_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_MIDDLE_v1_1.stl new file mode 100755 index 0000000..52e631d Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_MIDDLE_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_PINKY_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_PINKY_v1_1.stl new file mode 100755 index 0000000..332a190 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_PINKY_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_RING_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_RING_v1_1.stl new file mode 100755 index 0000000..f0ba376 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_RING_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_THUMB_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_THUMB_v1_1.stl new file mode 100755 index 0000000..af1d283 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/MCP_THUMB_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PALM_GAVIN_1DoF_Hinge_v2_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PALM_GAVIN_1DoF_Hinge_v2_1.stl new file mode 100755 index 0000000..f5c6b1e Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PALM_GAVIN_1DoF_Hinge_v2_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PIP_INDEX_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PIP_INDEX_v1_1.stl new file mode 100755 index 0000000..ce21e89 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PIP_INDEX_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PIP_MIDDLE_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PIP_MIDDLE_v1_1.stl new file mode 100755 index 0000000..1cd9f65 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PIP_MIDDLE_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PIP_PINKY_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PIP_PINKY_v1_1.stl new file mode 100755 index 0000000..432658a Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PIP_PINKY_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PIP_RING_v1_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PIP_RING_v1_1.stl new file mode 100755 index 0000000..1fa6960 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/PIP_RING_v1_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/base_link.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/base_link.stl new file mode 100755 index 0000000..02eaa5f Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/base_link.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/elbow_link_1_v6_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/elbow_link_1_v6_1.stl new file mode 100755 index 0000000..c7f8601 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/elbow_link_1_v6_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/elbow_link_2_v7_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/elbow_link_2_v7_1.stl new file mode 100755 index 0000000..5e59456 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/elbow_link_2_v7_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/forearm_v8_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/forearm_v8_1.stl new file mode 100755 index 0000000..9c65d5d Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/forearm_v8_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/shoulder_link_1_v9_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/shoulder_link_1_v9_1.stl new file mode 100755 index 0000000..b44e849 Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/shoulder_link_1_v9_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/shoulder_link_2_v4_1.stl b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/shoulder_link_2_v4_1.stl new file mode 100755 index 0000000..59f8caf Binary files /dev/null and b/autonomy/simulation/Humanoid_Wato/arm_assembly/meshes/shoulder_link_2_v4_1.stl differ diff --git a/autonomy/simulation/Humanoid_Wato/arm_hand_test.py b/autonomy/simulation/Humanoid_Wato/arm_hand_test.py new file mode 100644 index 0000000..b1a71d4 --- /dev/null +++ b/autonomy/simulation/Humanoid_Wato/arm_hand_test.py @@ -0,0 +1,112 @@ +import argparse +from isaaclab.app import AppLauncher + +parser = argparse.ArgumentParser(description="Humanoid Arm Hand Testing") +AppLauncher.add_app_launcher_args(parser) +args_cli = parser.parse_args() + +app_launcher = AppLauncher(args_cli) +simulation_app = app_launcher.app + +import torch + +import isaaclab.sim as sim_utils +from isaaclab.assets import AssetBaseCfg +from isaaclab.managers import SceneEntityCfg +from isaaclab.scene import InteractiveScene, InteractiveSceneCfg +from isaaclab.utils import configclass + +from HumanoidRL.HumanoidRLPackage.HumanoidRLSetup.modelCfg.humanoid import ARM_CFG + + + +@configclass +class HandSceneCfg(InteractiveSceneCfg): + ground = AssetBaseCfg( + prim_path="/World/defaultGroundPlane", + spawn=sim_utils.GroundPlaneCfg(), + init_state=AssetBaseCfg.InitialStateCfg(pos=(0.0, 0.0, -1.05)), + ) + + dome_light = AssetBaseCfg( + prim_path="/World/Light", + spawn=sim_utils.DomeLightCfg(intensity=3000.0, color=(0.75, 0.75, 0.75)) + ) + + robot = ARM_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") + + +def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene): + + robot = scene["robot"] + + robot_entity_cfg = SceneEntityCfg("robot", joint_names=[".*"], body_names=[".*"]) + + robot_entity_cfg.resolve(scene) + + sim_dt = sim.get_physics_dt() + + joint_position = robot.data.default_joint_pos.clone() + joint_vel = robot.data.default_joint_vel.clone() + robot.write_joint_state_to_sim(joint_position, joint_vel) + + # 21 DOF test positions: [arm 6 DOF] + [hand 15 DOF] + hold_seconds = 1.0 + steps_per_position = int(hold_seconds / sim_dt) + + test_positions = [ + [0.0] * 6 + [0.0] * 15, + [0.3] + [0.0] * 20, + [0.3] * 2 + [0.0] * 19, + [0.3] * 3 + [0.0] * 18, + [0.3] * 4 + [0.0] * 17, + [0.3] * 5 + [0.0] * 16, + [0.3] * 6 + [0.0] * 15, + ] + + current_pose_idx = 0 + steps_at_current_pose = 0 + + while simulation_app.is_running(): + + joint_position = torch.tensor( + test_positions[current_pose_idx], dtype=torch.float32, device=sim.device + ) + + robot.reset() + joint_pos_des = joint_position.unsqueeze(0)[:, robot_entity_cfg.joint_ids].clone() + robot.set_joint_position_target(joint_pos_des, joint_ids=robot_entity_cfg.joint_ids) + scene.write_data_to_sim() + + sim.step() + scene.update(sim_dt) + + steps_at_current_pose += 1 + if steps_at_current_pose >= steps_per_position: + steps_at_current_pose = 0 + current_pose_idx = (current_pose_idx + 1) % len(test_positions) + print(f"[INFO]: Moving to test pose {current_pose_idx + 1}/{len(test_positions)}") + + +def main(): + sim_cfg = sim_utils.SimulationCfg(dt=0.01, device=args_cli.device) + sim = sim_utils.SimulationContext(sim_cfg) + + sim.set_camera_view([2.5, 2.5, 2.5], [0.0, 0.0, 0.0]) + + scene_cfg = HandSceneCfg(num_envs=1, env_spacing=2.0) + scene = InteractiveScene(scene_cfg) + + sim.reset() + + print("[INFO]: Setup complete...") + + run_simulator(sim, scene) + + +if __name__ == "__main__": + main() + simulation_app.close() + + +# (env_isaaclab) hy@hy-LOQ-15IRX9:~/Downloads/Humanoid$ PYTHONPATH=$(pwd) /home/hy/IsaacLab/isaaclab.sh -p arm_hand_test.py \ No newline at end of file diff --git a/autonomy/simulation/Humanoid_RL/hand_test.py b/autonomy/simulation/Humanoid_Wato/hand_test.py similarity index 76% rename from autonomy/simulation/Humanoid_RL/hand_test.py rename to autonomy/simulation/Humanoid_Wato/hand_test.py index 98034d5..9f8be8c 100644 --- a/autonomy/simulation/Humanoid_RL/hand_test.py +++ b/autonomy/simulation/Humanoid_Wato/hand_test.py @@ -1,11 +1,3 @@ -from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR -from HumanoidRL.HumanoidRLPackage.HumanoidRLSetup.modelCfg.humanoid import HAND_CFG -from isaaclab.utils import configclass -from isaaclab.scene import InteractiveScene, InteractiveSceneCfg -from isaaclab.managers import SceneEntityCfg -from isaaclab.assets import AssetBaseCfg -import isaaclab.sim as sim_utils -import torch import argparse from isaaclab.app import AppLauncher @@ -16,6 +8,19 @@ app_launcher = AppLauncher(args_cli) simulation_app = app_launcher.app +import torch + +import isaaclab.sim as sim_utils +from isaaclab.assets import AssetBaseCfg +from isaaclab.managers import SceneEntityCfg +from isaaclab.scene import InteractiveScene, InteractiveSceneCfg +from isaaclab.utils import configclass + +from HumanoidRL.HumanoidRLPackage.HumanoidRLSetup.modelCfg.humanoid import HAND_CFG + +from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR + + @configclass class HandSceneCfg(InteractiveSceneCfg): @@ -27,12 +32,8 @@ class HandSceneCfg(InteractiveSceneCfg): dome_light = AssetBaseCfg( prim_path="/World/Light", - spawn=sim_utils.DomeLightCfg( - intensity=3000.0, - color=( - 0.75, - 0.75, - 0.75))) + spawn=sim_utils.DomeLightCfg(intensity=3000.0, color=(0.75, 0.75, 0.75)) + ) # table = AssetBaseCfg( # prim_path="{ENV_REGEX_NS}/Table", @@ -45,11 +46,10 @@ class HandSceneCfg(InteractiveSceneCfg): def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene): - + robot = scene["robot"] - robot_entity_cfg = SceneEntityCfg( - "robot", joint_names=[".*"], body_names=[".*"]) + robot_entity_cfg = SceneEntityCfg("robot", joint_names=[".*"], body_names=[".*"]) robot_entity_cfg.resolve(scene) @@ -65,17 +65,13 @@ def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene): # print(joint_position) # joint_vel = robot.data.default_joint_vel.clone() # robot.write_joint_state_to_sim(joint_position, joint_vel) - - joint_position_list = [[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, - 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] - joint_position = torch.tensor( - joint_position_list[0], device=sim.device) + + joint_position_list = [[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] + joint_position = torch.tensor(joint_position_list[0], device=sim.device) robot.reset() - joint_pos_des = joint_position.unsqueeze( - 0)[:, robot_entity_cfg.joint_ids].clone() - robot.set_joint_position_target( - joint_pos_des, joint_ids=robot_entity_cfg.joint_ids) + joint_pos_des = joint_position.unsqueeze(0)[:, robot_entity_cfg.joint_ids].clone() + robot.set_joint_position_target(joint_pos_des, joint_ids=robot_entity_cfg.joint_ids) scene.write_data_to_sim() sim.step() @@ -104,4 +100,4 @@ def main(): simulation_app.close() -# (env_isaaclab) hy@hy-LOQ-15IRX9:~/Downloads/Humanoid$ PYTHONPATH=$(pwd) /home/hy/IsaacLab/isaaclab.sh -p hand_test.py +# (env_isaaclab) hy@hy-LOQ-15IRX9:~/Downloads/Humanoid$ PYTHONPATH=$(pwd) /home/hy/IsaacLab/isaaclab.sh -p hand_test.py \ No newline at end of file diff --git a/autonomy/simulation/Wato_additional_scripts/shadow_hand/shadow_hand_joint_space_test.py b/autonomy/simulation/Wato_additional_scripts/shadow_hand/shadow_hand_joint_space_test.py deleted file mode 100644 index bd107d5..0000000 --- a/autonomy/simulation/Wato_additional_scripts/shadow_hand/shadow_hand_joint_space_test.py +++ /dev/null @@ -1,216 +0,0 @@ -from isaaclab_assets import SHADOW_HAND_CFG -from isaaclab.utils.math import subtract_frame_transforms -from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR -from isaaclab.utils import configclass -from isaaclab.scene import InteractiveScene, InteractiveSceneCfg -from isaaclab.markers.config import FRAME_MARKER_CFG -from isaaclab.markers import VisualizationMarkers -from isaaclab.managers import SceneEntityCfg -from isaaclab.controllers import DifferentialIKController, DifferentialIKControllerCfg -from isaaclab.assets import AssetBaseCfg -import isaaclab.sim as sim_utils -import torch -import argparse -from isaaclab.app import AppLauncher - -parser = argparse.ArgumentParser( - description="Robot Arm with Joint Space Control") -AppLauncher.add_app_launcher_args(parser) -args_cli = parser.parse_args() - -app_launcher = AppLauncher(args_cli) -simulation_app = app_launcher.app - - -# Shadow hand has 24 DOF - found from print(robot_entity_cfg.joint_ids) -# Print joint position - robot.data.default_joint_pos - - -@configclass -class TableTopSceneCfg(InteractiveSceneCfg): - """Configuration for a cart-pole scene.""" - - # ground plane - ground = AssetBaseCfg( - prim_path="/World/defaultGroundPlane", - spawn=sim_utils.GroundPlaneCfg(), - init_state=AssetBaseCfg.InitialStateCfg(pos=(0.0, 0.0, -1.05)), - ) - - # lights - dome_light = AssetBaseCfg( - prim_path="/World/Light", - spawn=sim_utils.DomeLightCfg( - intensity=3000.0, - color=( - 0.75, - 0.75, - 0.75))) - - # mount - # table = AssetBaseCfg( - # prim_path="{ENV_REGEX_NS}/Table", - # spawn=sim_utils.UsdFileCfg( - # usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Mounts/Stand/stand_instanceable.usd", scale=(2.0, 2.0, 2.0) - # ), - # ) - - # articulation - robot = SHADOW_HAND_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") - - -def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene): - - robot = scene["robot"] - - # Specify robot-specific parameters - robot_entity_cfg = SceneEntityCfg( - "robot", joint_names=[".*"], body_names=[".*"]) - - # Resolving the scene entities - robot_entity_cfg.resolve(scene) - - # Obtain the frame index of the end-effector ; For a fixed base robot, the - # frame index is one less than the body index. This is because ; the root - # body is not included in the returned Jacobians. - if robot.is_fixed_base: - ee_jacobi_idx = robot_entity_cfg.body_ids[0] - 1 - else: - ee_jacobi_idx = robot_entity_cfg.body_ids[0] - - # Define simulation stepping - sim_dt = sim.get_physics_dt() - count = 0 - joint_position_index = 0 - - while simulation_app.is_running(): - if count % 150 == 0: - # reset time - count = 0 - - # cycle between joint state - joint_position_list = [[0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0.], - [1., - 1., - 1., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0.], - [0., - 0., - 1., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 0., - 1., - 1., - 0., - 0., - 0., - 0., - 0.]] - joint_position = torch.tensor( - joint_position_list[joint_position_index], - device=sim.device) - - if joint_position_index >= len(joint_position_list) - 1: - joint_position_index = 0 - else: - joint_position_index += 1 - - robot.reset() - - joint_pos_des = joint_position.unsqueeze( - 0)[:, robot_entity_cfg.joint_ids].clone() - - # apply actions (Smooth movement) - robot.set_joint_position_target( - joint_pos_des, joint_ids=robot_entity_cfg.joint_ids) - scene.write_data_to_sim() - - # perform step - sim.step() - - # update sim-time - count += 1 - - # update buffers - scene.update(sim_dt) - - -def main(): - # Load kit helper - sim_cfg = sim_utils.SimulationCfg(dt=0.01, device=args_cli.device) - sim = sim_utils.SimulationContext(sim_cfg) - - # Set main camera - sim.set_camera_view([2.5, 2.5, 2.5], [0.0, 0.0, 0.0]) - - # Design scene - scene_cfg = TableTopSceneCfg(num_envs=1, env_spacing=2.0) - scene = InteractiveScene(scene_cfg) - - # Play the simulator - sim.reset() - - print("[INFO]: Setup complete...") - - # Run the simulator - run_simulator(sim, scene) - - -if __name__ == "__main__": - main() - simulation_app.close()