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

envs robotics - touch sensors - Shadow Hand #1299

Merged
merged 15 commits into from
Feb 9, 2019
Merged
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
21 changes: 21 additions & 0 deletions gym/envs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,13 @@ def _merge(a, b):
max_episode_steps=100,
)

register(
matthiasplappert marked this conversation as resolved.
Show resolved Hide resolved
id='HandManipulateBlockTouchSensors{}-v0'.format(suffix),
entry_point='gym.envs.robotics:HandBlockTouchSensorsEnv',
kwargs=_merge({'target_position': 'random', 'target_rotation': 'xyz'}, kwargs),
max_episode_steps=100,
)

register(
id='HandManipulateEggRotate{}-v0'.format(suffix),
entry_point='gym.envs.robotics:HandEggEnv',
Expand All @@ -399,6 +406,13 @@ def _merge(a, b):
max_episode_steps=100,
)

register(
id='HandManipulateEggTouchSensors{}-v0'.format(suffix),
entry_point='gym.envs.robotics:HandEggTouchSensorsEnv',
kwargs=_merge({'target_position': 'random', 'target_rotation': 'xyz'}, kwargs),
max_episode_steps=100,
)

register(
id='HandManipulatePenRotate{}-v0'.format(suffix),
entry_point='gym.envs.robotics:HandPenEnv',
Expand All @@ -421,6 +435,13 @@ def _merge(a, b):
max_episode_steps=100,
)

register(
id='HandManipulatePenTouchSensors{}-v0'.format(suffix),
entry_point='gym.envs.robotics:HandPenTouchSensorsEnv',
kwargs=_merge({'target_position': 'random', 'target_rotation': 'xyz'}, kwargs),
max_episode_steps=100,
)

# Atari
# ----------------------------------------

Expand Down
4 changes: 4 additions & 0 deletions gym/envs/robotics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
from gym.envs.robotics.hand.manipulate import HandBlockEnv
from gym.envs.robotics.hand.manipulate import HandEggEnv
from gym.envs.robotics.hand.manipulate import HandPenEnv

from gym.envs.robotics.hand.manipulate_touch_sensors import HandBlockTouchSensorsEnv
from gym.envs.robotics.hand.manipulate_touch_sensors import HandEggTouchSensorsEnv
from gym.envs.robotics.hand.manipulate_touch_sensors import HandPenTouchSensorsEnv
42 changes: 42 additions & 0 deletions gym/envs/robotics/assets/hand/manipulate_block_touch_sensors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<mujoco>
<compiler angle="radian" coordinate="local" meshdir="../stls/hand" texturedir="../textures"></compiler>
<option timestep="0.002" iterations="20" apirate="200">
<flag warmstart="enable"></flag>
</option>

<include file="shared.xml"></include>
<include file="shared_touch_sensors_92.xml"></include>

<asset>
<include file="shared_asset.xml"></include>

<texture name="texture:object" file="block.png" gridsize="3 4" gridlayout=".U..LFRB.D.."></texture>
<texture name="texture:hidden" file="block_hidden.png" gridsize="3 4" gridlayout=".U..LFRB.D.."></texture>

<material name="material:object" texture="texture:object" specular="1" shininess="0.3" reflectance="0"></material>
<material name="material:hidden" texture="texture:hidden" specular="1" shininess="0.3" reflectance="0"></material>
<material name="material:target" texture="texture:object" specular="1" shininess="0.3" reflectance="0" rgba="1 1 1 0.5"></material>
</asset>

<worldbody>
<geom name="floor0" pos="1 1 0" size="1 1 1" type="plane" condim="3" material="floor_mat"></geom>
<body name="floor0" pos="1 1 0"></body>

<include file="robot_touch_sensors_92.xml"></include>

<body name="object" pos="1 0.87 0.2">
<geom name="object" type="box" size="0.025 0.025 0.025" material="material:object" condim="4" density="567"></geom>
<geom name="object_hidden" type="box" size="0.024 0.024 0.024" material="material:hidden" condim="4" contype="0" conaffinity="0" mass="0"></geom>
<site name="object:center" pos="0 0 0" rgba="1 0 0 0" size="0.01 0.01 0.01"></site>
<joint name="object:joint" type="free" damping="0.01"></joint>
</body>
<body name="target" pos="1 0.87 0.2">
<geom name="target" type="box" size="0.025 0.025 0.025" material="material:target" condim="4" group="2" contype="0" conaffinity="0"></geom>
<site name="target:center" pos="0 0 0" rgba="1 0 0 0" size="0.01 0.01 0.01"></site>
<joint name="target:joint" type="free" damping="0.01"></joint>
</body>

<light directional="true" ambient="0.2 0.2 0.2" diffuse="0.8 0.8 0.8" specular="0.3 0.3 0.3" castshadow="false" pos="0 1 4" dir="0 0 -1" name="light0"></light>
</worldbody>
</mujoco>
1 change: 1 addition & 0 deletions gym/envs/robotics/assets/hand/manipulate_egg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

<texture name="texture:object" file="block.png" gridsize="3 4" gridlayout=".U..LFRB.D.."></texture>
<texture name="texture:hidden" file="block_hidden.png" gridsize="3 4" gridlayout=".U..LFRB.D.."></texture>

<material name="material:object" texture="texture:object" specular="1" shininess="0.3" reflectance="0"></material>
<material name="material:hidden" texture="texture:hidden" specular="1" shininess="0.3" reflectance="0"></material>
<material name="material:target" texture="texture:object" specular="1" shininess="0.3" reflectance="0" rgba="1 1 1 0.5"></material>
Expand Down
42 changes: 42 additions & 0 deletions gym/envs/robotics/assets/hand/manipulate_egg_touch_sensors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<mujoco>
<compiler angle="radian" coordinate="local" meshdir="../stls/hand" texturedir="../textures"></compiler>
<option timestep="0.002" iterations="20" apirate="200">
<flag warmstart="enable"></flag>
</option>

<include file="shared.xml"></include>
<include file="shared_touch_sensors_92.xml"></include>

<asset>
<include file="shared_asset.xml"></include>

<texture name="texture:object" file="block.png" gridsize="3 4" gridlayout=".U..LFRB.D.."></texture>
<texture name="texture:hidden" file="block_hidden.png" gridsize="3 4" gridlayout=".U..LFRB.D.."></texture>

<material name="material:object" texture="texture:object" specular="1" shininess="0.3" reflectance="0"></material>
<material name="material:hidden" texture="texture:hidden" specular="1" shininess="0.3" reflectance="0"></material>
<material name="material:target" texture="texture:object" specular="1" shininess="0.3" reflectance="0" rgba="1 1 1 0.5"></material>
</asset>

<worldbody>
<geom name="floor0" pos="1 1 0" size="1 1 1" type="plane" condim="3" material="floor_mat"></geom>
<body name="floor0" pos="1 1 0"></body>

<include file="robot_touch_sensors_92.xml"></include>

<body name="object" pos="1 0.87 0.2">
<geom name="object" type="ellipsoid" size="0.03 0.03 0.04" material="material:object" condim="4"></geom>
<geom name="object_hidden" type="ellipsoid" size="0.029 0.029 0.03" material="material:hidden" condim="4" contype="0" conaffinity="0" mass="0"></geom>
<site name="object:center" pos="0 0 0" rgba="1 0 0 0" size="0.01 0.01 0.01"></site>
<joint name="object:joint" type="free" damping="0.01"></joint>
</body>
<body name="target" pos="1 0.87 0.2">
<geom name="target" type="ellipsoid" size="0.03 0.03 0.04" material="material:target" condim="4" group="2" contype="0" conaffinity="0"></geom>
<site name="target:center" pos="0 0 0" rgba="1 0 0 0" size="0.01 0.01 0.01"></site>
<joint name="target:joint" type="free" damping="0.01"></joint>
</body>

<light directional="true" ambient="0.2 0.2 0.2" diffuse="0.8 0.8 0.8" specular="0.3 0.3 0.3" castshadow="false" pos="0 1 4" dir="0 0 -1" name="light0"></light>
</worldbody>
</mujoco>
41 changes: 41 additions & 0 deletions gym/envs/robotics/assets/hand/manipulate_pen_touch_sensors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<mujoco>
<compiler angle="radian" coordinate="local" meshdir="../stls/hand" texturedir="../textures"></compiler>
<option timestep="0.002" iterations="20" apirate="200">
<flag warmstart="enable"></flag>
</option>

<include file="shared.xml"></include>
<include file="shared_touch_sensors_92.xml"></include>

<asset>
<include file="shared_asset.xml"></include>

<material name="material:object" specular="0" shininess="0.5" reflectance="0.0" rgba="0.46 0.81 0.88 1.0"></material>
<material name="material:target" specular="0" shininess="0.5" reflectance="0.0" rgba="0.46 0.81 0.88 0.5"></material>
</asset>

<worldbody>
<geom name="floor0" pos="1 1 -0.2" size="1 1 1" type="plane" condim="3" material="floor_mat"></geom>
<body name="floor0" pos="1 1 0"></body>

<include file="robot_touch_sensors_92.xml"></include>

<body name="object" pos="1 0.87 0.2" euler="-1 1 0">
<geom name="object" type="capsule" size="0.008 0.1" material="material:object" condim="4"></geom>
<site name="object:center" pos="0 0 0" rgba="1 0 0 0" size="0.01 0.01 0.01"></site>
<site name="object:top" pos="0 0 0.1" rgba="1 0 0 1" size="0.0081"></site>
<site name="object:bottom" pos="0 0 -0.1" rgba="0 1 0 1" size="0.0081"></site>
<joint name="object:joint" type="free" damping="0.01"></joint>
</body>
<body name="target" pos="1 0.87 0.2" euler="-1 1 0">
<geom name="target" type="capsule" size="0.008 0.1" material="material:target" condim="4" group="2" contype="0" conaffinity="0"></geom>
<site name="target:center" pos="0 0 0" rgba="1 0 0 0" size="0.01 0.01 0.01"></site>
<site name="target:top" pos="0 0 0.1" rgba="1 0 0 0.5" size="0.0081"></site>
<site name="target:bottom" pos="0 0 -0.1" rgba="0 1 0 0.5" size="0.0081"></site>
<joint name="target:joint" type="free" damping="0.01"></joint>
</body>

<light directional="true" ambient="0.2 0.2 0.2" diffuse="0.8 0.8 0.8" specular="0.3 0.3 0.3" castshadow="false" pos="0 1 4" dir="0 0 -1" name="light0"></light>
</worldbody>
</mujoco>
Loading