Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions leg/MUJOCO_LOG.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Wed Aug 20 18:51:34 2025
WARNING: mju_openResource: could not open resource '../scene/myosuite_scene_noPedestal.xml' with default provider at slot 1

Wed Aug 20 18:51:34 2025
WARNING: mju_openResource: could not open resource '../torso/assets/myotorso_rigid_assets.xml' with default provider at slot 1

Wed Aug 20 18:51:34 2025
WARNING: mju_openResource: could not open resource '../leg/assets/myolegs_assets.xml' with default provider at slot 1

Wed Aug 20 18:51:34 2025
WARNING: mju_openResource: could not open resource '../leg/assets/myolegs_tendon.xml' with default provider at slot 1

Wed Aug 20 18:51:34 2025
WARNING: mju_openResource: could not open resource '../leg/assets/myolegs_muscle.xml' with default provider at slot 1

Wed Aug 20 18:51:34 2025
WARNING: mju_openResource: could not open resource '../torso/assets/myotorso_rigid_chain.xml' with default provider at slot 1

Wed Aug 20 18:51:34 2025
WARNING: mju_openResource: could not open resource '../leg/assets/myolegs_chain.xml' with default provider at slot 1

Wed Aug 20 18:51:57 2025
WARNING: mju_openResource: could not open resource '../scene/myosuite_scene_noPedestal.xml' with default provider at slot 1

Wed Aug 20 18:51:57 2025
WARNING: mju_openResource: could not open resource '../torso/assets/myotorso_rigid_assets.xml' with default provider at slot 1

Wed Aug 20 18:51:57 2025
WARNING: mju_openResource: could not open resource '../leg/assets/myolegs_assets.xml' with default provider at slot 1

Wed Aug 20 18:51:57 2025
WARNING: mju_openResource: could not open resource '../leg/assets/myolegs_tendon.xml' with default provider at slot 1

Wed Aug 20 18:51:57 2025
WARNING: mju_openResource: could not open resource '../leg/assets/myolegs_muscle.xml' with default provider at slot 1

Wed Aug 20 18:51:57 2025
WARNING: mju_openResource: could not open resource '../torso/assets/myotorso_rigid_chain.xml' with default provider at slot 1

Wed Aug 20 18:51:57 2025
WARNING: mju_openResource: could not open resource '../leg/assets/myolegs_chain.xml' with default provider at slot 1

Wed Aug 20 18:52:10 2025
WARNING: Nan, Inf or huge value in QACC at DOF 6. The simulation is unstable. Time = 12.3960.

70 changes: 70 additions & 0 deletions leg/MyoLegs_Multi_Segment_Foot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# -*- coding: utf-8 -*-
"""
Created on Mon May 26 09:04:23 2025

@author: radsi
"""

import mujoco
from mujoco.viewer import launch

model = mujoco.MjModel.from_xml_string("""

<mujoco model="MyoSuite's MyoLeg Model">
<!-- =================================================
Copyright 2020 Vikash Kumar, Vittorio Caggiano, Huawei Wang
Model :: Myo Hand (MuJoCoV2.0)
Author :: Vikash Kumar (vikashplus@gmail.com), Vittorio Caggiano, Huawei Wang
source :: https://github.com/vikashplus
License :: Under Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
====================================================== -->
<include file="../scene/myosuite_scene_noPedestal.xml"/>
<include file="../torso/assets/myotorso_rigid_assets.xml"/>
<include file="../leg/assets/myolegs_assets.xml"/>
<include file="../leg/assets/myolegs_tendon.xml"/>
<include file="../leg/assets/myolegs_muscle.xml"/>
<compiler angle="radian" meshdir=".." texturedir=".."/>
<asset>
<hfield name="terrain" size="7 7 1 0.001" nrow="100" ncol="100"/>
</asset>
<worldbody>
<geom name="terrain" type="hfield" hfield="terrain" pos="0 0 -0.005" material="matfloor" conaffinity="1" contype="1" rgba="1 1 1 0"/>
<site name="pelvis_target" size="0.02" pos="0 0 .92" group="4"/>
<body name="root" pos="0 0 1" euler="0 0 -1.57">
<freejoint name="root"/>
<inertial mass="1.0" pos="0 0 0" diaginertia="0.01 0.01 0.01"/>
<body name="test">
<joint name="pelvis_tx" range="-5 5" limited="false" user="0.369999999988462" ref="0" axis="1 0 0" type="slide" damping="0" stiffness="0"/>
<joint name="pelvis_ty" range="-1 2" limited="false" user="0.9999999999157" ref="0" axis="0 1 0" type="slide" damping="0" stiffness="0"/>
<joint name="pelvis_tz" range="-5 5" limited="false" user="0.555999999984879" ref="0" axis="0 0 1" type="slide" damping="0" stiffness="0"/>
<joint name="pelvis_rotation" range="-0.2618 6.283" limited="true" user="0.0" ref="0" axis="0 1 0" type="hinge" damping="0" stiffness="0"/>
<joint name="pelvis_tilt" range="-3.14 3.14" limited="true" user="0.0" ref="0" axis="0 0 1" type="hinge" damping="0" stiffness="0"/>
<joint name="pelvis_list" range="-3.14 3.14" limited="true" user="0.0" ref="0" axis="1 0 0" type="hinge" damping="0" stiffness="0"/>

<include file="../torso/assets/myotorso_rigid_chain.xml"/>
<include file="../leg/assets/myolegs_chain.xml"/>





</body>
</body>
</worldbody>
<!--
<keyframe>

<key qpos="0 0 .92 0.707388 0 0 -0.706825 0.161153 -0.0279385 -0.041886 0.00247908 0.00101098 0.461137 0.0275069 0.136817 0.334 -0.00117055 -0.000125295 -0.0302192 0.0395202 -0.194029 0.161153 -0.0279385 -0.041886 0.00247908 0.00101098 0.461137 0.0275069 0.136817 0.334 -0.00117055 -0.000125295 -0.0302192 0.0395202 -0.194029"/>
<key qpos="0 0 .9 0.707388 0 0 -0.706825 0.405648 -0.020957 -0.118677 0.0039054 0.00122326 0.7329 0.0102961 0.215496 0.40143 -0.006982 -0.02618 -0.03738 0.0080579 -0.87272 0.405648 -0.020957 -0.118677 0.0039054 0.00122326 0.7329 0.0102961 0.215496 0.40143 -0.006982 -0.02618 -0.03738 0.0080579 -0.87272"/>
<key qpos="0 0 1.0 0.707388 0 0 -0.706825 -0.2326 -0.0279385 -0.041886 0.00247908 0.00101098 1.227 0.0275069 0.136817 0.1672 -0.00117055 -0.000125295 -0.0302192 0.0395202 -0.194029 -0.1652 -0.0279385 -0.041886 0.00247908 0.0010198 0.0888 0.0275069 0.136817 -0.019 -0.00117055 -0.000125295 -0.0302192 0.0395202 -0.194029" qvel="0 -1.5 0 0 0 0 4.9066 0 0 0 0 -3.597 0 0 0.633 0 0 0 0 0 0.175 0 0 0 0 0.175 0 0 0.988 0 0 0 0 0"/>
<key qpos="0 0 1.0 0.707388 0 0 -0.706825 -0.1652 -0.0279385 -0.041886 0.00247908 0.00101098 0.0888 0.0275069 0.136817 -0.019 -0.00117055 -0.000125295 -0.0302192 0.0395202 -0.194029 -0.2326 -0.0279385 -0.041886 0.00247908 0.0010198 1.227 0.0275069 0.136817 0.1672 -0.00117055 -0.000125295 -0.0302192 0.0395202 -0.194029" qvel="0 -1.5 0 0 0 0 -0.576 0 0 0 0 0.175 0 0 0.988 0 0 0 0 0 4.9066 0 0 0 0 -3.597 0 0 0.633 0 0 0 0 0"/>
</keyframe>
-->
</mujoco>

""")




launch(model)
32 changes: 27 additions & 5 deletions leg/assets/myolegs_assets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
<pair geom1="r_femur2_col" geom2="l_femur2_col" condim="1"/>
<pair geom1="r_tibia1_col" geom2="l_tibia1_col" condim="1"/>
<pair geom1="r_tibia2_col" geom2="l_tibia2_col" condim="1"/>
<pair geom1="r_foot_col1" geom2="l_foot_col1" condim="1"/>
<pair geom1="r_foot_col4" geom2="l_foot_col4" condim="1"/>
<!-- <pair geom1="r_foot_col1" geom2="l_foot_col1" condim="1"/>
<pair geom1="r_foot_col4" geom2="l_foot_col4" condim="1"/>-->

<pair geom1="r_femur1_col" geom2="l_tibia1_col" condim="1"/>
<pair geom1="l_femur1_col" geom2="r_tibia1_col" condim="1"/>
Expand All @@ -58,6 +58,12 @@

<pair geom1="r_femur2_col" geom2="l_tibia2_col" condim="1"/>
<pair geom1="l_femur2_col" geom2="r_tibia2_col" condim="1"/>

<!-- Added the code below
<pair geom1="r_calcaneus" geom2="r_midfoot"/>
<pair geom1="r_midfoot" geom2="r_forefoot"/>
-->

</contact>


Expand All @@ -72,16 +78,31 @@
<mesh file="../myo_sim/meshes/r_tibia.stl" name="r_tibia"/>
<mesh file="../myo_sim/meshes/r_fibula.stl" name="r_fibula"/>
<mesh file="../myo_sim/meshes/r_talus.stl" name="r_talus"/>
<mesh file="../myo_sim/meshes/r_foot.stl" name="r_foot"/>
<mesh file="../myo_sim/meshes/r_bofoot.stl" name="r_bofoot"/>
<mesh file="../myo_sim/meshes/r_patella.stl" name="r_patella"/>
<mesh file="../myo_sim/meshes/l_femur.stl" name="l_femur"/>
<mesh file="../myo_sim/meshes/l_tibia.stl" name="l_tibia"/>
<mesh file="../myo_sim/meshes/l_fibula.stl" name="l_fibula"/>
<mesh file="../myo_sim/meshes/l_talus.stl" name="l_talus"/>
<mesh file="../myo_sim/meshes/l_patella.stl" name="l_patella"/>

<mesh file="../myo_sim/meshes/l_foot.stl" name="l_foot"/>
<mesh file="../myo_sim/meshes/l_bofoot.stl" name="l_bofoot"/>
<mesh file="../myo_sim/meshes/l_patella.stl" name="l_patella"/>
<mesh file="../myo_sim/meshes/r_foot.stl" name="r_foot"/>
<mesh file="../myo_sim/meshes/r_bofoot.stl" name="r_bofoot" />


<!-- Added the code below-->
<mesh name="l_calcaneus" file="../myo_sim/meshes/l_calcaneus.stl" scale="1 1 1"/>
<mesh name="l_midfoot" file="../myo_sim/meshes/l_midfoot.stl" scale="1 1 1"/>
<mesh name="l_forefoot" file="../myo_sim/meshes/l_forefoot.stl" scale="1 1 1"/>
<mesh name="l_digits" file="../myo_sim/meshes/l_digits.stl" scale="1 1 1"/>
<mesh name="r_calcaneus" file="../myo_sim/meshes/r_calcaneus.stl" scale="1 1 1"/>
<mesh name="r_midfoot" file="../myo_sim/meshes/r_midfoot.stl" scale="1 1 1"/>
<mesh name="r_forefoot" file="../myo_sim/meshes/r_forefoot.stl" scale="1 1 1"/>
<mesh name="r_digits" file="../myo_sim/meshes/r_digits.stl" scale="1 1 1"/>



</asset>

<equality>
Expand All @@ -103,6 +124,7 @@
<joint joint1="knee_angle_l_beta_rotation1" joint2="knee_angle_l" name="knee_angle_l_beta_rotation1_constraint" polycoef="0.010506 0.0247615 -1.31647 0.716337 -0.138302" solimp="0.9999 0.9999 0.001 0.5 2"/>
</equality>


<sensor>
<touch name="r_foot" site="r_foot_touch"/>
<touch name="r_toes" site="r_toes_touch"/>
Expand Down
Loading