Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic arm reaching environment created, myoArmReachRandom-v0 #232

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
34 changes: 34 additions & 0 deletions myosuite/envs/myo/assets/arm/myoarm_reach.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<mujoco model="MyoArm_NoHand_v0.01">
<!-- =================================================
Copyright 2020 Vikash Kumar, Vittorio Caggiano, Guillaume Durandau
Model :: Myo Arm No Hand (MuJoCoV2.0)
Author :: Vikash Kumar ([email protected]), 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="../../../../simhive/myo_sim/arm/assets/myoarm_nohand_assets.xml"/>
<include file="../../../../simhive/myo_sim/scene/myosuite_scene.xml"/>
<compiler meshdir='../../../../simhive/myo_sim/' texturedir='../../../../simhive/myo_sim/'/>

<asset>
<mesh file="../myo_sim/meshes/human_lowpoly_norighthand.stl" name="body_norighthand"/>
</asset>

<worldbody>

<!-- ======= MyoArm ======= -->
<geom name="body" type="mesh" mesh="body_norighthand" euler="0 0 3.14" contype="0" conaffinity="0"/>
<body name="full_body" pos="-.025 0.1 1.40">
<include file="../../../../simhive/myo_sim/arm/assets/myoarm_body.xml"/>
</body>

<site name="forearm_tip_target" pos="0 0.002 0" rgba="0 1 0 .3" size="0.02"/>

</worldbody>

<keyframe>
<key qpos='-0.0707426 0.0299604 -0.0299638 0.0707454 -0.0143074 0.115747 0.0520177 -0.0520191 -0.115749 0.0143169 1.2671 0 -1.267 -0.013375 0 0.45559 0.173656 -0.141372 -0.500336 -0.780052 -0.383593 -0.0390846 0.0475231 -0.261981 0.0147788 0.00868063 0.00578373 -0.261937 0.00697434 0.00890255 -8.61942e-05 -0.261899 -2.25553e-05 0.00771655 -7.32368e-05 -0.133003 -1.74538e-05 0'/>
</keyframe>

</mujoco>
29 changes: 28 additions & 1 deletion myosuite/envs/myo/myobase/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,4 +517,31 @@ def register_env_with_variants(id, entry_point, max_episode_steps, kwargs):
'normalize_act': True,
'frame_skip': 5,
}
)
)

# Arm Reaching ==============================
register_env_with_variants(id='myoArmReachFixed-v0',
entry_point='myosuite.envs.myo.myobase.reach_v0:ReachEnvV0',
max_episode_steps=150,
kwargs={
'model_path': curr_dir+'/../assets/arm/myoarm_reach.xml',
'target_reach_range': {
'forearm_tip': ((-0.2, -0.2, 1.2), (-0.2, -0.2, 1.2)),
},
'normalize_act': True,
'far_th': 1.
}
)

register_env_with_variants(id='myoArmReachRandom-v0',
entry_point='myosuite.envs.myo.myobase.reach_v0:ReachEnvV0',
max_episode_steps=150,
kwargs={
'model_path': curr_dir+'/../assets/arm/myoarm_reach.xml',
'target_reach_range': {
'forearm_tip': ((-0.2-0.15, -0.2-0.15, 1.2-0.15), (-0.2+0.15, -0.2+0.15, 1.2+0.15)),
},
'normalize_act': True,
'far_th': 1.
}
)
Loading