Skip to content

Commit

Permalink
Merge pull request #50 from dfki-ric/feature/register_default_envs
Browse files Browse the repository at this point in the history
Feature/register default envs
  • Loading branch information
mlaux1 authored Jun 28, 2024
2 parents a80594e + 0297a52 commit d87402e
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 32 deletions.
62 changes: 62 additions & 0 deletions deformable_gym/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,79 @@
register(
id="FloatingMiaGraspInsole-v0",
entry_point="deformable_gym.envs.floating_mia_grasp_env:FloatingMiaGraspEnv",
disable_env_checker=True,
kwargs={
"object_name": "insole_on_conveyor_belt/back",
"observable_object_pos": True,
},
)

register(
id="FloatingMiaGraspPillow-v0",
entry_point="deformable_gym.envs.floating_mia_grasp_env:FloatingMiaGraspEnv",
disable_env_checker=True,
kwargs={
"object_name": "pillow_small",
"observable_object_pos": True,
},
)

register(
id="FloatingShadowGraspInsole-v0",
entry_point="deformable_gym.envs.floating_shadow_grasp_env:FloatingShadowGraspEnv",
disable_env_checker=True,
kwargs={
"object_name": "insole_on_conveyor_belt/back",
"observable_object_pos": True,
},
)

register(
id="FloatingShadowGraspPillow-v0",
entry_point="deformable_gym.envs.floating_shadow_grasp_env:FloatingShadowGraspEnv",
disable_env_checker=True,
kwargs={
"object_name": "pillow_small",
"observable_object_pos": True,
},
)

register(
id="URMiaGraspInsole-v0",
entry_point="deformable_gym.envs.ur5_mia_grasp_env:UR5MiaGraspEnv",
disable_env_checker=True,
kwargs={
"object_name": "insole_on_conveyor_belt/back",
"observable_object_pos": True,
},
)

register(
id="URMiaGraspPillow-v0",
entry_point="deformable_gym.envs.ur5_mia_grasp_env:UR5MiaGraspEnv",
disable_env_checker=True,
kwargs={
"object_name": "pillow_small",
"observable_object_pos": True,
},
)

register(
id="URShadowGraspInsole-v0",
entry_point="deformable_gym.envs.ur10_shadow_grasp_env:UR10ShadowGraspEnv",
disable_env_checker=True,
kwargs={
"object_name": "insole_on_conveyor_belt/back",
"observable_object_pos": True,
},
)

register(
id="URShadowGraspPillow-v0",
entry_point="deformable_gym.envs.ur10_shadow_grasp_env:UR10ShadowGraspEnv",
disable_env_checker=True,
kwargs={
"object_name": "pillow_small",
"observable_object_pos": True,
},
)
9 changes: 4 additions & 5 deletions examples/floating_mia_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
from deformable_gym.envs.floating_mia_grasp_env import FloatingMiaGraspEnv

"""
=========
================================================================
Floating Mia Example
=========
This is an example of how to use the FloatingMiaGraspEnv. A random policy is
then used to generate ten episodes.
================================================================
This is an example of how to use the FloatingMiaGraspInsole environment. A
random policy is then used to generate ten episodes.
"""

env = gymnasium.make("FloatingMiaGraspInsole-v0", render_mode="human")
Expand Down
9 changes: 4 additions & 5 deletions examples/floating_shadow_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
from deformable_gym.envs.floating_shadow_grasp_env import FloatingShadowGraspEnv

"""
=========
================================================================
Floating Shadow Example
=========
This is an example of how to use the FloatingShadowGraspEnv. A random policy is then
used to generate ten episodes.
================================================================
This is an example of how to use the FloatingShadowGraspInsole environment. A
random policy is then used to generate ten episodes.
"""

env = gymnasium.make("FloatingShadowGraspInsole-v0", render_mode="human")
Expand Down
10 changes: 0 additions & 10 deletions examples/uniform_initialisation_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@
from deformable_gym.envs.floating_mia_grasp_env import FloatingMiaGraspEnv
from deformable_gym.envs.sampler import UniformSampler

"""
=========
Floating Mia Example
=========
This is an example of how to use the FloatingMiaGraspEnv. A random policy is
then used to generate ten episodes.
"""

base_initial_pose = FloatingMiaGraspEnv.INITIAL_POSE.copy()
low = base_initial_pose.copy()
high = base_initial_pose.copy()
Expand Down
15 changes: 9 additions & 6 deletions examples/ur10_shadow_grasp_example.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import gymnasium as gym

from deformable_gym.envs.ur10_shadow_grasp_env import UR10ShadowGraspEnv

"""
=========
Floating Mia Example
=========
================================================================
UR10 Shadow Example
================================================================
This is an example of how to use the FloatingMiaGraspEnv. A random policy is then
used to generate ten episodes.
This is an example of how to use the URShadowGraspPillow environment. A random
policy is then used to generate ten episodes.
"""

env = UR10ShadowGraspEnv(object_name="insole")
env = gym.make("URShadowGraspPillow-v0")


env.reset()
episode_return = 0
Expand Down
15 changes: 9 additions & 6 deletions examples/ur5_mia_grasp_example.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import gymnasium as gym

from deformable_gym.envs.ur5_mia_grasp_env import UR5MiaGraspEnv

"""
=========
Floating Mia Example
=========
================================================================
UR5 Mia Example
================================================================
This is an example of how to use the FloatingMiaGraspEnv. A random policy is then
used to generate ten episodes.
This is an example of how to use the URMiaGraspInsole environment. A random
policy is then used to generate ten episodes.
"""

env = UR5MiaGraspEnv(object_name="insole2")
env = gym.make("URMiaGraspPillow-v0")


env.reset()
episode_return = 0
Expand Down

0 comments on commit d87402e

Please sign in to comment.