Code Monkey home page Code Monkey logo

myosuite's Introduction

Support Ukraine PyPI Documentation Status PyPI - License PRs Welcome Downloads Open In Colab Supporting MyoChallenge Slack Twitter Follow

MyoSuite is a collection of musculoskeletal environments and tasks simulated with the MuJoCo physics engine and wrapped in the OpenAI gym API to enable the application of Machine Learning to bio-mechanic control problems.

Full task details | Baselines | Documentation | Tutorials

Below is an overview of the tasks in the MyoSuite.

TasksALL

Getting Started

You will need Python 3.8 or later versions.

It is recommended to use Miniconda and to create a separate environment with:

conda create --name myosuite python=3.8
conda activate myosuite

It is possible to install MyoSuite with:

pip install -U myosuite

for advanced installation, see here.

Test your installation using the following command (this will return also a list of all the current environments):

python -m myosuite.tests.test_myo

You can also visualize the environments with random controls using the command below:

python -m myosuite.utils.examine_env --env_name myoElbowPose1D6MRandom-v0

NOTE: On MacOS, we moved to mujoco native launch_passive which requires that the Python script be run under mjpython:

mjpython -m myosuite.utils.examine_env --env_name myoElbowPose1D6MRandom-v0

Examples

It is possible to create and interface with MyoSuite environments just like any other OpenAI gym environments. For example, to use the myoElbowPose1D6MRandom-v0 environment, it is possible simply to run: Open In Colab

import myosuite
import gym
env = gym.make('myoElbowPose1D6MRandom-v0')
env.reset()
for _ in range(1000):
  env.mj_render()
  env.step(env.action_space.sample()) # take a random action
env.close()

You can find tutorials on how to load MyoSuite models/tasks, train them, and visualize their outcome. Also, you can find baselines to test some pre-trained policies.

License

MyoSuite is licensed under the Apache License.

Citation

If you find this repository useful in your research, please consider giving a star ⭐ and cite our arXiv paper by using the following BibTeX entrys.

@Misc{MyoSuite2022,
  author =       {Vittorio, Caggiano AND Huawei, Wang AND Guillaume, Durandau AND Massimo, Sartori AND Vikash, Kumar},
  title =        {MyoSuite -- A contact-rich simulation suite for musculoskeletal motor control},
  publisher = {arXiv},
  year = {2022},
  howpublished = {\url{https://github.com/myohub/myosuite}},
  year =         {2022}
  doi = {10.48550/ARXIV.2205.13600},
  url = {https://arxiv.org/abs/2205.13600},
}

myosuite's People

Contributors

adityadeshmukh369 avatar alexemg avatar andreh1111 avatar camberg23 avatar cameronberg avatar elladyr avatar filemaster avatar huaweiwang-2 avatar p-schumacher avatar smsong avatar vikashplus avatar vittorio-caggiano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

myosuite's Issues

Cannot reproduce SAR-RL results in the MyoLeg Hilly Locomotion task

Hilly_Walk_ICAPCA

This is the performance I am getting when trying the ICAPCA approach with phi = 1 and phi = 0.66.

It is clearly worse compared to the results published in the paper. To be sure that the worse results are not due to something I did wrong in the play phase, I took the precomputed SAR values that are provided in this repository.

Below I provide the results given in the paper. As you can see my results are falling significantly short of the ones provided in the paper.

image

Muscle Fatigue doesn't work for most model

I started debugging this issue. Either I don't understand what's going on, or there is something really wrong with our implementation. I'd need more information about our Fatigue model to understand what is being implemented.
Let me articulate what I have found so far

  • Issue seems to be with the way self.f_load is being calculated
  • f_load seems to depend on actuator_moment whose size is (nu x nv)
  • The implementation seems to be checking for nv==1 as a special case here. This conceptually seems wrong. Why would ndof = 1 be any different than many dof?
  • The implementation further goes on to only look at the first DoF for all its calculations and ignores all others. This seems seriously off.

My guess is that -- it was implemented for a single muscle single dof system and it has never been tested with a system with higher dof.
-- I also think that the arm and hand fatigue results are wrong
-- I also think the implementation has a massive memory leak. We keep appending f_load to the buffer throughout the existence of the env. The size of the buffer keys growing. We either need a cyclic buffer here, or f_load needs to be cleaned with at reset.

SMPL model limitations

The current joints are not articulated

  • hand fingers (hand)
  • foot metacarpal joints (needed for proper stepping behavior)

Retraining current best model flattens performance immediately

We trained our model using mjrl, with a PPO agent and MLP policy. When we try to improve our model using our current best model, the performance flattens immediately (see attachment in which we stopped training after 75 iterations and restarted training using the same reward function and 75-iter model). When we train an entirely new policy for 100 iterations, it keeps improving after 75 iterations. It seems that restarting the training has an influence on the performance of the training.

Do you have any idea if retraining a policy is possible and how to fix this problem?

Thanks in advance!
download

Testing the installation issues - https://myosuite.readthedocs.io/en/latest/install.html

Hi all,

I am going to try and participate in the challenge - it looks very exciting and thanks for setting up.
I'm just in the process of testing the installation following the guidance here: https://myosuite.readthedocs.io/en/latest/install.html but had some difficulties for Windows OS

python myosuite/tests/test_myo.py -> executing this line did not work, instead providing the full filepath enabled the test to execute in around 67 seconds.

python myosuite/utils/visualize_env.py --env_name myoElbowPose1D6MRandom-v0 - I don't have a file called visualize_env.py installed, instead examine_env.py ... which seems to render the environment as anticipated

Thanks,

Nicos

Installing Myosuite on MacOS Ventura 13.3.1

I followed the advanced installation guide to install Myosuite on my 2019 Macbook Pro (intel core i5). The Conda environment was tested with Python 3.7 and Python 3.8.
I initially used brew install gcc but got an error indicating gcc doesn't exist. Therefore I installed brew install gcc@7
I use the following command to link gcc and export the variable.
ln -sf /usr/local/bin/gcc-7 /usr/local/bin/gcc
export CC=/usr/local/bin/gcc-7

Finally, I got the following error with some other files also missing such as limits.h:
image
How do I go about solving this?

I tried to bring all the libraries to the local folder with the following symbolic link command but it didn't seem to be the issue.
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/

Please let me know if you need more information.

Incorrect thumb joints nomenclature

Hi,
I think the myoHand nomenclature related to the thumb joints (cmc_abduction, cmc_flexion, mp_flexion, ip_flexion) isn't correct for two reasons:

  1. for all the other fingers, the word after "_" is what happens toward the maximum value of qpos (e.g., when mcp2_flexion is max, the index finger is flexed) while the thumb joints are extended when _flexion is max. The same logic is for _abduction.
  2. cmc_abduction and cmc_flexion are reversed.

extra view

Can you do a model with both arms and shoulders active? Im quadriplegic and i want to visualise my torso. Could you help me do that?

Evaluation for die reorientation

I feel that the evaluation criteria for the die reorientation task are a bit restrictive. Some of my policies are able to solve the task, but only before or after the specific time window that would count as a success.

Would it be possible to relax this a bit?

I suggest an episode limit of 200 and measuring a success if the goal is reached for 5 consecutive time steps at any point in the episode.

This preserves the spirit of the task, but is a bit easier.

UnregisteredEnv problem in SAR tutorial Step 1.2

I followed the tutorial and completed many processes, but when I ran the code in step 1.2 :

SAR_RL(env_name=f'myoLeg{new_terrain}TerrainWalk-v0', policy_name='SAR-RL', timesteps=2.5e6, seed='0', ica=ica, pca=pca, normalizer=normalizer, phi=.66, syn_nosyn=False)

the following error occurred:


KeyError Traceback (most recent call last)
File ~/anaconda3/envs/SAR/lib/python3.8/site-packages/gym/envs/registration.py:132, in EnvRegistry.spec(self, path)
131 try:
--> 132 return self.env_specs[id]
133 except KeyError:
134 # Parse the env name and check to see if it matches the non-version
135 # part of a valid env (could also check the exact number here)

KeyError: 'myoLegStairsTerrainWalk-v0'

During handling of the above exception, another exception occurred:

UnregisteredEnv Traceback (most recent call last)
Cell In[25], line 1
----> 1 SAR_RL(env_name=f'myoLeg{new_terrain}TerrainWalk-v0', policy_name='SAR-RL', timesteps=2.5e6,
2 seed='0', ica=ica, pca=pca, normalizer=normalizer, phi=.66, syn_nosyn=False)
3 #HillyTerrainWalk-v0
4 #myoLegStairTerrainWalk-v0
5 #SAR_RL(env_name=f'myoLeg{new_terrain}StairsTerrainWalk-v0', policy_name='SAR-RL', timesteps=2.5e6,
6 # seed='0', ica=ica, pca=pca, normalizer=normalizer, phi=.66, syn_nosyn=False)

Cell In[8], line 17, in SAR_RL(env_name, policy_name, timesteps, seed, ica, pca, normalizer, phi, syn_nosyn)
15 env = SynNoSynWrapper(gym.make(env_name), ica, pca, normalizer, phi)
16 else:
---> 17 env = SynergyWrapper(gym.make(env_name), ica, pca, normalizer)
18 env = Monitor(env)
19 env = DummyVecEnv([lambda: env])

File ~/anaconda3/envs/SAR/lib/python3.8/site-packages/gym/envs/registration.py:156, in make(id, **kwargs)
155 def make(id, **kwargs):
--> 156 return registry.make(id, **kwargs)

File ~/anaconda3/envs/SAR/lib/python3.8/site-packages/gym/envs/registration.py:100, in EnvRegistry.make(self, path, **kwargs)
98 else:
99 logger.info('Making new env: %s', path)
--> 100 spec = self.spec(path)
101 env = spec.make(**kwargs)
102 # We used to have people override _reset/_step rather than
103 # reset/step. Set _gym_disable_underscore_compat = True on
104 # your environment if you use these methods and don't want
105 # compatibility code to be invoked.

File ~/anaconda3/envs/SAR/lib/python3.8/site-packages/gym/envs/registration.py:142, in EnvRegistry.spec(self, path)
140 raise error.DeprecatedEnv('Env {} not found (valid versions include {})'.format(id, matching_envs))
141 else:
--> 142 raise error.UnregisteredEnv('No registered env with id: {}'.format(id))

UnregisteredEnv: No registered env with id: myoLegStairsTerrainWalk-v0

Question about calling the 'gym.make' function and associated file for 'myoElbowPose1D6MRandom-v0'

Hello,
I have a question regarding the following code snippet:
import myosuite
import gym
env = gym.make('myoElbowPose1D6MRandom-v0')
env.reset()
for _ in range(1000):
env.sim.render(mode='window')
env.step(env.action_space.sample()) # take a random action
env.close()
In this code, I noticed the usage of the gym.make function with the argument 'myoElbowPose1D6MRandom-v0'. I'm curious about how this function call is handled and if there is a specific file that controls the environment with the name 'myoElbowPose1D6MRandom-v0'.

Could you please provide some insight into the internal workings of gym.make and how it retrieves and initializes the specified environment? Additionally, I would appreciate any information on the file structure or configuration associated with the environment named 'myoElbowPose1D6MRandom-v0'.

Thank you in advance for your assistance!

Best regards,
Abdul haq Ayantayo

Help request to apply inverse dynamics on myohand model

Hi,
I'm trying to exploit MuJoCo's inverse dynamics to get ctrl given target qpos. Following MuJoCo's documentation, I then implemented the following function:

import scipy.optimize as optimize
from copy import deepcopy
import numpy as np
import mujoco

def get_ctrl(model, data, target_qpos):
    data_copy = deepcopy(data)
    # ---- qfrc computation
    data_copy.qpos = target_qpos.copy()
    mujoco.mj_forward(model, data_copy)
    data_copy.qacc = 0
    mujoco.mj_inverse(model, data_copy)
    qfrc = data_copy.qfrc_inverse.copy()
    # ---- afrc computation
    amnt = data_copy.actuator_moment.copy()
    afrc = np.zeros(model.nu,)
    sign_constr = ({'type':'ineq', 'fun': lambda afrc: -afrc}) # only negative actuator forces allowed
    cost_function = lambda afrc: np.linalg.norm(afrc @ amnt - qfrc)
    result = optimize.minimize(cost_function, afrc, method='COBYLA', constraints=sign_constr)
    actuator_force = result.x
    # ---- act computation
    act = np.zeros(actuator_force.shape)
    for idx_actuator, force in enumerate(actuator_force):
        length = data_copy.actuator_length[idx_actuator]
        lengthrange = model.actuator_lengthrange[idx_actuator]
        acc0 = model.actuator_acc0[idx_actuator]
        prmb = model.actuator_biasprm[idx_actuator][:9]
        prmg = model.actuator_gainprm[idx_actuator][:9]
        bias = mujoco.mju_muscleBias(length, lengthrange, acc0, prmb)
        gain = mujoco.mju_muscleGain(length, 0, lengthrange, acc0, prmg)
        act[idx_actuator] = min(max((force - bias) / gain, 0), 1)
    return act

Sometimes this function works quite well (i.e., applying the obtained ctrl I'm able to get the target position) but often (most of the time) there are individual qpos values wrong by about 90°, while other times the obtained position is completely wrong.
I therefore think that maybe I'm doing something very wrong without realising it.

Do you have any hints about this?
Thank you very much for your support.

Issue with DepRL Policy Rollout and Agent Stability

Hello!

I recently encountered an issue with the DepRL policy while attempting to generate a rollout of the agent's walking pattern. A few weeks ago, when I conducted the initial test, the agent managed to walk stably for over an hour. However, during this week's testing, its performance significantly deteriorated, causing it to fall after just 1-2 steps. Additionally, I observed a change in the initial position of myoLegWalking-v0. Previously, it began from a stable, standing position with both feet firmly on the ground, but the current position seems less stable in comparison. I am using the DepRL tutorial to obtain the rollout, attached below.

Were there any updates made in the past few weeks that could potentially result in this issue? Thank you for your time!

import gym
import myosuite
import deprl
env = gym.make('myoLegWalk-v0')
policy = deprl.load_baseline(env)
obs = env.reset()
for i in range(1000):
    env.mj_render()
    action = policy(obs)
    obs, *_ = env.step(action)
env.close()

Upgrade to Mujoco 2.2.0

Thanks for the release, great project! Do you consider upgrading your repo to the latest, open-sourced Mujoco 2.2.0 version?

Issue running example.

Hello,

I am having issues with running the examples. My Ubuntu version is 22.04.1.
I am doing the following:
conda create -n "my_new_env" python=3.7.1 ipython
conda activate my_new_env
pip install free-mujoco-py (I was previously trying to install the latest version which likely was an issue!)
pip install -U myosuite

I then run into 2 errors which are somewhat identical:
/home/nicos/miniconda3/envs/my_new_env/lib/python3.7/site-packages/mujoco_py/gl/osmesashim.c:1:10:
fatal error: GL/osmesa.h: no such file or directory; compilation terminated

Any advice to overcome these issues are greatly appreciated!

Thanks,

Nicos

How to get the muscle activation signal like Figure.10 showed in paper?

Hi myosuite team,

Thanks for your contribution.
I had some issues getting the muscle signal using myosuite (eg, force, fatigue, and velocity, among other things). Through the model attribute I haven't find anything related. Can you show how you get paper 'MYOSUITE A CONTACT-RICH SIMULATION SUITE FOR MUSCULOSKELETAL MOTOR CONTROL' Figure.10?
I hope to know how you get the muscle signal and how to find the muscle activations along a given pose trajectory over time.

Thanks for your patience

Will MyoSim be released?

Hi, Thanks for releasing the MyoSuite. It really helped me a lot. And I am interested in MyoSim, will MyoSim be released?

Suspected presence of actuator push forces

Hi,
First of all, thank you very much for the amazing work you are doing with MyoSuite; I am trying to adopt it for my research activity.
I am opening this issue because I encountered something I did not expect. Maybe it is a problem, or maybe I misunderstood something.

I was investigating the various data and attributes of the model and, plotting the env.sim.data.actuator_force attribute while MyoHand was posing ✌, I noticed that the actuator force related to muscle RI5 resulted in positive values. I was expecting only negative values (pull forces) or zeros. Also, it is not clear to me why the env.sim.model.actuator_forcerange attribute is always equal to [0,0].

The used code is reported below, and the trained policy is attached victory_policy3_1M.zip, so that the case study can be reproduced.

Thank you

from matplotlib import pyplot as plt
from stable_baselines3 import PPO
import numpy as np
import myosuite
import gym

""" LOAD ENVIRONMENT """
env = gym.make('myoHandPoseFixed-v0', normalize_act=False)
env.reset()

""" LOAD POLICY """
policy = "victory_policy3_1M.zip"
pi = PPO.load(policy)

""" TARGET SETTING """
targetAngles = [env.sim.model.jnt_range[0][1],  # pro_sup
                0,                              # deviation
                env.sim.model.jnt_range[2][0],  # flexion
                env.sim.model.jnt_range[3][0],  # cmc_abduction
                env.sim.model.jnt_range[4][0],  # cmc_flexion
                env.sim.model.jnt_range[5][0],  # mp_flexion
                env.sim.model.jnt_range[6][0],  # ip_flexion
                env.sim.model.jnt_range[7][0],  # mcp2_flexion
                np.mean(env.sim.model.jnt_range[8]),  # mcp2_abduction
                env.sim.model.jnt_range[9][0],  # pm2_flexion
                env.sim.model.jnt_range[10][0], # md2_flexion
                env.sim.model.jnt_range[11][0], # mcp3_flexion 
                env.sim.model.jnt_range[12][0], # mcp3_abduction
                env.sim.model.jnt_range[13][0], # pm3_flexion
                env.sim.model.jnt_range[14][0], # md3_flexion
                env.sim.model.jnt_range[15][1], # mcp4_flexion
                env.sim.model.jnt_range[16][1], # mcp4_abduction
                env.sim.model.jnt_range[17][1], # pm4_flexion
                env.sim.model.jnt_range[18][1], # md4_flexion
                env.sim.model.jnt_range[19][1], # mcp5_flexion
                env.sim.model.jnt_range[20][1], # mcp5_abduction
                env.sim.model.jnt_range[21][1], # pm5_flexion
                env.sim.model.jnt_range[22][1]  # md5_flexion
]
env.env.target_jnt_value = np.array(targetAngles)
env.env.target_type = 'fixed'
env.env.update_target()

""" RENDERING OPTIONS """
env.mj_render()
# set minimal rendering
env.sim.renderer._window.opt.flags[0:-1] = 0
env.sim.renderer._window.opt.flags[[4,7,21]] = 1 # keep only actuator (4), tendon (7), static body (21)
env.sim.renderer._window.opt.geomgroup[1:-1] = 0 # keep only the skeleton
env.sim.renderer._window.opt.sitegroup[0:-1] = 0 # remove sites
env.sim.renderer._window.scn.flags[0:-1] = 0 # remove shadows, reflections, etc.
# camera orientation
env.sim.renderer._window.cam.distance = 0.67
env.sim.renderer._window.cam.azimuth = 90
env.sim.renderer._window.cam.elevation = -10.24
# model position within the screen
env.sim.renderer._window.cam.lookat[0] = -0.1266
env.sim.renderer._window.cam.lookat[1] = -0.1843
env.sim.renderer._window.cam.lookat[2] = 1.364

""" MAIN LOOP """
actuator_force = np.zeros_like(env.sim.data.actuator_force)
for _ in range(3):
    env.reset()
    done = False
    all_rwd = []
    ii = 0
    while not done or ii<100:
        o = env.get_obs()
        a = pi.predict(o)[0]
        next_o, r, done, info = env.step(a)
        actuator_force = np.vstack((actuator_force, env.sim.data.actuator_force))
        ii += 1
env.close()

""" DATA PLOTTING """
musclesList = ['ECRL', 'ECRB', 'ECU', 'FCR', 'FCU', 'PL', 'PT', 'PQ', 'FDS5', 'FDS4', 'FDS3', 'FDS2', 'FDP5',
               'FDP4', 'FDP3', 'FDP2', 'EDC5', 'EDC4', 'EDC3', 'EDC2', 'EDM', 'EIP', 'EPL', 'EPB', 'FPL', 'APL',
               'OP', 'RI2', 'LU_RB2', 'UI_UB2', 'RI3', 'LU_RB3', 'UI_UB3', 'RI4', 'LU_RB4', 'UI_UB4', 'RI5', 'LU_RB5', 'UI_UB5']
# fig, ax = plt.subplots(); ax.imshow(actuator_force.T, aspect='auto'); ax.set_title('actuator_force'); ax.set_xlabel('timesteps'); ax.set_yticks(np.arange(len(musclesList)), labels=musclesList); fig.show()
fig, ax = plt.subplots(); ax.imshow((actuator_force.T>0), aspect='auto'); ax.set_title('actuator_force'); ax.set_xlabel('timesteps'); ax.set_yticks(np.arange(len(musclesList)), labels=musclesList); fig.show()
input()

Missing xml files in 1.4.0 installation

I tried to update the latest version (1.4.0) of myosuite using pip install -U myosuite but when I try to create an environment it indicates that the associated xml file does not exist :

OSError: File ../mujoco_env/lib/python3.8/site-packages/myosuite/envs/myo/../../simhive/myo_sim/finger/myo_finger_v0.xml does not exist

When browsing the installed folders I cannot find any mjb or xml files for the different models.

Is there anything I'm missing ?

Broken 2_Load_policy tutorial

Playback of a previous version of the policy on a new version of MyoSuite results in an error

raise error.DependencyNotInstalled("{}. (HINT: you need to install mujoco_py, and also perform the setup instructions here: [https://github.com/openai/mujoco-py/.](https://github.com/openai/mujoco-py/))".format(e))
gym.error.DependencyNotInstalled: DLL load failed while importing cymj: The specified module could not be found.. (HINT: you need to install mujoco_py, and also perform the setup instructions here: [https://github.com/openai/mujoco-py/.](https://github.com/openai/mujoco-py/)

The previous version of Myosuite depended on mujoco_py which was a dead horse. We replaced this dependency with the new official mujoco bindings.

  • Moving forward, we should retrain these baselines to make them compatible with new versions
  • For now, you can skip this tutorial, or train something of your own 🙂 with the latest version of MyoSuite

Myosuit with windows

It seems that Myosuit only works on Linux and Mac. Does it also works on windows or not?

ModuleNotFoundError: No module named 'mjrl'

When I run example 2_Load_policy, I encountered this error:
Traceback (most recent call last):
File "/home/zxx/Demo/github/myosuite/docs/source/tutorials/03_Analyse_movements.py", line 12, in
pi = pickle.load(open(policy, 'rb'))
ModuleNotFoundError: No module named 'mjrl',
how can I solve this problem?

Issue with installment

I have created the myosuite environment and I am ready to test the environment. But I meet a problem.:
WARNING:absl:mju_openResource: unknown file '/home/hym/code/myosuite/myosuite/envs/myo/myochallenge/../assets/hand/../../../../simhive/myo_sim/hand/assets/myohand_assets.xml'

Issue with Motor Control Range in myoelbow_1dof6muscles_1dofexo_body.xml

In the file myoelbow_1dof6muscles_1dofexo_body.xml, there's a motor definition:

<motor name="Exo" joint="r_elbow_flex" gear="8.5"/>

Through our tests on the model, we found that the control range [-1,1] is the default and aligns with normalized action requirements. However, a control_signal of -0.3 corresponds to a joint_angle of 0 radians, and a control_signal of 0.8 corresponds to a joint_angle of 2.27 radians. This mapping doesn't cover the entire joint angle range.

Additionally, when we set the gear value to 1, the change in joint_angle is not equal to the change in control_signal. Are there other factors influencing this behavior?

Could you clarify the purpose of setting the gear to "8.5"? Thank you so much!

How to reproduce the DepRL result on MyoLeg walking environment?

Hi, thanks for your helpful environment. The deprl result on the myoleg walking task looks truly natural. However, I have reproduced the training process, and the result don't looks natural. Could you give me some insight on how to generate a natural gait?

Update needed for 4b_reflex tutorial

Hello, I just encountered an issue running the tutorial "4b_reflex".

When I run the jupyter notebook, it gives the error: ERROR: myoLegDemo-v0 not found in env registry and mjb mentioned in the tutorial is not matching with the mjb file in myosuite/myosuite/simhive/myo_sim/leg/.

Although I replaced those with the environments and mjb files available in the repo, it doesn't work. Any advice on how to fix this? Thank you very much.

Release of Full Upper-Limb Model

Dear Myosuite team,

During the workshop at ICRA, Vikash had mentioned that the full upper-limb model will be released soon. Has that already been released? If not, when could we expect it to be released?

Thank you,

Regards,

Rejin

State inputs for MyoChallenge

Is it possible to make more state information available for the myochallenge?

The tasks might be more feasible if we can include basic information that is readily available to humans, like:

  • finger joint velocities
  • muscle lengths
  • muscle velocities
  • muscle fibre forces

I am sure other people might have other requests, feel free to reply!

If the state inputs would be part of the obs_dict, everyone could choose for themselves what to include. All of these are already available in the simulator.

Access joint limit violation force without using xml sensors.

Hi everyone,
several people have approached me to ask how to implement joint limit violation forces, as used in my recent preprint

My implementation uses limit force sensors embedded in the xml files. These are quite inconvenient and it's not always possible to edit the xml files for every model.

I'm wondering if there is a programmatic way of accessing this information? I think it would be a great service to the community to implement a function like

force_value = get_limitfrc(joint_name)

But I'm a bit unsure how to do it. I tried starting with efc_type and efc_force, but it's unclear how you would relate this to the joint name.

Envpool support

I was wondering if you plan to support building the myosuite environments via envpool:

EnvPool is a C++-based batched environment pool with pybind11 and thread pool. It has high performance (~1M raw FPS with Atari games, ~3M raw FPS with Mujoco simulator on DGX-A100) and compatible APIs (supports both gym and dm_env, both sync and async...

Their benchmarks on Mujoco environments show free 2x speedups even on a single environment, 3x speedups on a 12-core laptop, and ~15-20x speedups on a 256-core machine.

I realize that this might be a bit involved, but envpool has a seemingly straightforward API to add new environments and all of the myosuite envs could just live under envpool/mujoco/gym or have a special folder for myosuite.

Problems about SAR tutorial installment

Hello! I am trying to use SAR tutorial. But when I install stable-baselines3==1.7.0. I run !pip install stable-baselines3==1.7.0.
then there has errors like below.

Collecting stable-baselines3==1.7.0
Using cached stable_baselines3-1.7.0-py3-none-any.whl (171 kB)
Collecting gym==0.21 (from stable-baselines3==1.7.0)
Using cached gym-0.21.0.tar.gz (1.5 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
error in gym setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Get muscle data on MyoSuite based on sensor input

Hi MyoSuite Developers,

Thank you for creating a very interesting hand musculoskeletal simulation.

I am currently working on a hand rehabilitation project for a post-stroke patient.
I want to get hand muscle data in a MujoCo simulation based on data input from sensors such as Leap Motion or Smart Gloves.
How do I change the angle of the hand movement in the MujoCo simulation based on the sensor and get the muscle data?

Thank you
Best regards.

Anom

Skin is not rendered

With the current version of mujoco-py the skin is not rendered.

One workaround would be to install a patch via:
pip3 install --user --force-reinstall --no-compile git+https://github.com/hermanjakobsen/mujoco-py
see here

hand observations in relocate and reorient of myochallenge skips MD5 joint

In relocate and reorient env of the myochallenge, the observation accidentally omits the MD5 (little finger distal) joint from the hand_qpos key. This bug omits the distal joint of the little finger from being included in the observation.

obs_dict['hand_qpos'] = sim.data.qpos[:-7].copy() # This is a bug. 

A fix for this bug would look like this

obs_dict['hand_qpos'] = sim.data.qpos[:-6].copy() # V1 of the env will use this corrected key by default

A fix to this will break all the submitted policies of the MyoChallenge. Therefore a fix will be pushed after the myochallenge23
and the env version will be bumped to v1

As a stop-gap solution, the keys are being renamed to hand_qpos_noMD5 to reflect what it currently has, and DEFAULT_OBS_KEYS is being updated to select this key. A corrected key hand_qpos is also getting added to the env but will not be used in the current version (v0) of the envs that are being used in the MyoChallenge23. This corrected key will become the default at a later date after the challenge is over

# This is a bug. This bug omits the distal joint of the little finger from the observation.
#  A fix to this will break all the submitted policies. To clearly mark the key is getting 
# renamed to hand_qpos_noMD5 that marks this exclusion
obs_dict['hand_qpos_noMD5'] = sim.data.qpos[:-7].copy() 
# This is the fix. V1 of the env will use this corrected key by default
#  A fix to this will be pushed after the myochallenge23
obs_dict['hand_qpos'] = sim.data.qpos[:-6].copy()

This needs to be qpos[:-6].

Release of MyoSim

Thank you for the great platform you built. May I ask if you are planning to open-source MyoSim as written in your paper? Thank you

Setup env.yml file corrupted

The advanced instructions to set up the environment via the yaml file env.yml throw an error:

    raise ParserError(
ruamel_yaml.parser.ParserError: while parsing a block mapping
  in "<unicode string>", line 15, column 3:
    - pip:
      ^ (line: 15)
expected <block end>, but found ','
  in "<unicode string>", line 27, column 18:
      - 'h5py==3.7.0',
                     ^ (line: 27)

Seeking further explanation on the meaning, calculation method and size of each key in the observation

I noticed that each virtual environment object has a DEFAULT_OBS_KEYS list, which gives the names of the different parts of the observation, but I couldn’t find the code for the meaning as well as calculation method corresponding to these key abbreviations, nor am I sure about the size of each key. Could you please explain more about this? Or could you point out the code module that can answer these questions?

Example 1 is broken

The example 1 tries to setup the environment using the camera hand_bottom but it does not exist.

Installation of Myosuite fails

Following the installation instructions in myosuite/setup/README.md fails at the line pip install -e . with the error message:

`Obtaining file:///home/elladyr/workspace/Msuite-test
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build editable ... error
error: subprocess-exited-with-error

× Getting requirements to build editable did not run successfully.
│ exit code: 1
╰─> [38 lines of output]
running egg_info
/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/setuptools/dist.py:552: UserWarning: The version specified ('{{VERSION_PLACEHOLDER}}') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
"details." % version
Traceback (most recent call last):
File "/home/elladyr/anaconda3/envs/Msuite-test/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/home/elladyr/anaconda3/envs/Msuite-test/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/elladyr/anaconda3/envs/Msuite-test/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 132, in get_requires_for_build_editable
return hook(config_settings)
File "/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 447, in get_requires_for_build_editable
return self.get_requires_for_build_wheel(config_settings)
File "/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 335, in run_setup
exec(code, locals())
File "", line 57, in
File "/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/setuptools/init.py", line 108, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 1213, in run_command
super().run_command(command)
File "/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.ensure_finalized()
File "/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
self.finalize_options()
File "/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 219, in finalize_options
parsed_version = parse_version(self.egg_version)
File "/tmp/pip-build-env-8mtsqnwe/overlay/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/version.py", line 197, in init
raise InvalidVersion(f"Invalid version: '{version}'")
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '-VERSION-PLACEHOLDER-'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build editable did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.`

The error seems to originate from myosuite/setup.py with the line version="{{VERSION_PLACEHOLDER}}". Adding a random version number solves the installation issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.