diff --git a/rofunc/learning/RofuncRL/tasks/ase/humanoid.py b/rofunc/learning/RofuncRL/tasks/ase/humanoid.py index 31a4aeb25..6d706f1e1 100644 --- a/rofunc/learning/RofuncRL/tasks/ase/humanoid.py +++ b/rofunc/learning/RofuncRL/tasks/ase/humanoid.py @@ -225,6 +225,9 @@ def _setup_character_props(self, key_bodies): num_key_bodies = len(key_bodies) if asset_file == "mjcf/amp_humanoid.xml": + # ['pelvis', 'torso', 'head', 'right_upper_arm', 'right_lower_arm', 'right_hand', 'left_upper_arm', + # 'left_lower_arm', 'left_hand', 'right_thigh', 'right_shin', 'right_foot', 'left_thigh', 'left_shin', + # 'left_foot'] self._dof_body_ids = [1, 2, 3, 4, 6, 7, 9, 10, 11, 12, 13, 14] self._dof_offsets = [0, 3, 6, 9, 10, 13, 14, 17, 18, 21, 24, 25, 28] self._dof_obs_size = 72 @@ -232,6 +235,9 @@ def _setup_character_props(self, key_bodies): self._num_obs = 1 + 15 * (3 + 6 + 3 + 3) - 3 elif asset_file == "mjcf/amp_humanoid_sword_shield.xml": + # ['pelvis', 'torso', 'head', 'right_upper_arm', 'right_lower_arm', 'right_hand', 'sword', 'left_upper_arm', + # 'left_lower_arm', 'shield', 'left_hand', 'right_thigh', 'right_shin', 'right_foot', 'left_thigh', + # 'left_shin', 'left_foot'] self._dof_body_ids = [1, 2, 3, 4, 5, 7, 8, 11, 12, 13, 14, 15, 16] self._dof_offsets = [0, 3, 6, 9, 10, 13, 16, 17, 20, 21, 24, 27, 28, 31] self._dof_obs_size = 78 @@ -239,12 +245,25 @@ def _setup_character_props(self, key_bodies): self._num_obs = 1 + 17 * (3 + 6 + 3 + 3) - 3 elif asset_file == "mjcf/hotu_humanoid.xml": + # ['pelvis', 'torso', 'head', 'right_upper_arm', 'right_lower_arm', 'right_hand', 'sword', 'left_upper_arm', + # 'left_lower_arm', 'shield', 'left_hand', 'right_thigh', 'right_shin', 'right_foot', 'left_thigh', + # 'left_shin', 'left_foot'] self._dof_body_ids = [1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 13, 14, 15, 16] self._dof_offsets = [0, 3, 6, 9, 10, 13, 16, 17, 20, 23, 24, 27, 30, 31, 34] self._dof_obs_size = 84 self._num_actions = 34 self._num_obs = 1 + 15 * (3 + 6 + 3 + 3) - 3 # Check + elif asset_file == "mjcf/hotu_humanoid2.xml": + # ['pelvis', 'torso', 'head', 'right_upper_arm', 'right_lower_arm', 'right_hand', 'left_upper_arm', + # 'left_lower_arm', 'left_hand', 'right_thigh', 'right_shin', 'right_foot', 'left_thigh', 'left_shin', + # 'left_foot'] + self._dof_body_ids = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] + self._dof_offsets = [0, 3, 6, 9, 10, 13, 16, 17, 20, 23, 24, 27, 30, 31, 34] + self._dof_obs_size = 84 + self._num_actions = 34 + self._num_obs = 1 + 15 * (3 + 6 + 3 + 3) - 3 # Check + else: print("Unsupported character config file: {s}".format(asset_file)) assert False diff --git a/rofunc/learning/RofuncRL/tasks/ase/humanoid_amp.py b/rofunc/learning/RofuncRL/tasks/ase/humanoid_amp.py index c3b5ed946..830dbe773 100644 --- a/rofunc/learning/RofuncRL/tasks/ase/humanoid_amp.py +++ b/rofunc/learning/RofuncRL/tasks/ase/humanoid_amp.py @@ -157,6 +157,8 @@ def _setup_character_props(self, key_bodies): self._num_amp_obs_per_step = 13 + self._dof_obs_size + 31 + 3 * num_key_bodies # [root_h, root_rot, root_vel, root_ang_vel, dof_pos, dof_vel, key_body_pos] elif asset_file == "mjcf/hotu_humanoid.xml": self._num_amp_obs_per_step = 13 + self._dof_obs_size + 34 + 3 * num_key_bodies + elif asset_file == "mjcf/hotu_humanoid2.xml": + self._num_amp_obs_per_step = 13 + self._dof_obs_size + 34 + 3 * num_key_bodies else: print("Unsupported character config file: {s}".format(asset_file)) assert False diff --git a/rofunc/simulator/assets/mjcf/hotu_humanoid2.xml b/rofunc/simulator/assets/mjcf/hotu_humanoid2.xml new file mode 100644 index 000000000..79f5548e8 --- /dev/null +++ b/rofunc/simulator/assets/mjcf/hotu_humanoid2.xml @@ -0,0 +1,220 @@ + + + + +