Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
is2ac2 committed Jul 10, 2024
1 parent 635a12c commit e5e9eec
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 27 deletions.
4 changes: 0 additions & 4 deletions sim/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
import os
from pathlib import Path

from dotenv import load_dotenv

load_dotenv()


def model_dir() -> Path:
return Path(os.environ.get("MODEL_DIR", "models"))
Expand Down
3 changes: 1 addition & 2 deletions sim/humanoid_gym/envs/getup_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ class noise_scales: # noqa: N801
height_measurements = 0.1

class init_state(LeggedRobotCfg.init_state): # noqa: N801
pos = [0.0, 0.0, 5.2]
# pos = [0.0, 0.0, 0.2]
pos = [0.0, 0.0, 0.2]

# Face up
# rot = [-0.717107, 0.0, 0.0, 0.717107]
Expand Down
8 changes: 1 addition & 7 deletions sim/humanoid_gym/envs/legs_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from sim.env import stompy_urdf_path
from sim.humanoid_gym.envs.stompy_config import StompyCfg
from sim.stompy2.joints import StompyFixed
from sim.stompy.joints import StompyFixed

NUM_JOINTS = len(StompyFixed.default_standing()) # 17

Expand Down Expand Up @@ -33,19 +33,13 @@ class asset(LeggedRobotCfg.asset):

name = "stompy"

# foot_name = "_foot_1_foot_1"
foot_name = "_foot_1_rmd_x4_24_mock_1_inner_rmd_x4_24_1"
knee_name = "_rmd_x8_90_mock_3_inner_rmd_x8_90_1"

# old
# foot_name = "_leg_1_x4_1_outer_1" # "foot"
# knee_name = "belt_knee"

termination_height = 0.23
default_feet_height = 0.0

terminate_after_contacts_on = ["link_upper_limb_assembly_7_dof_1_torso_1_top_skeleton_2"]
# terminate_after_contacts_on = ["link_torso_1_top_torso_1"]

penalize_contacts_on = []
self_collisions = 1 # 1 to disable, 0 to enable...bitwise filter
Expand Down
2 changes: 1 addition & 1 deletion sim/humanoid_gym/envs/legs_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from isaacgym.torch_utils import *

from isaacgym import gymtorch
from sim.old_stompy.joints import StompyFixed
from sim.stompy.joints import StompyFixed


class LegsFreeEnv(LeggedRobot):
Expand Down
1 change: 0 additions & 1 deletion sim/humanoid_gym/envs/stompy_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class init_state(LeggedRobotCfg.init_state):

class control(LeggedRobotCfg.control):
# PD Drive parameters:
# NOTE: these names are outdated, must be manually set in third party legged_robot.py
stiffness = {
"shoulder": 200,
"elbow": 200,
Expand Down
3 changes: 1 addition & 2 deletions sim/humanoid_gym/envs/stompy_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from isaacgym.torch_utils import *

from isaacgym import gymtorch
from sim.old_stompy.joints import Stompy
from sim.stompy.joints import Stompy


class StompyFreeEnv(LeggedRobot):
Expand Down Expand Up @@ -122,7 +122,6 @@ def compute_ref_state(self):
scale_2 = 2 * scale_1
# left foot stance phase set to default joint pos
sin_pos_l[sin_pos_l > 0] = 0

self.ref_dof_pos[:, self.legs_joints["left_hip_pitch"]] = sin_pos_l * scale_1
self.ref_dof_pos[:, self.legs_joints["left_knee_pitch"]] = sin_pos_l * scale_2
self.ref_dof_pos[:, self.legs_joints["left_ankle_roll"]] = sin_pos_l * scale_1
Expand Down
7 changes: 0 additions & 7 deletions sim/scripts/create_fixed_torso.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,3 @@ def update_urdf() -> None:

if __name__ == "__main__":
update_urdf()


# adjust default limits to be very constrained arouynd default standing pose
# run create fixed torso
# adjust legs_ppo.py to use the fixed torso
# python train.py --task=legs_ppo --num_envs=1
# adjust torque valu third_party/humanoid-gym/humanoid/envs/base/legged_robot.py
4 changes: 1 addition & 3 deletions sim/scripts/simulate_urdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from isaacgym import gymapi, gymtorch, gymutil
from sim.env import stompy_urdf_path
from sim.logging import configure_logging
from sim.old_stompy.joints import Stompy
from sim.stompy.joints import Stompy

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -151,7 +151,6 @@ def load_gym() -> GymParams:
# dof_vel[:] = 0.0
starting_positions = Stompy.default_standing()
dof_ids: Dict[str, int] = gym.get_actor_dof_dict(env, robot)
print(starting_positions)
for joint_name, joint_position in starting_positions.items():
dof_pos[0, dof_ids[joint_name]] = joint_position
env_ids_int32 = torch.zeros(1, dtype=torch.int32)
Expand All @@ -161,7 +160,6 @@ def load_gym() -> GymParams:
gymtorch.unwrap_tensor(env_ids_int32),
1,
)
print(dof_pos)

return GymParams(
gym=gym,
Expand Down

0 comments on commit e5e9eec

Please sign in to comment.