Skip to content

Jt/port hardcoding MjModel attributes for MiniCheetah - #39

Closed
JoshuaTchou wants to merge 83 commits into
mainfrom
jt/port
Closed

Jt/port hardcoding MjModel attributes for MiniCheetah#39
JoshuaTchou wants to merge 83 commits into
mainfrom
jt/port

Conversation

@JoshuaTchou

@JoshuaTchou JoshuaTchou commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Issue ticket number and link

Fixes # (issue)

Describe your changes

Hardcoded njmax and opt.ccd_iterations for MiniCheetah instances because run-time warnings were telling me to increase the values. This is done in mujoco_backend_base.py._load_model().

Instructions for reviewers

The desired behavior is that the runtime warnings disappear and the values njmax and ccd_iterations are actually changed when training MiniCheetah or subclasses

Checklist before requesting a review

  • This is expected to break regression tests.
  • [x ] I have assigned a reviewer
  • I have added the PR to the project, and tagged with with priority
  • If it is a core feature, I have added tests.
  • [ x] I have set up pre-commit hooks with ruff, or run ruff format . manually

sheim added 30 commits March 16, 2024 12:04
…d history length.

Implemented for dof_pos_target, dof_pos, dof_vel.
in preparation for domain randomization of gains
…f_pos_history` (used for smoothness reward).

Some tuning.
Change stance/swing reward to use the smoothed square wave.
diff --git a/gym/envs/mit_humanoid/mit_humanoid_config.py b/gym/envs/mit_humanoid/mit_humanoid_config.py
index 54813f7..368f2c3 100644
--- a/gym/envs/mit_humanoid/mit_humanoid_config.py
+++ b/gym/envs/mit_humanoid/mit_humanoid_config.py
@@ -142,7 +142,7 @@ class MITHumanoidCfg(LeggedRobotCfg):
     class asset(LeggedRobotCfg.asset):
         file = (
             "{LEGGED_GYM_ROOT_DIR}/resources/robots/"
-            + "mit_humanoid/urdf/humanoid_R_sf.urdf"
+            + "mit_humanoid/urdf/humanoid_F_sf_learnt.urdf"
         )
         # foot_collisionbox_names = ["foot"]
         foot_name = "foot"
@@ -289,12 +289,12 @@ class MITHumanoidRunnerCfg(LeggedRobotRunnerCfg):
         use_clipped_value_loss = True
         clip_param = 0.2
         entropy_coef = 0.01
-        num_learning_epochs = 5
+        num_learning_epochs = 4
         # * mini batch size = num_envs*nsteps / nminibatches
         num_mini_batches = 4
-        learning_rate = 5.0e-5
+        learning_rate = 1.0e-6
         schedule = "adaptive"  # could be adaptive, fixed
-        gamma = 0.999
+        gamma = 0.99
         lam = 0.95
         desired_kl = 0.01
         max_grad_norm = 1.0
diff --git a/resources/robots/mit_humanoid/urdf/humanoid_F_sf_learnt.urdf b/resources/robots/mit_humanoid/urdf/humanoid_F_sf_learnt.urdf
index 5e76f34..98a0773 100644
--- a/resources/robots/mit_humanoid/urdf/humanoid_F_sf_learnt.urdf
+++ b/resources/robots/mit_humanoid/urdf/humanoid_F_sf_learnt.urdf
@@ -570,7 +570,7 @@ Simple Foot: foot approximated as single box-contact -->
   </link>
   <joint
     name="15_left_shoulder_pitch"
-    type="fixed">
+    type="revolute">
     <origin
       xyz="0.01346 0.17608 0.24657"
       rpy="0 0 0" />
@@ -615,7 +615,7 @@ Simple Foot: foot approximated as single box-contact -->
   </link>
   <joint
     name="16_left_shoulder_abad"
-    type="fixed">
+    type="revolute">
     <origin
       xyz="0 .05760 0"
       rpy="0.0 0 0" />
@@ -668,7 +668,7 @@ Simple Foot: foot approximated as single box-contact -->
   </link>
   <joint
     name="17_left_shoulder_yaw"
-    type="fixed">
+    type="revolute">
     <origin
       xyz="0 0 -.10250"
       rpy="0.0 0 0" />
@@ -719,7 +719,7 @@ Simple Foot: foot approximated as single box-contact -->
   </link>
   <joint
     name="18_left_elbow"
-    type="fixed">
+    type="revolute">
     <origin
       xyz="0 0 -.15750"
       rpy="0 0 0.0" />
@@ -798,7 +798,7 @@ Simple Foot: foot approximated as single box-contact -->
   </link>
   <joint
     name="11_right_shoulder_pitch"
-    type="fixed">
+    type="revolute">
     <origin
       xyz="0.01346 -0.17608 0.24657"
       rpy="0 0 0" />
@@ -843,7 +843,7 @@ Simple Foot: foot approximated as single box-contact -->
   </link>
   <joint
     name="12_right_shoulder_abad"
-    type="fixed">
+    type="revolute">
     <origin
       xyz="0 -.05760 0"
       rpy="0.0 0 0" />
@@ -896,7 +896,7 @@ Simple Foot: foot approximated as single box-contact -->
   </link>
   <joint
     name="13_right_shoulder_yaw"
-    type="fixed">
+    type="revolute">
     <origin
       xyz="0 0 -.10250"
       rpy="0.0 0 0" />
@@ -947,7 +947,7 @@ Simple Foot: foot approximated as single box-contact -->
   </link>
   <joint
     name="14_right_elbow"
-    type="fixed">
+    type="revolute">
     <origin
       xyz="0 0 -.15750"
       rpy="0 0 0.0" />
put jacobian into MIT_humanoid base environment, rather than import; importing breaks when running --original_config
only for lander: needs to overload _check_terminations_and_timeouts to not actually reset
so that reset can be handled only by runner (without breaking backwards compatibility)

Also keeps a list of rewards, for finer reward integration, and can also do traj stats
@JoshuaTchou
JoshuaTchou requested review from sheim and removed request for sheim June 24, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants