From 8d1c1b44bf3cfac82fdee6f1b94e30f80d41a9d4 Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 13 Jul 2022 15:10:43 +0200 Subject: [PATCH] renaming to fancy_gym --- README.md | 49 +++--- .../deprecated_needs_gym_robotics/__init__.py | 0 {alr_envs => fancy_gym}/__init__.py | 11 +- .../black_box/__init__.py | 0 .../black_box/black_box_wrapper.py | 35 +--- .../black_box/controller}/__init__.py | 0 .../black_box/controller/base_controller.py | 0 .../controller/meta_world_controller.py | 2 +- .../black_box/controller/pd_controller.py | 2 +- .../black_box/controller/pos_controller.py | 2 +- .../black_box/controller/vel_controller.py | 2 +- .../black_box/factory}/__init__.py | 0 .../factory/basis_generator_factory.py | 0 .../black_box/factory/controller_factory.py | 8 +- .../factory/phase_generator_factory.py | 0 .../factory/trajectory_generator_factory.py | 7 +- .../black_box/raw_interface_wrapper.py | 6 +- {alr_envs => fancy_gym}/dmc/README.MD | 0 {alr_envs => fancy_gym}/dmc/__init__.py | 28 +-- {alr_envs => fancy_gym}/dmc/dmc_wrapper.py | 2 +- .../dmc/manipulation/__init__.py | 0 .../dmc/manipulation/reach_site/__init__.py | 0 .../dmc/manipulation/reach_site/mp_wrapper.py | 2 +- {alr_envs => fancy_gym}/dmc/suite/__init__.py | 0 .../dmc/suite/ball_in_cup/__init__.py | 0 .../dmc/suite/ball_in_cup/mp_wrapper.py | 2 +- .../dmc/suite/cartpole/__init__.py | 2 +- .../dmc/suite/cartpole/mp_wrapper.py | 2 +- .../dmc/suite/reacher/__init__.py | 0 .../dmc/suite/reacher/mp_wrapper.py | 2 +- {alr_envs => fancy_gym}/envs/__init__.py | 165 +++++++++--------- .../envs/classic_control/README.MD | 0 .../envs/classic_control/__init__.py | 0 .../classic_control/base_reacher}/__init__.py | 0 .../base_reacher/base_reacher.py | 2 +- .../base_reacher/base_reacher_direct.py | 6 +- .../base_reacher/base_reacher_torque.py | 6 +- .../classic_control/hole_reacher/__init__.py | 0 .../hole_reacher/hole_reacher.py | 11 +- .../hole_reacher/hr_dist_vel_acc_reward.py | 0 .../hole_reacher/hr_simple_reward.py | 0 .../hole_reacher/hr_unbounded_reward.py | 0 .../hole_reacher/mp_wrapper.py | 2 +- .../simple_reacher/__init__.py | 0 .../simple_reacher/mp_wrapper.py | 2 +- .../simple_reacher/simple_reacher.py | 2 +- .../envs/classic_control/utils.py | 3 - .../viapoint_reacher/__init__.py | 0 .../viapoint_reacher/mp_wrapper.py | 2 +- .../viapoint_reacher/viapoint_reacher.py | 4 +- {alr_envs => fancy_gym}/envs/mujoco/README.MD | 0 .../envs/mujoco/__init__.py | 4 +- .../envs/mujoco/ant_jump/__init__.py | 0 .../envs/mujoco/ant_jump/ant_jump.py | 2 +- .../envs/mujoco/ant_jump/assets/ant.xml | 0 .../envs/mujoco/ant_jump/mp_wrapper.py | 2 +- .../envs/mujoco/beerpong/__init__.py | 0 .../envs/mujoco/beerpong/assets/beerpong.xml | 0 .../beerpong/assets/beerpong_wo_cup.xml | 0 .../assets/beerpong_wo_cup_big_table.xml | 0 .../assets/meshes/wam/base_link_convex.stl | Bin .../assets/meshes/wam/base_link_fine.stl | Bin .../wam/bhand_finger_dist_link_convex.stl | Bin .../wam/bhand_finger_dist_link_fine.stl | Bin .../wam/bhand_finger_med_link_convex.stl | Bin .../meshes/wam/bhand_finger_med_link_fine.stl | Bin ...nger_prox_link_convex_decomposition_p1.stl | Bin ...nger_prox_link_convex_decomposition_p2.stl | Bin ...nger_prox_link_convex_decomposition_p3.stl | Bin .../wam/bhand_finger_prox_link_fine.stl | Bin .../assets/meshes/wam/bhand_palm_fine.stl | Bin ...hand_palm_link_convex_decomposition_p1.stl | Bin ...hand_palm_link_convex_decomposition_p2.stl | Bin ...hand_palm_link_convex_decomposition_p3.stl | Bin ...hand_palm_link_convex_decomposition_p4.stl | Bin .../mujoco/beerpong/assets/meshes/wam/cup.stl | Bin .../beerpong/assets/meshes/wam/cup_split1.stl | Bin .../assets/meshes/wam/cup_split10.stl | Bin .../assets/meshes/wam/cup_split11.stl | Bin .../assets/meshes/wam/cup_split12.stl | Bin .../assets/meshes/wam/cup_split13.stl | Bin .../assets/meshes/wam/cup_split14.stl | Bin .../assets/meshes/wam/cup_split15.stl | Bin .../assets/meshes/wam/cup_split16.stl | Bin .../assets/meshes/wam/cup_split17.stl | Bin .../assets/meshes/wam/cup_split18.stl | Bin .../beerpong/assets/meshes/wam/cup_split2.stl | Bin .../beerpong/assets/meshes/wam/cup_split3.stl | Bin .../beerpong/assets/meshes/wam/cup_split4.stl | Bin .../beerpong/assets/meshes/wam/cup_split5.stl | Bin .../beerpong/assets/meshes/wam/cup_split6.stl | Bin .../beerpong/assets/meshes/wam/cup_split7.stl | Bin .../beerpong/assets/meshes/wam/cup_split8.stl | Bin .../beerpong/assets/meshes/wam/cup_split9.stl | Bin .../assets/meshes/wam/elbow_link_convex.stl | Bin .../assets/meshes/wam/elbow_link_fine.stl | Bin .../forearm_link_convex_decomposition_p1.stl | Bin .../forearm_link_convex_decomposition_p2.stl | Bin .../assets/meshes/wam/forearm_link_fine.stl | Bin .../shoulder_link_convex_decomposition_p1.stl | Bin .../shoulder_link_convex_decomposition_p2.stl | Bin .../shoulder_link_convex_decomposition_p3.stl | Bin .../assets/meshes/wam/shoulder_link_fine.stl | Bin .../meshes/wam/shoulder_pitch_link_convex.stl | Bin .../meshes/wam/shoulder_pitch_link_fine.stl | Bin ...upper_arm_link_convex_decomposition_p1.stl | Bin ...upper_arm_link_convex_decomposition_p2.stl | Bin .../assets/meshes/wam/upper_arm_link_fine.stl | Bin .../meshes/wam/wrist_palm_link_convex.stl | Bin .../meshes/wam/wrist_palm_link_fine.stl | Bin ...ist_pitch_link_convex_decomposition_p1.stl | Bin ...ist_pitch_link_convex_decomposition_p2.stl | Bin ...ist_pitch_link_convex_decomposition_p3.stl | Bin .../meshes/wam/wrist_pitch_link_fine.stl | Bin ...wrist_yaw_link_convex_decomposition_p1.stl | Bin ...wrist_yaw_link_convex_decomposition_p2.stl | Bin .../assets/meshes/wam/wrist_yaw_link_fine.stl | Bin .../envs/mujoco/beerpong/beerpong.py | 27 ++- .../mujoco/beerpong/deprecated}/__init__.py | 0 .../mujoco/beerpong/deprecated/beerpong.py | 14 +- .../deprecated/beerpong_reward_staged.py | 0 .../envs/mujoco/beerpong/mp_wrapper.py | 2 +- .../envs/mujoco/half_cheetah_jump/__init__.py | 0 .../half_cheetah_jump/assets/cheetah.xml | 0 .../half_cheetah_jump/half_cheetah_jump.py | 4 +- .../mujoco/half_cheetah_jump/mp_wrapper.py | 2 +- .../envs/mujoco/hopper_jump/__init__.py | 0 .../mujoco/hopper_jump/assets/hopper_jump.xml | 0 .../hopper_jump/assets/hopper_jump_on_box.xml | 0 .../envs/mujoco/hopper_jump/hopper_jump.py | 11 +- .../mujoco/hopper_jump/hopper_jump_on_box.py | 4 +- .../envs/mujoco/hopper_jump/mp_wrapper.py | 2 +- .../envs/mujoco/hopper_throw/__init__.py | 0 .../hopper_throw/assets/hopper_throw.xml | 0 .../assets/hopper_throw_in_basket.xml | 0 .../envs/mujoco/hopper_throw/hopper_throw.py | 2 +- .../hopper_throw/hopper_throw_in_basket.py | 3 +- .../envs/mujoco/hopper_throw/mp_wrapper.py | 2 +- .../envs/mujoco/reacher/__init__.py | 0 .../mujoco/reacher/assets/reacher_5links.xml | 0 .../mujoco/reacher/assets/reacher_7links.xml | 0 .../envs/mujoco/reacher/mp_wrapper.py | 3 +- .../envs/mujoco/reacher/reacher.py | 16 +- .../envs/mujoco/walker_2d_jump/__init__.py | 0 .../mujoco/walker_2d_jump/assets/walker2d.xml | 0 .../envs/mujoco/walker_2d_jump/mp_wrapper.py | 2 +- .../mujoco/walker_2d_jump/walker_2d_jump.py | 2 +- .../examples}/__init__.py | 0 .../examples/examples_dmc.py | 20 +-- .../examples/examples_general.py | 6 +- .../examples/examples_metaworld.py | 20 +-- .../examples/examples_movement_primitives.py | 26 +-- .../examples/examples_open_ai.py | 8 +- .../examples/pd_control_gain_tuning.py | 5 +- {alr_envs => fancy_gym}/meta/README.MD | 0 {alr_envs => fancy_gym}/meta/__init__.py | 8 +- .../meta/base_metaworld_mp_wrapper.py | 2 +- .../meta/goal_change_mp_wrapper.py | 6 +- .../goal_endeffector_change_mp_wrapper.py | 6 +- .../meta/goal_object_change_mp_wrapper.py | 6 +- .../meta/object_change_mp_wrapper.py | 6 +- {alr_envs => fancy_gym}/open_ai/README.MD | 0 {alr_envs => fancy_gym}/open_ai/__init__.py | 25 +-- .../__init__.py | 0 .../robotics/__init__.py | 0 .../robotics/fetch/__init__.py | 0 .../robotics/fetch/mp_wrapper.py | 2 +- .../open_ai/mujoco/__init__.py | 0 .../open_ai/mujoco/reacher_v2/__init__.py | 0 .../open_ai/mujoco/reacher_v2/mp_wrapper.py | 2 +- {alr_envs => fancy_gym}/utils/__init__.py | 0 .../utils/make_env_helpers.py | 22 +-- .../utils/time_aware_observation.py | 3 +- {alr_envs => fancy_gym}/utils/utils.py | 0 setup.py | 8 +- test/test_custom.py | 10 +- test/test_dmc.py | 9 +- test/test_gym.py | 10 +- test/test_metaworld.py | 10 +- 179 files changed, 332 insertions(+), 361 deletions(-) delete mode 100644 alr_envs/open_ai/deprecated_needs_gym_robotics/__init__.py rename {alr_envs => fancy_gym}/__init__.py (66%) rename __init__.py => fancy_gym/black_box/__init__.py (100%) rename {alr_envs => fancy_gym}/black_box/black_box_wrapper.py (86%) rename {alr_envs/black_box => fancy_gym/black_box/controller}/__init__.py (100%) rename {alr_envs => fancy_gym}/black_box/controller/base_controller.py (100%) rename {alr_envs => fancy_gym}/black_box/controller/meta_world_controller.py (92%) rename {alr_envs => fancy_gym}/black_box/controller/pd_controller.py (93%) rename {alr_envs => fancy_gym}/black_box/controller/pos_controller.py (76%) rename {alr_envs => fancy_gym}/black_box/controller/vel_controller.py (76%) rename {alr_envs/black_box/controller => fancy_gym/black_box/factory}/__init__.py (100%) rename {alr_envs => fancy_gym}/black_box/factory/basis_generator_factory.py (100%) rename {alr_envs => fancy_gym}/black_box/factory/controller_factory.py (67%) rename {alr_envs => fancy_gym}/black_box/factory/phase_generator_factory.py (100%) rename {alr_envs => fancy_gym}/black_box/factory/trajectory_generator_factory.py (99%) rename {alr_envs => fancy_gym}/black_box/raw_interface_wrapper.py (95%) rename {alr_envs => fancy_gym}/dmc/README.MD (100%) rename {alr_envs => fancy_gym}/dmc/__init__.py (90%) rename {alr_envs => fancy_gym}/dmc/dmc_wrapper.py (100%) rename {alr_envs => fancy_gym}/dmc/manipulation/__init__.py (100%) rename {alr_envs => fancy_gym}/dmc/manipulation/reach_site/__init__.py (100%) rename {alr_envs => fancy_gym}/dmc/manipulation/reach_site/mp_wrapper.py (94%) rename {alr_envs => fancy_gym}/dmc/suite/__init__.py (100%) rename {alr_envs => fancy_gym}/dmc/suite/ball_in_cup/__init__.py (100%) rename {alr_envs => fancy_gym}/dmc/suite/ball_in_cup/mp_wrapper.py (93%) rename {alr_envs => fancy_gym}/dmc/suite/cartpole/__init__.py (100%) rename {alr_envs => fancy_gym}/dmc/suite/cartpole/mp_wrapper.py (94%) rename {alr_envs => fancy_gym}/dmc/suite/reacher/__init__.py (100%) rename {alr_envs => fancy_gym}/dmc/suite/reacher/mp_wrapper.py (92%) rename {alr_envs => fancy_gym}/envs/__init__.py (79%) rename {alr_envs => fancy_gym}/envs/classic_control/README.MD (100%) rename {alr_envs => fancy_gym}/envs/classic_control/__init__.py (100%) rename {alr_envs/black_box/factory => fancy_gym/envs/classic_control/base_reacher}/__init__.py (100%) rename {alr_envs => fancy_gym}/envs/classic_control/base_reacher/base_reacher.py (98%) rename {alr_envs => fancy_gym}/envs/classic_control/base_reacher/base_reacher_direct.py (92%) rename {alr_envs => fancy_gym}/envs/classic_control/base_reacher/base_reacher_torque.py (92%) rename {alr_envs => fancy_gym}/envs/classic_control/hole_reacher/__init__.py (100%) rename {alr_envs => fancy_gym}/envs/classic_control/hole_reacher/hole_reacher.py (95%) rename {alr_envs => fancy_gym}/envs/classic_control/hole_reacher/hr_dist_vel_acc_reward.py (100%) rename {alr_envs => fancy_gym}/envs/classic_control/hole_reacher/hr_simple_reward.py (100%) rename {alr_envs => fancy_gym}/envs/classic_control/hole_reacher/hr_unbounded_reward.py (100%) rename {alr_envs => fancy_gym}/envs/classic_control/hole_reacher/mp_wrapper.py (91%) rename {alr_envs => fancy_gym}/envs/classic_control/simple_reacher/__init__.py (100%) rename {alr_envs => fancy_gym}/envs/classic_control/simple_reacher/mp_wrapper.py (90%) rename {alr_envs => fancy_gym}/envs/classic_control/simple_reacher/simple_reacher.py (97%) rename {alr_envs => fancy_gym}/envs/classic_control/utils.py (96%) rename {alr_envs => fancy_gym}/envs/classic_control/viapoint_reacher/__init__.py (100%) rename {alr_envs => fancy_gym}/envs/classic_control/viapoint_reacher/mp_wrapper.py (91%) rename {alr_envs => fancy_gym}/envs/classic_control/viapoint_reacher/viapoint_reacher.py (98%) rename {alr_envs => fancy_gym}/envs/mujoco/README.MD (100%) rename {alr_envs => fancy_gym}/envs/mujoco/__init__.py (100%) rename {alr_envs => fancy_gym}/envs/mujoco/ant_jump/__init__.py (100%) rename {alr_envs => fancy_gym}/envs/mujoco/ant_jump/ant_jump.py (99%) rename {alr_envs => fancy_gym}/envs/mujoco/ant_jump/assets/ant.xml (100%) rename {alr_envs => fancy_gym}/envs/mujoco/ant_jump/mp_wrapper.py (87%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/__init__.py (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/beerpong.xml (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/beerpong_wo_cup.xml (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/beerpong_wo_cup_big_table.xml (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/base_link_convex.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/base_link_fine.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_dist_link_convex.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_dist_link_fine.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_med_link_convex.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_med_link_fine.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p1.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p2.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p3.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_fine.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_fine.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p1.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p2.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p3.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p4.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split1.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split10.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split11.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split12.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split13.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split14.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split15.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split16.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split17.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split18.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split2.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split3.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split4.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split5.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split6.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split7.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split8.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/cup_split9.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/elbow_link_convex.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/elbow_link_fine.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_convex_decomposition_p1.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_convex_decomposition_p2.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_fine.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p1.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p2.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p3.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_fine.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/shoulder_pitch_link_convex.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/shoulder_pitch_link_fine.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_convex_decomposition_p1.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_convex_decomposition_p2.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_fine.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/wrist_palm_link_convex.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/wrist_palm_link_fine.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p1.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p2.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p3.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_fine.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_convex_decomposition_p1.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_convex_decomposition_p2.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_fine.stl (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/beerpong.py (94%) rename {alr_envs/envs/classic_control/base_reacher => fancy_gym/envs/mujoco/beerpong/deprecated}/__init__.py (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/deprecated/beerpong.py (94%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/deprecated/beerpong_reward_staged.py (100%) rename {alr_envs => fancy_gym}/envs/mujoco/beerpong/mp_wrapper.py (94%) rename {alr_envs => fancy_gym}/envs/mujoco/half_cheetah_jump/__init__.py (100%) rename {alr_envs => fancy_gym}/envs/mujoco/half_cheetah_jump/assets/cheetah.xml (100%) rename {alr_envs => fancy_gym}/envs/mujoco/half_cheetah_jump/half_cheetah_jump.py (98%) rename {alr_envs => fancy_gym}/envs/mujoco/half_cheetah_jump/mp_wrapper.py (86%) rename {alr_envs => fancy_gym}/envs/mujoco/hopper_jump/__init__.py (100%) rename {alr_envs => fancy_gym}/envs/mujoco/hopper_jump/assets/hopper_jump.xml (100%) rename {alr_envs => fancy_gym}/envs/mujoco/hopper_jump/assets/hopper_jump_on_box.xml (100%) rename {alr_envs => fancy_gym}/envs/mujoco/hopper_jump/hopper_jump.py (98%) rename {alr_envs => fancy_gym}/envs/mujoco/hopper_jump/hopper_jump_on_box.py (99%) rename {alr_envs => fancy_gym}/envs/mujoco/hopper_jump/mp_wrapper.py (90%) rename {alr_envs => fancy_gym}/envs/mujoco/hopper_throw/__init__.py (100%) rename {alr_envs => fancy_gym}/envs/mujoco/hopper_throw/assets/hopper_throw.xml (100%) rename {alr_envs => fancy_gym}/envs/mujoco/hopper_throw/assets/hopper_throw_in_basket.xml (100%) rename {alr_envs => fancy_gym}/envs/mujoco/hopper_throw/hopper_throw.py (100%) rename {alr_envs => fancy_gym}/envs/mujoco/hopper_throw/hopper_throw_in_basket.py (99%) rename {alr_envs => fancy_gym}/envs/mujoco/hopper_throw/mp_wrapper.py (86%) rename {alr_envs => fancy_gym}/envs/mujoco/reacher/__init__.py (100%) rename {alr_envs => fancy_gym}/envs/mujoco/reacher/assets/reacher_5links.xml (100%) rename {alr_envs => fancy_gym}/envs/mujoco/reacher/assets/reacher_7links.xml (100%) rename {alr_envs => fancy_gym}/envs/mujoco/reacher/mp_wrapper.py (90%) rename {alr_envs => fancy_gym}/envs/mujoco/reacher/reacher.py (88%) rename {alr_envs => fancy_gym}/envs/mujoco/walker_2d_jump/__init__.py (100%) rename {alr_envs => fancy_gym}/envs/mujoco/walker_2d_jump/assets/walker2d.xml (100%) rename {alr_envs => fancy_gym}/envs/mujoco/walker_2d_jump/mp_wrapper.py (86%) rename {alr_envs => fancy_gym}/envs/mujoco/walker_2d_jump/walker_2d_jump.py (100%) rename {alr_envs/envs/mujoco/beerpong/deprecated => fancy_gym/examples}/__init__.py (100%) rename {alr_envs => fancy_gym}/examples/examples_dmc.py (87%) rename {alr_envs => fancy_gym}/examples/examples_general.py (95%) rename {alr_envs => fancy_gym}/examples/examples_metaworld.py (88%) rename {alr_envs => fancy_gym}/examples/examples_movement_primitives.py (86%) rename {alr_envs => fancy_gym}/examples/examples_open_ai.py (74%) rename {alr_envs => fancy_gym}/examples/pd_control_gain_tuning.py (94%) rename {alr_envs => fancy_gym}/meta/README.MD (100%) rename {alr_envs => fancy_gym}/meta/__init__.py (93%) rename {alr_envs => fancy_gym}/meta/base_metaworld_mp_wrapper.py (90%) rename {alr_envs => fancy_gym}/meta/goal_change_mp_wrapper.py (94%) rename {alr_envs => fancy_gym}/meta/goal_endeffector_change_mp_wrapper.py (94%) rename {alr_envs => fancy_gym}/meta/goal_object_change_mp_wrapper.py (94%) rename {alr_envs => fancy_gym}/meta/object_change_mp_wrapper.py (94%) rename {alr_envs => fancy_gym}/open_ai/README.MD (100%) rename {alr_envs => fancy_gym}/open_ai/__init__.py (77%) rename {alr_envs/examples => fancy_gym/open_ai/deprecated_needs_gym_robotics}/__init__.py (100%) rename {alr_envs => fancy_gym}/open_ai/deprecated_needs_gym_robotics/robotics/__init__.py (100%) rename {alr_envs => fancy_gym}/open_ai/deprecated_needs_gym_robotics/robotics/fetch/__init__.py (100%) rename {alr_envs => fancy_gym}/open_ai/deprecated_needs_gym_robotics/robotics/fetch/mp_wrapper.py (96%) rename {alr_envs => fancy_gym}/open_ai/mujoco/__init__.py (100%) rename {alr_envs => fancy_gym}/open_ai/mujoco/reacher_v2/__init__.py (100%) rename {alr_envs => fancy_gym}/open_ai/mujoco/reacher_v2/mp_wrapper.py (89%) rename {alr_envs => fancy_gym}/utils/__init__.py (100%) rename {alr_envs => fancy_gym}/utils/make_env_helpers.py (94%) rename {alr_envs => fancy_gym}/utils/time_aware_observation.py (99%) rename {alr_envs => fancy_gym}/utils/utils.py (100%) diff --git a/README.md b/README.md index 5d267a3..85249fb 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ -## ALR Robotics Control Environments +## Fancy Gym -This project offers a large variety of reinforcement learning environments under the unifying interface of [OpenAI gym](https://gym.openai.com/). -We provide support (under the OpenAI interface) for the benchmark suites +Fancy gym offers a large variety of reinforcement learning environments under the unifying interface +of [OpenAI gym](https://gym.openai.com/). We provide support (under the OpenAI interface) for the benchmark suites [DeepMind Control](https://deepmind.com/research/publications/2020/dm-control-Software-and-Tasks-for-Continuous-Control) -(DMC) and [Metaworld](https://meta-world.github.io/). -Custom (Mujoco) gym environments can be created according -to [this guide](https://www.gymlibrary.ml/content/environment_creation/). -Unlike existing libraries, we additionally support to control agents with movement primitives, such as -Dynamic Movement Primitives (DMPs) and Probabilistic Movement Primitives (ProMP, we only consider the mean usually). +(DMC) and [Metaworld](https://meta-world.github.io/). Custom (Mujoco) gym environments can be created according +to [this guide](https://www.gymlibrary.ml/content/environment_creation/). Unlike existing libraries, we additionally +support to control agents with movement primitives, such as Dynamic Movement Primitives (DMPs) and Probabilistic +Movement Primitives (ProMP, we only consider the mean usually). ## Movement Primitive Environments (Episode-Based/Black-Box Environments) @@ -59,14 +58,14 @@ pip install -e . ## Using the framework -We prepared [multiple examples](alr_envs/examples/), please have a look there for more specific examples. +We prepared [multiple examples](fancy_gym/examples/), please have a look there for more specific examples. ### Step-wise environments ```python -import alr_envs +import fancy_gym -env = alr_envs.make('HoleReacher-v0', seed=1) +env = fancy_gym.make('HoleReacher-v0', seed=1) state = env.reset() for i in range(1000): @@ -85,9 +84,9 @@ Existing MP tasks can be created the same way as above. Just keep in mind, calli trajectory. ```python -import alr_envs +import fancy_gym -env = alr_envs.make('HoleReacherProMP-v0', seed=1) +env = fancy_gym.make('HoleReacherProMP-v0', seed=1) # render() can be called once in the beginning with all necessary arguments. To turn it of again just call render(None). env.render() @@ -104,19 +103,19 @@ To show all available environments, we provide some additional convenience. Each keys `DMP` and `ProMP` that store a list of available environment names. ```python -import alr_envs +import fancy_gym print("Custom MP tasks:") -print(alr_envs.ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS) +print(fancy_gym.ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS) print("OpenAI Gym MP tasks:") -print(alr_envs.ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS) +print(fancy_gym.ALL_GYM_MOVEMENT_PRIMITIVE_ENVIRONMENTS) print("Deepmind Control MP tasks:") -print(alr_envs.ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS) +print(fancy_gym.ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS) print("MetaWorld MP tasks:") -print(alr_envs.ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS) +print(fancy_gym.ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS) ``` ### How to create a new MP task @@ -181,12 +180,12 @@ class MPWrapper(MPEnvWrapper): ``` -If you created a new task wrapper, feel free to open a PR, so we can integrate it for others to use as well. -Without the integration the task can still be used. A rough outline can be shown here, for more details we recommend -having a look at the [examples](alr_envs/examples/). +If you created a new task wrapper, feel free to open a PR, so we can integrate it for others to use as well. Without the +integration the task can still be used. A rough outline can be shown here, for more details we recommend having a look +at the [examples](fancy_gym/examples/). ```python -import alr_envs +import fancy_gym # Base environment name, according to structure of above example base_env_id = "ball_in_cup-catch" @@ -194,12 +193,12 @@ base_env_id = "ball_in_cup-catch" # Replace this wrapper with the custom wrapper for your environment by inheriting from the MPEnvWrapper. # You can also add other gym.Wrappers in case they are needed, # e.g. gym.wrappers.FlattenObservation for dict observations -wrappers = [alr_envs.dmc.suite.ball_in_cup.MPWrapper] +wrappers = [fancy_gym.dmc.suite.ball_in_cup.MPWrapper] mp_kwargs = {...} kwargs = {...} -env = alr_envs.make_dmp_env(base_env_id, wrappers=wrappers, seed=1, mp_kwargs=mp_kwargs, **kwargs) +env = fancy_gym.make_dmp_env(base_env_id, wrappers=wrappers, seed=1, mp_kwargs=mp_kwargs, **kwargs) # OR for a deterministic ProMP (other traj_gen_kwargs are required): -# env = alr_envs.make_promp_env(base_env, wrappers=wrappers, seed=seed, traj_gen_kwargs=mp_args) +# env = fancy_gym.make_promp_env(base_env, wrappers=wrappers, seed=seed, traj_gen_kwargs=mp_args) rewards = 0 obs = env.reset() diff --git a/alr_envs/open_ai/deprecated_needs_gym_robotics/__init__.py b/alr_envs/open_ai/deprecated_needs_gym_robotics/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/alr_envs/__init__.py b/fancy_gym/__init__.py similarity index 66% rename from alr_envs/__init__.py rename to fancy_gym/__init__.py index d63a656..457e3b1 100644 --- a/alr_envs/__init__.py +++ b/fancy_gym/__init__.py @@ -1,14 +1,13 @@ -from alr_envs import dmc, meta, open_ai -from alr_envs.utils.make_env_helpers import make, make_bb, make_rank - +from fancy_gym import dmc, meta, open_ai +from fancy_gym.utils.make_env_helpers import make, make_bb, make_rank +from .dmc import ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS # Convenience function for all MP environments from .envs import ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS -from .dmc import ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS from .meta import ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS -from .open_ai import ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS +from .open_ai import ALL_GYM_MOVEMENT_PRIMITIVE_ENVIRONMENTS ALL_MOVEMENT_PRIMITIVE_ENVIRONMENTS = { key: value + ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS[key] + - ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS[key] + + ALL_GYM_MOVEMENT_PRIMITIVE_ENVIRONMENTS[key] + ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS[key] for key, value in ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items()} diff --git a/__init__.py b/fancy_gym/black_box/__init__.py similarity index 100% rename from __init__.py rename to fancy_gym/black_box/__init__.py diff --git a/alr_envs/black_box/black_box_wrapper.py b/fancy_gym/black_box/black_box_wrapper.py similarity index 86% rename from alr_envs/black_box/black_box_wrapper.py rename to fancy_gym/black_box/black_box_wrapper.py index 6050740..6358778 100644 --- a/alr_envs/black_box/black_box_wrapper.py +++ b/fancy_gym/black_box/black_box_wrapper.py @@ -1,4 +1,5 @@ import os + os.environ["MUJOCO_GL"] = "egl" from typing import Tuple, Optional @@ -8,9 +9,9 @@ import numpy as np from gym import spaces from mp_pytorch.mp.mp_interfaces import MPInterface -from alr_envs.black_box.controller.base_controller import BaseController -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper -from alr_envs.utils.utils import get_numpy +from fancy_gym.black_box.controller.base_controller import BaseController +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.utils.utils import get_numpy class BlackBoxWrapper(gym.ObservationWrapper): @@ -77,12 +78,10 @@ class BlackBoxWrapper(gym.ObservationWrapper): def get_trajectory(self, action: np.ndarray) -> Tuple: clipped_params = np.clip(action, self.traj_gen_action_space.low, self.traj_gen_action_space.high) self.traj_gen.set_params(clipped_params) - # TODO: Bruce said DMP, ProMP, ProDMP can have 0 bc_time for sequencing - # TODO Check with Bruce for replanning + # TODO: is this correct for replanning? Do we need to adjust anything here? self.traj_gen.set_boundary_conditions( bc_time=np.array(0) if not self.do_replanning else np.array([self.current_traj_steps * self.dt]), bc_pos=self.current_pos, bc_vel=self.current_vel) - # TODO: is this correct for replanning? Do we need to adjust anything here? self.traj_gen.set_duration(None if self.learn_sub_trajectories else np.array([self.duration]), np.array([self.dt])) traj_dict = self.traj_gen.get_trajs(get_pos=True, get_vel=True) @@ -99,9 +98,9 @@ class BlackBoxWrapper(gym.ObservationWrapper): def _get_action_space(self): """ - This function can be used to modify the action space for considering actions which are not learned via motion + This function can be used to modify the action space for considering actions which are not learned via movement primitives. E.g. ball releasing time for the beer pong task. By default, it is the parameter space of the - motion primitive. + movement primitive. Only needs to be overwritten if the action space needs to be modified. """ try: @@ -138,7 +137,6 @@ class BlackBoxWrapper(gym.ObservationWrapper): for t, (pos, vel) in enumerate(zip(trajectory, velocity)): step_action = self.tracking_controller.get_action(pos, vel, self.current_pos, self.current_vel) c_action = np.clip(step_action, self.env.action_space.low, self.env.action_space.high) - # print('step/clipped action ratio: ', step_action/c_action) obs, c_reward, done, info = self.env.step(c_action) rewards[t] = c_reward @@ -176,26 +174,7 @@ class BlackBoxWrapper(gym.ObservationWrapper): """Only set render options here, such that they can be used during the rollout. This only needs to be called once""" self.render_kwargs = kwargs - # self.env.render(mode=self.render_mode, **self.render_kwargs) - # self.env.render(**self.render_kwargs) def reset(self, *, seed: Optional[int] = None, return_info: bool = False, options: Optional[dict] = None): self.current_traj_steps = 0 return super(BlackBoxWrapper, self).reset() - - def plot_trajs(self, des_trajs, des_vels): - import matplotlib.pyplot as plt - import matplotlib - matplotlib.use('TkAgg') - pos_fig = plt.figure('positions') - vel_fig = plt.figure('velocities') - for i in range(des_trajs.shape[1]): - plt.figure(pos_fig.number) - plt.subplot(des_trajs.shape[1], 1, i + 1) - plt.plot(np.ones(des_trajs.shape[0]) * self.current_pos[i]) - plt.plot(des_trajs[:, i]) - - plt.figure(vel_fig.number) - plt.subplot(des_vels.shape[1], 1, i + 1) - plt.plot(np.ones(des_trajs.shape[0]) * self.current_vel[i]) - plt.plot(des_vels[:, i]) diff --git a/alr_envs/black_box/__init__.py b/fancy_gym/black_box/controller/__init__.py similarity index 100% rename from alr_envs/black_box/__init__.py rename to fancy_gym/black_box/controller/__init__.py diff --git a/alr_envs/black_box/controller/base_controller.py b/fancy_gym/black_box/controller/base_controller.py similarity index 100% rename from alr_envs/black_box/controller/base_controller.py rename to fancy_gym/black_box/controller/base_controller.py diff --git a/alr_envs/black_box/controller/meta_world_controller.py b/fancy_gym/black_box/controller/meta_world_controller.py similarity index 92% rename from alr_envs/black_box/controller/meta_world_controller.py rename to fancy_gym/black_box/controller/meta_world_controller.py index 3781f15..efd8983 100644 --- a/alr_envs/black_box/controller/meta_world_controller.py +++ b/fancy_gym/black_box/controller/meta_world_controller.py @@ -1,6 +1,6 @@ import numpy as np -from alr_envs.black_box.controller.base_controller import BaseController +from fancy_gym.black_box.controller.base_controller import BaseController class MetaWorldController(BaseController): diff --git a/alr_envs/black_box/controller/pd_controller.py b/fancy_gym/black_box/controller/pd_controller.py similarity index 93% rename from alr_envs/black_box/controller/pd_controller.py rename to fancy_gym/black_box/controller/pd_controller.py index ab21444..35203d8 100644 --- a/alr_envs/black_box/controller/pd_controller.py +++ b/fancy_gym/black_box/controller/pd_controller.py @@ -1,6 +1,6 @@ from typing import Union, Tuple -from alr_envs.black_box.controller.base_controller import BaseController +from fancy_gym.black_box.controller.base_controller import BaseController class PDController(BaseController): diff --git a/alr_envs/black_box/controller/pos_controller.py b/fancy_gym/black_box/controller/pos_controller.py similarity index 76% rename from alr_envs/black_box/controller/pos_controller.py rename to fancy_gym/black_box/controller/pos_controller.py index 3f3526a..517187d 100644 --- a/alr_envs/black_box/controller/pos_controller.py +++ b/fancy_gym/black_box/controller/pos_controller.py @@ -1,4 +1,4 @@ -from alr_envs.black_box.controller.base_controller import BaseController +from fancy_gym.black_box.controller.base_controller import BaseController class PosController(BaseController): diff --git a/alr_envs/black_box/controller/vel_controller.py b/fancy_gym/black_box/controller/vel_controller.py similarity index 76% rename from alr_envs/black_box/controller/vel_controller.py rename to fancy_gym/black_box/controller/vel_controller.py index 2134207..b26d9ba 100644 --- a/alr_envs/black_box/controller/vel_controller.py +++ b/fancy_gym/black_box/controller/vel_controller.py @@ -1,4 +1,4 @@ -from alr_envs.black_box.controller.base_controller import BaseController +from fancy_gym.black_box.controller.base_controller import BaseController class VelController(BaseController): diff --git a/alr_envs/black_box/controller/__init__.py b/fancy_gym/black_box/factory/__init__.py similarity index 100% rename from alr_envs/black_box/controller/__init__.py rename to fancy_gym/black_box/factory/__init__.py diff --git a/alr_envs/black_box/factory/basis_generator_factory.py b/fancy_gym/black_box/factory/basis_generator_factory.py similarity index 100% rename from alr_envs/black_box/factory/basis_generator_factory.py rename to fancy_gym/black_box/factory/basis_generator_factory.py diff --git a/alr_envs/black_box/factory/controller_factory.py b/fancy_gym/black_box/factory/controller_factory.py similarity index 67% rename from alr_envs/black_box/factory/controller_factory.py rename to fancy_gym/black_box/factory/controller_factory.py index a1d068b..8b2d865 100644 --- a/alr_envs/black_box/factory/controller_factory.py +++ b/fancy_gym/black_box/factory/controller_factory.py @@ -1,7 +1,7 @@ -from alr_envs.black_box.controller.meta_world_controller import MetaWorldController -from alr_envs.black_box.controller.pd_controller import PDController -from alr_envs.black_box.controller.vel_controller import VelController -from alr_envs.black_box.controller.pos_controller import PosController +from fancy_gym.black_box.controller.meta_world_controller import MetaWorldController +from fancy_gym.black_box.controller.pd_controller import PDController +from fancy_gym.black_box.controller.pos_controller import PosController +from fancy_gym.black_box.controller.vel_controller import VelController ALL_TYPES = ["motor", "velocity", "position", "metaworld"] diff --git a/alr_envs/black_box/factory/phase_generator_factory.py b/fancy_gym/black_box/factory/phase_generator_factory.py similarity index 100% rename from alr_envs/black_box/factory/phase_generator_factory.py rename to fancy_gym/black_box/factory/phase_generator_factory.py diff --git a/alr_envs/black_box/factory/trajectory_generator_factory.py b/fancy_gym/black_box/factory/trajectory_generator_factory.py similarity index 99% rename from alr_envs/black_box/factory/trajectory_generator_factory.py rename to fancy_gym/black_box/factory/trajectory_generator_factory.py index 784513e..f7ca6e2 100644 --- a/alr_envs/black_box/factory/trajectory_generator_factory.py +++ b/fancy_gym/black_box/factory/trajectory_generator_factory.py @@ -1,8 +1,7 @@ -from mp_pytorch.mp.dmp import DMP -from mp_pytorch.mp.promp import ProMP -from mp_pytorch.mp.idmp import IDMP - from mp_pytorch.basis_gn.basis_generator import BasisGenerator +from mp_pytorch.mp.dmp import DMP +from mp_pytorch.mp.idmp import IDMP +from mp_pytorch.mp.promp import ProMP ALL_TYPES = ["promp", "dmp", "idmp"] diff --git a/alr_envs/black_box/raw_interface_wrapper.py b/fancy_gym/black_box/raw_interface_wrapper.py similarity index 95% rename from alr_envs/black_box/raw_interface_wrapper.py rename to fancy_gym/black_box/raw_interface_wrapper.py index ef93fdf..2342a3c 100644 --- a/alr_envs/black_box/raw_interface_wrapper.py +++ b/fancy_gym/black_box/raw_interface_wrapper.py @@ -1,9 +1,9 @@ -from typing import Union, Tuple -from mp_pytorch.mp.mp_interfaces import MPInterface from abc import abstractmethod +from typing import Union, Tuple import gym import numpy as np +from mp_pytorch.mp.mp_interfaces import MPInterface class RawInterfaceWrapper(gym.Wrapper): @@ -55,7 +55,7 @@ class RawInterfaceWrapper(gym.Wrapper): def episode_callback(self, action: np.ndarray, traj_gen: MPInterface) -> Tuple[ np.ndarray, Union[np.ndarray, None]]: """ - Used to extract the parameters for the motion primitive and other parameters from an action array which might + Used to extract the parameters for the movement primitive and other parameters from an action array which might include other actions like ball releasing time for the beer pong environment. This only needs to be overwritten if the action space is modified. Args: diff --git a/alr_envs/dmc/README.MD b/fancy_gym/dmc/README.MD similarity index 100% rename from alr_envs/dmc/README.MD rename to fancy_gym/dmc/README.MD diff --git a/alr_envs/dmc/__init__.py b/fancy_gym/dmc/__init__.py similarity index 90% rename from alr_envs/dmc/__init__.py rename to fancy_gym/dmc/__init__.py index c1e24eb..22ae47f 100644 --- a/alr_envs/dmc/__init__.py +++ b/fancy_gym/dmc/__init__.py @@ -56,7 +56,7 @@ kwargs_dict_bic_dmp['phase_generator_kwargs']['alpha_phase'] = 2 kwargs_dict_bic_dmp['trajectory_generator_kwargs']['weight_scale'] = 10 # TODO: weight scale 1, but goal scale 0.1 register( id=f'dmc_ball_in_cup-catch_dmp-v0', - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_bic_dmp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["DMP"].append("dmc_ball_in_cup-catch_dmp-v0") @@ -66,7 +66,7 @@ kwargs_dict_bic_promp['name'] = f"dmc:ball_in_cup-catch" kwargs_dict_bic_promp['wrappers'].append(suite.ball_in_cup.MPWrapper) register( id=f'dmc_ball_in_cup-catch_promp-v0', - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_bic_promp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append("dmc_ball_in_cup-catch_promp-v0") @@ -80,7 +80,7 @@ kwargs_dict_reacher_easy_dmp['phase_generator_kwargs']['alpha_phase'] = 2 kwargs_dict_reacher_easy_dmp['trajectory_generator_kwargs']['weight_scale'] = 500 register( id=f'dmc_reacher-easy_dmp-v0', - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_bic_dmp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["DMP"].append("dmc_reacher-easy_dmp-v0") @@ -91,7 +91,7 @@ kwargs_dict_reacher_easy_promp['wrappers'].append(suite.reacher.MPWrapper) kwargs_dict_reacher_easy_promp['trajectory_generator_kwargs']['weight_scale'] = 0.2 register( id=f'dmc_reacher-easy_promp-v0', - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_reacher_easy_promp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append("dmc_reacher-easy_promp-v0") @@ -105,7 +105,7 @@ kwargs_dict_reacher_hard_dmp['phase_generator_kwargs']['alpha_phase'] = 2 kwargs_dict_reacher_hard_dmp['trajectory_generator_kwargs']['weight_scale'] = 500 register( id=f'dmc_reacher-hard_dmp-v0', - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_reacher_hard_dmp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["DMP"].append("dmc_reacher-hard_dmp-v0") @@ -116,7 +116,7 @@ kwargs_dict_reacher_hard_promp['wrappers'].append(suite.reacher.MPWrapper) kwargs_dict_reacher_hard_promp['trajectory_generator_kwargs']['weight_scale'] = 0.2 register( id=f'dmc_reacher-hard_promp-v0', - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_reacher_hard_promp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append("dmc_reacher-hard_promp-v0") @@ -136,7 +136,7 @@ for _task in _dmc_cartpole_tasks: kwargs_dict_cartpole_dmp['controller_kwargs']['d_gains'] = 10 register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_cartpole_dmp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["DMP"].append(_env_id) @@ -150,7 +150,7 @@ for _task in _dmc_cartpole_tasks: kwargs_dict_cartpole_promp['trajectory_generator_kwargs']['weight_scale'] = 0.2 register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_cartpole_promp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -167,7 +167,7 @@ kwargs_dict_cartpole2poles_dmp['controller_kwargs']['d_gains'] = 10 _env_id = f'dmc_cartpole-two_poles_dmp-v0' register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_cartpole2poles_dmp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["DMP"].append(_env_id) @@ -181,7 +181,7 @@ kwargs_dict_cartpole2poles_promp['trajectory_generator_kwargs']['weight_scale'] _env_id = f'dmc_cartpole-two_poles_promp-v0' register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_cartpole2poles_promp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -198,7 +198,7 @@ kwargs_dict_cartpole3poles_dmp['controller_kwargs']['d_gains'] = 10 _env_id = f'dmc_cartpole-three_poles_dmp-v0' register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_cartpole3poles_dmp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["DMP"].append(_env_id) @@ -212,7 +212,7 @@ kwargs_dict_cartpole3poles_promp['trajectory_generator_kwargs']['weight_scale'] _env_id = f'dmc_cartpole-three_poles_promp-v0' register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_cartpole3poles_promp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -227,7 +227,7 @@ kwargs_dict_mani_reach_site_features_dmp['trajectory_generator_kwargs']['weight_ kwargs_dict_mani_reach_site_features_dmp['controller_kwargs']['controller_type'] = 'velocity' register( id=f'dmc_manipulation-reach_site_dmp-v0', - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_mani_reach_site_features_dmp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["DMP"].append("dmc_manipulation-reach_site_dmp-v0") @@ -239,7 +239,7 @@ kwargs_dict_mani_reach_site_features_promp['trajectory_generator_kwargs']['weigh kwargs_dict_mani_reach_site_features_promp['controller_kwargs']['controller_type'] = 'velocity' register( id=f'dmc_manipulation-reach_site_promp-v0', - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_mani_reach_site_features_promp ) ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append("dmc_manipulation-reach_site_promp-v0") diff --git a/alr_envs/dmc/dmc_wrapper.py b/fancy_gym/dmc/dmc_wrapper.py similarity index 100% rename from alr_envs/dmc/dmc_wrapper.py rename to fancy_gym/dmc/dmc_wrapper.py index 59f7793..b1522c3 100644 --- a/alr_envs/dmc/dmc_wrapper.py +++ b/fancy_gym/dmc/dmc_wrapper.py @@ -5,9 +5,9 @@ import collections from collections.abc import MutableMapping from typing import Any, Dict, Tuple, Optional, Union, Callable -from dm_control import composer import gym import numpy as np +from dm_control import composer from dm_control.rl import control from dm_env import specs from gym import spaces diff --git a/alr_envs/dmc/manipulation/__init__.py b/fancy_gym/dmc/manipulation/__init__.py similarity index 100% rename from alr_envs/dmc/manipulation/__init__.py rename to fancy_gym/dmc/manipulation/__init__.py diff --git a/alr_envs/dmc/manipulation/reach_site/__init__.py b/fancy_gym/dmc/manipulation/reach_site/__init__.py similarity index 100% rename from alr_envs/dmc/manipulation/reach_site/__init__.py rename to fancy_gym/dmc/manipulation/reach_site/__init__.py diff --git a/alr_envs/dmc/manipulation/reach_site/mp_wrapper.py b/fancy_gym/dmc/manipulation/reach_site/mp_wrapper.py similarity index 94% rename from alr_envs/dmc/manipulation/reach_site/mp_wrapper.py rename to fancy_gym/dmc/manipulation/reach_site/mp_wrapper.py index d918edc..f64ac4a 100644 --- a/alr_envs/dmc/manipulation/reach_site/mp_wrapper.py +++ b/fancy_gym/dmc/manipulation/reach_site/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Tuple, Union import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/dmc/suite/__init__.py b/fancy_gym/dmc/suite/__init__.py similarity index 100% rename from alr_envs/dmc/suite/__init__.py rename to fancy_gym/dmc/suite/__init__.py diff --git a/alr_envs/dmc/suite/ball_in_cup/__init__.py b/fancy_gym/dmc/suite/ball_in_cup/__init__.py similarity index 100% rename from alr_envs/dmc/suite/ball_in_cup/__init__.py rename to fancy_gym/dmc/suite/ball_in_cup/__init__.py diff --git a/alr_envs/dmc/suite/ball_in_cup/mp_wrapper.py b/fancy_gym/dmc/suite/ball_in_cup/mp_wrapper.py similarity index 93% rename from alr_envs/dmc/suite/ball_in_cup/mp_wrapper.py rename to fancy_gym/dmc/suite/ball_in_cup/mp_wrapper.py index b3f882e..dc6a539 100644 --- a/alr_envs/dmc/suite/ball_in_cup/mp_wrapper.py +++ b/fancy_gym/dmc/suite/ball_in_cup/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Tuple, Union import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/dmc/suite/cartpole/__init__.py b/fancy_gym/dmc/suite/cartpole/__init__.py similarity index 100% rename from alr_envs/dmc/suite/cartpole/__init__.py rename to fancy_gym/dmc/suite/cartpole/__init__.py index c5f9bee..8867457 100644 --- a/alr_envs/dmc/suite/cartpole/__init__.py +++ b/fancy_gym/dmc/suite/cartpole/__init__.py @@ -1,3 +1,3 @@ from .mp_wrapper import MPWrapper -from .mp_wrapper import TwoPolesMPWrapper from .mp_wrapper import ThreePolesMPWrapper +from .mp_wrapper import TwoPolesMPWrapper diff --git a/alr_envs/dmc/suite/cartpole/mp_wrapper.py b/fancy_gym/dmc/suite/cartpole/mp_wrapper.py similarity index 94% rename from alr_envs/dmc/suite/cartpole/mp_wrapper.py rename to fancy_gym/dmc/suite/cartpole/mp_wrapper.py index 6cc0687..7edd51f 100644 --- a/alr_envs/dmc/suite/cartpole/mp_wrapper.py +++ b/fancy_gym/dmc/suite/cartpole/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Tuple, Union import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/dmc/suite/reacher/__init__.py b/fancy_gym/dmc/suite/reacher/__init__.py similarity index 100% rename from alr_envs/dmc/suite/reacher/__init__.py rename to fancy_gym/dmc/suite/reacher/__init__.py diff --git a/alr_envs/dmc/suite/reacher/mp_wrapper.py b/fancy_gym/dmc/suite/reacher/mp_wrapper.py similarity index 92% rename from alr_envs/dmc/suite/reacher/mp_wrapper.py rename to fancy_gym/dmc/suite/reacher/mp_wrapper.py index 82e4da8..5ac52e5 100644 --- a/alr_envs/dmc/suite/reacher/mp_wrapper.py +++ b/fancy_gym/dmc/suite/reacher/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Tuple, Union import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/envs/__init__.py b/fancy_gym/envs/__init__.py similarity index 79% rename from alr_envs/envs/__init__.py rename to fancy_gym/envs/__init__.py index cb2d3ee..f75d884 100644 --- a/alr_envs/envs/__init__.py +++ b/fancy_gym/envs/__init__.py @@ -8,13 +8,13 @@ from .classic_control.hole_reacher.hole_reacher import HoleReacherEnv from .classic_control.simple_reacher.simple_reacher import SimpleReacherEnv from .classic_control.viapoint_reacher.viapoint_reacher import ViaPointReacherEnv from .mujoco.ant_jump.ant_jump import MAX_EPISODE_STEPS_ANTJUMP +from .mujoco.beerpong.beerpong import MAX_EPISODE_STEPS_BEERPONG from .mujoco.half_cheetah_jump.half_cheetah_jump import MAX_EPISODE_STEPS_HALFCHEETAHJUMP from .mujoco.hopper_jump.hopper_jump import MAX_EPISODE_STEPS_HOPPERJUMP from .mujoco.hopper_jump.hopper_jump_on_box import MAX_EPISODE_STEPS_HOPPERJUMPONBOX from .mujoco.hopper_throw.hopper_throw import MAX_EPISODE_STEPS_HOPPERTHROW from .mujoco.hopper_throw.hopper_throw_in_basket import MAX_EPISODE_STEPS_HOPPERTHROWINBASKET -from .mujoco.beerpong.beerpong import MAX_EPISODE_STEPS_BEERPONG -from .mujoco.reacher.reacher import ReacherEnv +from .mujoco.reacher.reacher import ReacherEnv, MAX_EPISODE_STEPS_REACHER from .mujoco.walker_2d_jump.walker_2d_jump import MAX_EPISODE_STEPS_WALKERJUMP ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS = {"DMP": [], "ProMP": []} @@ -64,7 +64,7 @@ DEFAULT_BB_DICT_DMP = { ## Simple Reacher register( id='SimpleReacher-v0', - entry_point='alr_envs.envs.classic_control:SimpleReacherEnv', + entry_point='fancy_gym.envs.classic_control:SimpleReacherEnv', max_episode_steps=200, kwargs={ "n_links": 2, @@ -73,7 +73,7 @@ register( register( id='LongSimpleReacher-v0', - entry_point='alr_envs.envs.classic_control:SimpleReacherEnv', + entry_point='fancy_gym.envs.classic_control:SimpleReacherEnv', max_episode_steps=200, kwargs={ "n_links": 5, @@ -84,7 +84,7 @@ register( register( id='ViaPointReacher-v0', - entry_point='alr_envs.envs.classic_control:ViaPointReacherEnv', + entry_point='fancy_gym.envs.classic_control:ViaPointReacherEnv', max_episode_steps=200, kwargs={ "n_links": 5, @@ -96,7 +96,7 @@ register( ## Hole Reacher register( id='HoleReacher-v0', - entry_point='alr_envs.envs.classic_control:HoleReacherEnv', + entry_point='fancy_gym.envs.classic_control:HoleReacherEnv', max_episode_steps=200, kwargs={ "n_links": 5, @@ -112,12 +112,12 @@ register( # Mujoco -## Reacher +## Mujoco Reacher for _dims in [5, 7]: register( id=f'Reacher{_dims}d-v0', - entry_point='alr_envs.envs.mujoco:ReacherEnv', - max_episode_steps=200, + entry_point='fancy_gym.envs.mujoco:ReacherEnv', + max_episode_steps=MAX_EPISODE_STEPS_REACHER, kwargs={ "n_links": _dims, } @@ -125,17 +125,18 @@ for _dims in [5, 7]: register( id=f'Reacher{_dims}dSparse-v0', - entry_point='alr_envs.envs.mujoco:ReacherEnv', - max_episode_steps=200, + entry_point='fancy_gym.envs.mujoco:ReacherEnv', + max_episode_steps=MAX_EPISODE_STEPS_REACHER, kwargs={ "sparse": True, + 'reward_weight': 200, "n_links": _dims, } ) register( id='HopperJumpSparse-v0', - entry_point='alr_envs.envs.mujoco:HopperJumpEnv', + entry_point='fancy_gym.envs.mujoco:HopperJumpEnv', max_episode_steps=MAX_EPISODE_STEPS_HOPPERJUMP, kwargs={ "sparse": True, @@ -144,7 +145,7 @@ register( register( id='HopperJump-v0', - entry_point='alr_envs.envs.mujoco:HopperJumpEnv', + entry_point='fancy_gym.envs.mujoco:HopperJumpEnv', max_episode_steps=MAX_EPISODE_STEPS_HOPPERJUMP, kwargs={ "sparse": False, @@ -156,43 +157,43 @@ register( register( id='AntJump-v0', - entry_point='alr_envs.envs.mujoco:AntJumpEnv', + entry_point='fancy_gym.envs.mujoco:AntJumpEnv', max_episode_steps=MAX_EPISODE_STEPS_ANTJUMP, ) register( id='HalfCheetahJump-v0', - entry_point='alr_envs.envs.mujoco:HalfCheetahJumpEnv', + entry_point='fancy_gym.envs.mujoco:HalfCheetahJumpEnv', max_episode_steps=MAX_EPISODE_STEPS_HALFCHEETAHJUMP, ) register( id='HopperJumpOnBox-v0', - entry_point='alr_envs.envs.mujoco:HopperJumpOnBoxEnv', + entry_point='fancy_gym.envs.mujoco:HopperJumpOnBoxEnv', max_episode_steps=MAX_EPISODE_STEPS_HOPPERJUMPONBOX, ) register( - id='ALRHopperThrow-v0', - entry_point='alr_envs.envs.mujoco:HopperThrowEnv', + id='HopperThrow-v0', + entry_point='fancy_gym.envs.mujoco:HopperThrowEnv', max_episode_steps=MAX_EPISODE_STEPS_HOPPERTHROW, ) register( - id='ALRHopperThrowInBasket-v0', - entry_point='alr_envs.envs.mujoco:HopperThrowInBasketEnv', + id='HopperThrowInBasket-v0', + entry_point='fancy_gym.envs.mujoco:HopperThrowInBasketEnv', max_episode_steps=MAX_EPISODE_STEPS_HOPPERTHROWINBASKET, ) register( - id='ALRWalker2DJump-v0', - entry_point='alr_envs.envs.mujoco:Walker2dJumpEnv', + id='Walker2DJump-v0', + entry_point='fancy_gym.envs.mujoco:Walker2dJumpEnv', max_episode_steps=MAX_EPISODE_STEPS_WALKERJUMP, ) register( id='BeerPong-v0', - entry_point='alr_envs.envs.mujoco:BeerPongEnv', + entry_point='fancy_gym.envs.mujoco:BeerPongEnv', max_episode_steps=MAX_EPISODE_STEPS_BEERPONG, ) @@ -200,18 +201,18 @@ register( # only one time step, i.e. we simulate until the end of th episode register( id='BeerPongStepBased-v0', - entry_point='alr_envs.envs.mujoco:BeerPongEnvStepBasedEpisodicReward', + entry_point='fancy_gym.envs.mujoco:BeerPongEnvStepBasedEpisodicReward', max_episode_steps=MAX_EPISODE_STEPS_BEERPONG, ) # Beerpong with episodic reward, but fixed release time step register( id='BeerPongFixedRelease-v0', - entry_point='alr_envs.envs.mujoco:BeerPongEnvFixedReleaseStep', + entry_point='fancy_gym.envs.mujoco:BeerPongEnvFixedReleaseStep', max_episode_steps=MAX_EPISODE_STEPS_BEERPONG, ) -# Motion Primitive Environments +# movement Primitive Environments ## Simple Reacher _versions = ["SimpleReacher-v0", "LongSimpleReacher-v0"] @@ -227,7 +228,7 @@ for _v in _versions: kwargs_dict_simple_reacher_dmp['name'] = f"{_v}" register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_simple_reacher_dmp ) ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS["DMP"].append(_env_id) @@ -240,7 +241,7 @@ for _v in _versions: kwargs_dict_simple_reacher_promp['name'] = _v register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_simple_reacher_promp ) ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -254,7 +255,7 @@ kwargs_dict_via_point_reacher_dmp['phase_generator_kwargs']['alpha_phase'] = 2 kwargs_dict_via_point_reacher_dmp['name'] = "ViaPointReacher-v0" register( id='ViaPointReacherDMP-v0', - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', # max_episode_steps=1, kwargs=kwargs_dict_via_point_reacher_dmp ) @@ -266,7 +267,7 @@ kwargs_dict_via_point_reacher_promp['controller_kwargs']['controller_type'] = 'v kwargs_dict_via_point_reacher_promp['name'] = "ViaPointReacher-v0" register( id="ViaPointReacherProMP-v0", - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_via_point_reacher_promp ) ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append("ViaPointReacherProMP-v0") @@ -285,7 +286,7 @@ for _v in _versions: kwargs_dict_hole_reacher_dmp['name'] = _v register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', # max_episode_steps=1, kwargs=kwargs_dict_hole_reacher_dmp ) @@ -299,7 +300,7 @@ for _v in _versions: kwargs_dict_hole_reacher_promp['name'] = f"{_v}" register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_hole_reacher_promp ) ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -309,30 +310,26 @@ _versions = ["Reacher5d-v0", "Reacher7d-v0", "Reacher5dSparse-v0", "Reacher7dSpa for _v in _versions: _name = _v.split("-") _env_id = f'{_name[0]}DMP-{_name[1]}' - kwargs_dict_reacherNd_dmp = deepcopy(DEFAULT_BB_DICT_DMP) - kwargs_dict_reacherNd_dmp['wrappers'].append(mujoco.reacher.MPWrapper) - kwargs_dict_reacherNd_dmp['trajectory_generator_kwargs']['weight_scale'] = 5 - kwargs_dict_reacherNd_dmp['phase_generator_kwargs']['alpha_phase'] = 2 - kwargs_dict_reacherNd_dmp['basis_generator_kwargs']['num_basis'] = 2 - kwargs_dict_reacherNd_dmp['name'] = _v + kwargs_dict_reacher_dmp = deepcopy(DEFAULT_BB_DICT_DMP) + kwargs_dict_reacher_dmp['wrappers'].append(mujoco.reacher.MPWrapper) + kwargs_dict_reacher_dmp['phase_generator_kwargs']['alpha_phase'] = 2 + kwargs_dict_reacher_dmp['name'] = _v register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', # max_episode_steps=1, - kwargs=kwargs_dict_reacherNd_dmp + kwargs=kwargs_dict_reacher_dmp ) ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS["DMP"].append(_env_id) _env_id = f'{_name[0]}ProMP-{_name[1]}' - kwargs_dict_alr_reacher_promp = deepcopy(DEFAULT_BB_DICT_ProMP) - kwargs_dict_alr_reacher_promp['wrappers'].append(mujoco.reacher.MPWrapper) - kwargs_dict_alr_reacher_promp['controller_kwargs']['p_gains'] = 1 - kwargs_dict_alr_reacher_promp['controller_kwargs']['d_gains'] = 0.1 - kwargs_dict_alr_reacher_promp['name'] = _v + kwargs_dict_reacher_promp = deepcopy(DEFAULT_BB_DICT_ProMP) + kwargs_dict_reacher_promp['wrappers'].append(mujoco.reacher.MPWrapper) + kwargs_dict_reacher_promp['name'] = _v register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', - kwargs=kwargs_dict_alr_reacher_promp + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', + kwargs=kwargs_dict_reacher_promp ) ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -352,7 +349,7 @@ for _v in _versions: kwargs_dict_bp_promp['name'] = _v register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_bp_promp ) ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -372,7 +369,7 @@ for _v in _versions: kwargs_dict_bp_promp['name'] = _v register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_bp_promp ) ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -384,7 +381,7 @@ for _v in _versions: # ######################################################################################################################## # # ## AntJump -# _versions = ['ALRAntJump-v0'] +# _versions = ['AntJump-v0'] # for _v in _versions: # _name = _v.split("-") # _env_id = f'{_name[0]}ProMP-{_name[1]}' @@ -393,7 +390,7 @@ for _v in _versions: # kwargs_dict_ant_jump_promp['name'] = _v # register( # id=_env_id, -# entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', +# entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', # kwargs=kwargs_dict_ant_jump_promp # ) # ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -401,7 +398,7 @@ for _v in _versions: # ######################################################################################################################## # # ## HalfCheetahJump -# _versions = ['ALRHalfCheetahJump-v0'] +# _versions = ['HalfCheetahJump-v0'] # for _v in _versions: # _name = _v.split("-") # _env_id = f'{_name[0]}ProMP-{_name[1]}' @@ -410,7 +407,7 @@ for _v in _versions: # kwargs_dict_halfcheetah_jump_promp['name'] = _v # register( # id=_env_id, -# entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', +# entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', # kwargs=kwargs_dict_halfcheetah_jump_promp # ) # ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -420,7 +417,7 @@ for _v in _versions: ## HopperJump _versions = ['HopperJump-v0', 'HopperJumpSparse-v0', - # 'ALRHopperJumpOnBox-v0', 'ALRHopperThrow-v0', 'ALRHopperThrowInBasket-v0' + # 'HopperJumpOnBox-v0', 'HopperThrow-v0', 'HopperThrowInBasket-v0' ] # TODO: Check if all environments work with the same MPWrapper for _v in _versions: @@ -431,7 +428,7 @@ for _v in _versions: kwargs_dict_hopper_jump_promp['name'] = _v register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_hopper_jump_promp ) ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -440,7 +437,7 @@ for _v in _versions: # # # ## Walker2DJump -# _versions = ['ALRWalker2DJump-v0'] +# _versions = ['Walker2DJump-v0'] # for _v in _versions: # _name = _v.split("-") # _env_id = f'{_name[0]}ProMP-{_name[1]}' @@ -449,7 +446,7 @@ for _v in _versions: # kwargs_dict_walker2d_jump_promp['name'] = _v # register( # id=_env_id, -# entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', +# entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', # kwargs=kwargs_dict_walker2d_jump_promp # ) # ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -458,7 +455,7 @@ for _v in _versions: """ register( id='SimpleReacher-v1', - entry_point='alr_envs.envs.classic_control:SimpleReacherEnv', + entry_point='fancy_gym.envs.classic_control:SimpleReacherEnv', max_episode_steps=200, kwargs={ "n_links": 2, @@ -468,7 +465,7 @@ register( register( id='LongSimpleReacher-v1', - entry_point='alr_envs.envs.classic_control:SimpleReacherEnv', + entry_point='fancy_gym.envs.classic_control:SimpleReacherEnv', max_episode_steps=200, kwargs={ "n_links": 5, @@ -477,7 +474,7 @@ register( ) register( id='HoleReacher-v1', - entry_point='alr_envs.envs.classic_control:HoleReacherEnv', + entry_point='fancy_gym.envs.classic_control:HoleReacherEnv', max_episode_steps=200, kwargs={ "n_links": 5, @@ -492,7 +489,7 @@ register( ) register( id='HoleReacher-v2', - entry_point='alr_envs.envs.classic_control:HoleReacherEnv', + entry_point='fancy_gym.envs.classic_control:HoleReacherEnv', max_episode_steps=200, kwargs={ "n_links": 5, @@ -508,8 +505,8 @@ register( # CtxtFree are v0, Contextual are v1 register( - id='ALRAntJump-v0', - entry_point='alr_envs.envs.mujoco:AntJumpEnv', + id='AntJump-v0', + entry_point='fancy_gym.envs.mujoco:AntJumpEnv', max_episode_steps=MAX_EPISODE_STEPS_ANTJUMP, kwargs={ "max_episode_steps": MAX_EPISODE_STEPS_ANTJUMP, @@ -518,8 +515,8 @@ register( ) # CtxtFree are v0, Contextual are v1 register( - id='ALRHalfCheetahJump-v0', - entry_point='alr_envs.envs.mujoco:HalfCheetahJumpEnv', + id='HalfCheetahJump-v0', + entry_point='fancy_gym.envs.mujoco:HalfCheetahJumpEnv', max_episode_steps=MAX_EPISODE_STEPS_HALFCHEETAHJUMP, kwargs={ "max_episode_steps": MAX_EPISODE_STEPS_HALFCHEETAHJUMP, @@ -527,8 +524,8 @@ register( } ) register( - id='ALRHopperJump-v0', - entry_point='alr_envs.envs.mujoco:HopperJumpEnv', + id='HopperJump-v0', + entry_point='fancy_gym.envs.mujoco:HopperJumpEnv', max_episode_steps=MAX_EPISODE_STEPS_HOPPERJUMP, kwargs={ "max_episode_steps": MAX_EPISODE_STEPS_HOPPERJUMP, @@ -546,26 +543,26 @@ for i in _vs: _env_id = f'ALRReacher{i}-v0' register( id=_env_id, - entry_point='alr_envs.envs.mujoco:ReacherEnv', + entry_point='fancy_gym.envs.mujoco:ReacherEnv', max_episode_steps=200, kwargs={ "steps_before_reward": 0, "n_links": 5, "balance": False, - 'ctrl_cost_weight': i + '_ctrl_cost_weight': i } ) _env_id = f'ALRReacherSparse{i}-v0' register( id=_env_id, - entry_point='alr_envs.envs.mujoco:ReacherEnv', + entry_point='fancy_gym.envs.mujoco:ReacherEnv', max_episode_steps=200, kwargs={ "steps_before_reward": 200, "n_links": 5, "balance": False, - 'ctrl_cost_weight': i + '_ctrl_cost_weight': i } ) _vs = np.arange(101).tolist() + [1e-5, 5e-5, 1e-4, 5e-4, 1e-3, 5e-3, 1e-2, 5e-2, 1e-1, 5e-1] @@ -573,7 +570,7 @@ for i in _vs: _env_id = f'ALRReacher{i}ProMP-v0' register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_promp_env_helper', kwargs={ "name": f"{_env_id.replace('ProMP', '')}", "wrappers": [mujoco.reacher.MPWrapper], @@ -596,7 +593,7 @@ for i in _vs: _env_id = f'ALRReacherSparse{i}ProMP-v0' register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_promp_env_helper', kwargs={ "name": f"{_env_id.replace('ProMP', '')}", "wrappers": [mujoco.reacher.MPWrapper], @@ -617,8 +614,8 @@ for i in _vs: ) register( - id='ALRHopperJumpOnBox-v0', - entry_point='alr_envs.envs.mujoco:HopperJumpOnBoxEnv', + id='HopperJumpOnBox-v0', + entry_point='fancy_gym.envs.mujoco:HopperJumpOnBoxEnv', max_episode_steps=MAX_EPISODE_STEPS_HOPPERJUMPONBOX, kwargs={ "max_episode_steps": MAX_EPISODE_STEPS_HOPPERJUMPONBOX, @@ -626,8 +623,8 @@ for i in _vs: } ) register( - id='ALRHopperThrow-v0', - entry_point='alr_envs.envs.mujoco:HopperThrowEnv', + id='HopperThrow-v0', + entry_point='fancy_gym.envs.mujoco:HopperThrowEnv', max_episode_steps=MAX_EPISODE_STEPS_HOPPERTHROW, kwargs={ "max_episode_steps": MAX_EPISODE_STEPS_HOPPERTHROW, @@ -635,8 +632,8 @@ for i in _vs: } ) register( - id='ALRHopperThrowInBasket-v0', - entry_point='alr_envs.envs.mujoco:HopperThrowInBasketEnv', + id='HopperThrowInBasket-v0', + entry_point='fancy_gym.envs.mujoco:HopperThrowInBasketEnv', max_episode_steps=MAX_EPISODE_STEPS_HOPPERTHROWINBASKET, kwargs={ "max_episode_steps": MAX_EPISODE_STEPS_HOPPERTHROWINBASKET, @@ -644,8 +641,8 @@ for i in _vs: } ) register( - id='ALRWalker2DJump-v0', - entry_point='alr_envs.envs.mujoco:Walker2dJumpEnv', + id='Walker2DJump-v0', + entry_point='fancy_gym.envs.mujoco:Walker2dJumpEnv', max_episode_steps=MAX_EPISODE_STEPS_WALKERJUMP, kwargs={ "max_episode_steps": MAX_EPISODE_STEPS_WALKERJUMP, @@ -653,13 +650,13 @@ for i in _vs: } ) register(id='TableTennis2DCtxt-v1', - entry_point='alr_envs.envs.mujoco:TTEnvGym', + entry_point='fancy_gym.envs.mujoco:TTEnvGym', max_episode_steps=MAX_EPISODE_STEPS, kwargs={'ctxt_dim': 2, 'fixed_goal': True}) register( - id='ALRBeerPong-v0', - entry_point='alr_envs.envs.mujoco:ALRBeerBongEnv', + id='BeerPong-v0', + entry_point='fancy_gym.envs.mujoco:BeerBongEnv', max_episode_steps=300, kwargs={ "rndm_goal": False, diff --git a/alr_envs/envs/classic_control/README.MD b/fancy_gym/envs/classic_control/README.MD similarity index 100% rename from alr_envs/envs/classic_control/README.MD rename to fancy_gym/envs/classic_control/README.MD diff --git a/alr_envs/envs/classic_control/__init__.py b/fancy_gym/envs/classic_control/__init__.py similarity index 100% rename from alr_envs/envs/classic_control/__init__.py rename to fancy_gym/envs/classic_control/__init__.py diff --git a/alr_envs/black_box/factory/__init__.py b/fancy_gym/envs/classic_control/base_reacher/__init__.py similarity index 100% rename from alr_envs/black_box/factory/__init__.py rename to fancy_gym/envs/classic_control/base_reacher/__init__.py diff --git a/alr_envs/envs/classic_control/base_reacher/base_reacher.py b/fancy_gym/envs/classic_control/base_reacher/base_reacher.py similarity index 98% rename from alr_envs/envs/classic_control/base_reacher/base_reacher.py rename to fancy_gym/envs/classic_control/base_reacher/base_reacher.py index f9186d8..abfe2ca 100644 --- a/alr_envs/envs/classic_control/base_reacher/base_reacher.py +++ b/fancy_gym/envs/classic_control/base_reacher/base_reacher.py @@ -7,7 +7,7 @@ from gym import spaces from gym.core import ObsType from gym.utils import seeding -from alr_envs.envs.classic_control.utils import intersect +from fancy_gym.envs.classic_control.utils import intersect class BaseReacherEnv(gym.Env, ABC): diff --git a/alr_envs/envs/classic_control/base_reacher/base_reacher_direct.py b/fancy_gym/envs/classic_control/base_reacher/base_reacher_direct.py similarity index 92% rename from alr_envs/envs/classic_control/base_reacher/base_reacher_direct.py rename to fancy_gym/envs/classic_control/base_reacher/base_reacher_direct.py index 05cff5b..0e44033 100644 --- a/alr_envs/envs/classic_control/base_reacher/base_reacher_direct.py +++ b/fancy_gym/envs/classic_control/base_reacher/base_reacher_direct.py @@ -1,14 +1,16 @@ from abc import ABC -from gym import spaces import numpy as np -from alr_envs.envs.classic_control.base_reacher.base_reacher import BaseReacherEnv +from gym import spaces + +from fancy_gym.envs.classic_control.base_reacher.base_reacher import BaseReacherEnv class BaseReacherDirectEnv(BaseReacherEnv, ABC): """ Base class for directly controlled reaching environments """ + def __init__(self, n_links: int, random_start: bool = True, allow_self_collision: bool = False): super().__init__(n_links, random_start, allow_self_collision) diff --git a/alr_envs/envs/classic_control/base_reacher/base_reacher_torque.py b/fancy_gym/envs/classic_control/base_reacher/base_reacher_torque.py similarity index 92% rename from alr_envs/envs/classic_control/base_reacher/base_reacher_torque.py rename to fancy_gym/envs/classic_control/base_reacher/base_reacher_torque.py index 469d8a3..79f3005 100644 --- a/alr_envs/envs/classic_control/base_reacher/base_reacher_torque.py +++ b/fancy_gym/envs/classic_control/base_reacher/base_reacher_torque.py @@ -1,14 +1,16 @@ from abc import ABC -from gym import spaces import numpy as np -from alr_envs.envs.classic_control.base_reacher.base_reacher import BaseReacherEnv +from gym import spaces + +from fancy_gym.envs.classic_control.base_reacher.base_reacher import BaseReacherEnv class BaseReacherTorqueEnv(BaseReacherEnv, ABC): """ Base class for torque controlled reaching environments """ + def __init__(self, n_links: int, random_start: bool = True, allow_self_collision: bool = False): super().__init__(n_links, random_start, allow_self_collision) diff --git a/alr_envs/envs/classic_control/hole_reacher/__init__.py b/fancy_gym/envs/classic_control/hole_reacher/__init__.py similarity index 100% rename from alr_envs/envs/classic_control/hole_reacher/__init__.py rename to fancy_gym/envs/classic_control/hole_reacher/__init__.py diff --git a/alr_envs/envs/classic_control/hole_reacher/hole_reacher.py b/fancy_gym/envs/classic_control/hole_reacher/hole_reacher.py similarity index 95% rename from alr_envs/envs/classic_control/hole_reacher/hole_reacher.py rename to fancy_gym/envs/classic_control/hole_reacher/hole_reacher.py index 0bd0e5c..5563ea6 100644 --- a/alr_envs/envs/classic_control/hole_reacher/hole_reacher.py +++ b/fancy_gym/envs/classic_control/hole_reacher/hole_reacher.py @@ -6,7 +6,9 @@ import numpy as np from gym.core import ObsType from matplotlib import patches -from alr_envs.envs.classic_control.base_reacher.base_reacher_direct import BaseReacherDirectEnv +from fancy_gym.envs.classic_control.base_reacher.base_reacher_direct import BaseReacherDirectEnv + +MAX_EPISODE_STEPS_HOLEREACHER = 200 class HoleReacherEnv(BaseReacherDirectEnv): @@ -41,13 +43,13 @@ class HoleReacherEnv(BaseReacherDirectEnv): self.observation_space = gym.spaces.Box(low=-state_bound, high=state_bound, shape=state_bound.shape) if rew_fct == "simple": - from alr_envs.envs.classic_control.hole_reacher.hr_simple_reward import HolereacherReward + from fancy_gym.envs.classic_control.hole_reacher.hr_simple_reward import HolereacherReward self.reward_function = HolereacherReward(allow_self_collision, allow_wall_collision, collision_penalty) elif rew_fct == "vel_acc": - from alr_envs.envs.classic_control.hole_reacher.hr_dist_vel_acc_reward import HolereacherReward + from fancy_gym.envs.classic_control.hole_reacher.hr_dist_vel_acc_reward import HolereacherReward self.reward_function = HolereacherReward(allow_self_collision, allow_wall_collision, collision_penalty) elif rew_fct == "unbounded": - from alr_envs.envs.classic_control.hole_reacher.hr_unbounded_reward import HolereacherReward + from fancy_gym.envs.classic_control.hole_reacher.hr_unbounded_reward import HolereacherReward self.reward_function = HolereacherReward(allow_self_collision, allow_wall_collision) else: raise ValueError("Unknown reward function {}".format(rew_fct)) @@ -224,7 +226,6 @@ class HoleReacherEnv(BaseReacherDirectEnv): if __name__ == "__main__": - import time env = HoleReacherEnv(5) env.reset() diff --git a/alr_envs/envs/classic_control/hole_reacher/hr_dist_vel_acc_reward.py b/fancy_gym/envs/classic_control/hole_reacher/hr_dist_vel_acc_reward.py similarity index 100% rename from alr_envs/envs/classic_control/hole_reacher/hr_dist_vel_acc_reward.py rename to fancy_gym/envs/classic_control/hole_reacher/hr_dist_vel_acc_reward.py diff --git a/alr_envs/envs/classic_control/hole_reacher/hr_simple_reward.py b/fancy_gym/envs/classic_control/hole_reacher/hr_simple_reward.py similarity index 100% rename from alr_envs/envs/classic_control/hole_reacher/hr_simple_reward.py rename to fancy_gym/envs/classic_control/hole_reacher/hr_simple_reward.py diff --git a/alr_envs/envs/classic_control/hole_reacher/hr_unbounded_reward.py b/fancy_gym/envs/classic_control/hole_reacher/hr_unbounded_reward.py similarity index 100% rename from alr_envs/envs/classic_control/hole_reacher/hr_unbounded_reward.py rename to fancy_gym/envs/classic_control/hole_reacher/hr_unbounded_reward.py diff --git a/alr_envs/envs/classic_control/hole_reacher/mp_wrapper.py b/fancy_gym/envs/classic_control/hole_reacher/mp_wrapper.py similarity index 91% rename from alr_envs/envs/classic_control/hole_reacher/mp_wrapper.py rename to fancy_gym/envs/classic_control/hole_reacher/mp_wrapper.py index 00a5eb8..d160b5c 100644 --- a/alr_envs/envs/classic_control/hole_reacher/mp_wrapper.py +++ b/fancy_gym/envs/classic_control/hole_reacher/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Tuple, Union import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/envs/classic_control/simple_reacher/__init__.py b/fancy_gym/envs/classic_control/simple_reacher/__init__.py similarity index 100% rename from alr_envs/envs/classic_control/simple_reacher/__init__.py rename to fancy_gym/envs/classic_control/simple_reacher/__init__.py diff --git a/alr_envs/envs/classic_control/simple_reacher/mp_wrapper.py b/fancy_gym/envs/classic_control/simple_reacher/mp_wrapper.py similarity index 90% rename from alr_envs/envs/classic_control/simple_reacher/mp_wrapper.py rename to fancy_gym/envs/classic_control/simple_reacher/mp_wrapper.py index 3fa12d8..6d1fda1 100644 --- a/alr_envs/envs/classic_control/simple_reacher/mp_wrapper.py +++ b/fancy_gym/envs/classic_control/simple_reacher/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Tuple, Union import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/envs/classic_control/simple_reacher/simple_reacher.py b/fancy_gym/envs/classic_control/simple_reacher/simple_reacher.py similarity index 97% rename from alr_envs/envs/classic_control/simple_reacher/simple_reacher.py rename to fancy_gym/envs/classic_control/simple_reacher/simple_reacher.py index 8c6f8d5..9b03147 100644 --- a/alr_envs/envs/classic_control/simple_reacher/simple_reacher.py +++ b/fancy_gym/envs/classic_control/simple_reacher/simple_reacher.py @@ -5,7 +5,7 @@ import numpy as np from gym import spaces from gym.core import ObsType -from alr_envs.envs.classic_control.base_reacher.base_reacher_torque import BaseReacherTorqueEnv +from fancy_gym.envs.classic_control.base_reacher.base_reacher_torque import BaseReacherTorqueEnv class SimpleReacherEnv(BaseReacherTorqueEnv): diff --git a/alr_envs/envs/classic_control/utils.py b/fancy_gym/envs/classic_control/utils.py similarity index 96% rename from alr_envs/envs/classic_control/utils.py rename to fancy_gym/envs/classic_control/utils.py index b557a0a..ea378d1 100644 --- a/alr_envs/envs/classic_control/utils.py +++ b/fancy_gym/envs/classic_control/utils.py @@ -1,6 +1,3 @@ -import numpy as np - - def ccw(A, B, C): return (C[1] - A[1]) * (B[0] - A[0]) - (B[1] - A[1]) * (C[0] - A[0]) > 1e-12 diff --git a/alr_envs/envs/classic_control/viapoint_reacher/__init__.py b/fancy_gym/envs/classic_control/viapoint_reacher/__init__.py similarity index 100% rename from alr_envs/envs/classic_control/viapoint_reacher/__init__.py rename to fancy_gym/envs/classic_control/viapoint_reacher/__init__.py diff --git a/alr_envs/envs/classic_control/viapoint_reacher/mp_wrapper.py b/fancy_gym/envs/classic_control/viapoint_reacher/mp_wrapper.py similarity index 91% rename from alr_envs/envs/classic_control/viapoint_reacher/mp_wrapper.py rename to fancy_gym/envs/classic_control/viapoint_reacher/mp_wrapper.py index d152f3b..47da749 100644 --- a/alr_envs/envs/classic_control/viapoint_reacher/mp_wrapper.py +++ b/fancy_gym/envs/classic_control/viapoint_reacher/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Tuple, Union import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/envs/classic_control/viapoint_reacher/viapoint_reacher.py b/fancy_gym/envs/classic_control/viapoint_reacher/viapoint_reacher.py similarity index 98% rename from alr_envs/envs/classic_control/viapoint_reacher/viapoint_reacher.py rename to fancy_gym/envs/classic_control/viapoint_reacher/viapoint_reacher.py index 9266721..f3412ac 100644 --- a/alr_envs/envs/classic_control/viapoint_reacher/viapoint_reacher.py +++ b/fancy_gym/envs/classic_control/viapoint_reacher/viapoint_reacher.py @@ -4,9 +4,8 @@ import gym import matplotlib.pyplot as plt import numpy as np from gym.core import ObsType -from gym.utils import seeding -from alr_envs.envs.classic_control.base_reacher.base_reacher_direct import BaseReacherDirectEnv +from fancy_gym.envs.classic_control.base_reacher.base_reacher_direct import BaseReacherDirectEnv class ViaPointReacherEnv(BaseReacherDirectEnv): @@ -187,7 +186,6 @@ class ViaPointReacherEnv(BaseReacherDirectEnv): if __name__ == "__main__": - import time env = ViaPointReacherEnv(5) env.reset() diff --git a/alr_envs/envs/mujoco/README.MD b/fancy_gym/envs/mujoco/README.MD similarity index 100% rename from alr_envs/envs/mujoco/README.MD rename to fancy_gym/envs/mujoco/README.MD diff --git a/alr_envs/envs/mujoco/__init__.py b/fancy_gym/envs/mujoco/__init__.py similarity index 100% rename from alr_envs/envs/mujoco/__init__.py rename to fancy_gym/envs/mujoco/__init__.py index 1d0cf76..b283b60 100644 --- a/alr_envs/envs/mujoco/__init__.py +++ b/fancy_gym/envs/mujoco/__init__.py @@ -1,9 +1,9 @@ -from .beerpong.beerpong import BeerPongEnv, BeerPongEnvFixedReleaseStep, BeerPongEnvStepBasedEpisodicReward from .ant_jump.ant_jump import AntJumpEnv +from .beerpong.beerpong import BeerPongEnv, BeerPongEnvFixedReleaseStep, BeerPongEnvStepBasedEpisodicReward from .half_cheetah_jump.half_cheetah_jump import HalfCheetahJumpEnv +from .hopper_jump.hopper_jump import HopperJumpEnv from .hopper_jump.hopper_jump_on_box import HopperJumpOnBoxEnv from .hopper_throw.hopper_throw import HopperThrowEnv from .hopper_throw.hopper_throw_in_basket import HopperThrowInBasketEnv from .reacher.reacher import ReacherEnv from .walker_2d_jump.walker_2d_jump import Walker2dJumpEnv -from .hopper_jump.hopper_jump import HopperJumpEnv diff --git a/alr_envs/envs/mujoco/ant_jump/__init__.py b/fancy_gym/envs/mujoco/ant_jump/__init__.py similarity index 100% rename from alr_envs/envs/mujoco/ant_jump/__init__.py rename to fancy_gym/envs/mujoco/ant_jump/__init__.py diff --git a/alr_envs/envs/mujoco/ant_jump/ant_jump.py b/fancy_gym/envs/mujoco/ant_jump/ant_jump.py similarity index 99% rename from alr_envs/envs/mujoco/ant_jump/ant_jump.py rename to fancy_gym/envs/mujoco/ant_jump/ant_jump.py index 7c00225..9311ae1 100644 --- a/alr_envs/envs/mujoco/ant_jump/ant_jump.py +++ b/fancy_gym/envs/mujoco/ant_jump/ant_jump.py @@ -17,7 +17,7 @@ class AntJumpEnv(AntEnv): """ Initialization changes to normal Ant: - healthy_reward: 1.0 -> 0.01 -> 0.0 no healthy reward needed - Paul and Marc - - ctrl_cost_weight 0.5 -> 0.0 + - _ctrl_cost_weight 0.5 -> 0.0 - contact_cost_weight: 5e-4 -> 0.0 - healthy_z_range: (0.2, 1.0) -> (0.3, float('inf')) !!!!! Does that make sense, limiting height? """ diff --git a/alr_envs/envs/mujoco/ant_jump/assets/ant.xml b/fancy_gym/envs/mujoco/ant_jump/assets/ant.xml similarity index 100% rename from alr_envs/envs/mujoco/ant_jump/assets/ant.xml rename to fancy_gym/envs/mujoco/ant_jump/assets/ant.xml diff --git a/alr_envs/envs/mujoco/ant_jump/mp_wrapper.py b/fancy_gym/envs/mujoco/ant_jump/mp_wrapper.py similarity index 87% rename from alr_envs/envs/mujoco/ant_jump/mp_wrapper.py rename to fancy_gym/envs/mujoco/ant_jump/mp_wrapper.py index c1dfbde..2f2eb76 100644 --- a/alr_envs/envs/mujoco/ant_jump/mp_wrapper.py +++ b/fancy_gym/envs/mujoco/ant_jump/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Union, Tuple import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/envs/mujoco/beerpong/__init__.py b/fancy_gym/envs/mujoco/beerpong/__init__.py similarity index 100% rename from alr_envs/envs/mujoco/beerpong/__init__.py rename to fancy_gym/envs/mujoco/beerpong/__init__.py diff --git a/alr_envs/envs/mujoco/beerpong/assets/beerpong.xml b/fancy_gym/envs/mujoco/beerpong/assets/beerpong.xml similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/beerpong.xml rename to fancy_gym/envs/mujoco/beerpong/assets/beerpong.xml diff --git a/alr_envs/envs/mujoco/beerpong/assets/beerpong_wo_cup.xml b/fancy_gym/envs/mujoco/beerpong/assets/beerpong_wo_cup.xml similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/beerpong_wo_cup.xml rename to fancy_gym/envs/mujoco/beerpong/assets/beerpong_wo_cup.xml diff --git a/alr_envs/envs/mujoco/beerpong/assets/beerpong_wo_cup_big_table.xml b/fancy_gym/envs/mujoco/beerpong/assets/beerpong_wo_cup_big_table.xml similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/beerpong_wo_cup_big_table.xml rename to fancy_gym/envs/mujoco/beerpong/assets/beerpong_wo_cup_big_table.xml diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/base_link_convex.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/base_link_convex.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/base_link_convex.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/base_link_convex.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/base_link_fine.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/base_link_fine.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/base_link_fine.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/base_link_fine.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_dist_link_convex.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_dist_link_convex.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_dist_link_convex.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_dist_link_convex.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_dist_link_fine.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_dist_link_fine.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_dist_link_fine.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_dist_link_fine.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_med_link_convex.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_med_link_convex.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_med_link_convex.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_med_link_convex.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_med_link_fine.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_med_link_fine.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_med_link_fine.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_med_link_fine.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p1.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p1.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p1.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p1.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p2.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p2.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p2.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p2.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p3.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p3.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p3.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_convex_decomposition_p3.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_fine.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_fine.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_fine.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_finger_prox_link_fine.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_fine.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_fine.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_fine.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_fine.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p1.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p1.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p1.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p1.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p2.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p2.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p2.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p2.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p3.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p3.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p3.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p3.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p4.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p4.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p4.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/bhand_palm_link_convex_decomposition_p4.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split1.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split1.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split1.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split1.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split10.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split10.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split10.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split10.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split11.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split11.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split11.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split11.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split12.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split12.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split12.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split12.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split13.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split13.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split13.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split13.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split14.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split14.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split14.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split14.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split15.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split15.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split15.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split15.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split16.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split16.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split16.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split16.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split17.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split17.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split17.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split17.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split18.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split18.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split18.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split18.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split2.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split2.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split2.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split2.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split3.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split3.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split3.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split3.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split4.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split4.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split4.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split4.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split5.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split5.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split5.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split5.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split6.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split6.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split6.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split6.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split7.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split7.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split7.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split7.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split8.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split8.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split8.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split8.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split9.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split9.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/cup_split9.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/cup_split9.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/elbow_link_convex.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/elbow_link_convex.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/elbow_link_convex.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/elbow_link_convex.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/elbow_link_fine.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/elbow_link_fine.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/elbow_link_fine.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/elbow_link_fine.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_convex_decomposition_p1.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_convex_decomposition_p1.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_convex_decomposition_p1.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_convex_decomposition_p1.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_convex_decomposition_p2.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_convex_decomposition_p2.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_convex_decomposition_p2.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_convex_decomposition_p2.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_fine.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_fine.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_fine.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/forearm_link_fine.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p1.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p1.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p1.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p1.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p2.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p2.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p2.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p2.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p3.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p3.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p3.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_convex_decomposition_p3.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_fine.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_fine.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_fine.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/shoulder_link_fine.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/shoulder_pitch_link_convex.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/shoulder_pitch_link_convex.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/shoulder_pitch_link_convex.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/shoulder_pitch_link_convex.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/shoulder_pitch_link_fine.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/shoulder_pitch_link_fine.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/shoulder_pitch_link_fine.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/shoulder_pitch_link_fine.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_convex_decomposition_p1.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_convex_decomposition_p1.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_convex_decomposition_p1.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_convex_decomposition_p1.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_convex_decomposition_p2.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_convex_decomposition_p2.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_convex_decomposition_p2.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_convex_decomposition_p2.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_fine.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_fine.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_fine.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/upper_arm_link_fine.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_palm_link_convex.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_palm_link_convex.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_palm_link_convex.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_palm_link_convex.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_palm_link_fine.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_palm_link_fine.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_palm_link_fine.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_palm_link_fine.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p1.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p1.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p1.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p1.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p2.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p2.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p2.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p2.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p3.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p3.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p3.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_convex_decomposition_p3.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_fine.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_fine.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_fine.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_pitch_link_fine.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_convex_decomposition_p1.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_convex_decomposition_p1.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_convex_decomposition_p1.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_convex_decomposition_p1.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_convex_decomposition_p2.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_convex_decomposition_p2.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_convex_decomposition_p2.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_convex_decomposition_p2.stl diff --git a/alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_fine.stl b/fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_fine.stl similarity index 100% rename from alr_envs/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_fine.stl rename to fancy_gym/envs/mujoco/beerpong/assets/meshes/wam/wrist_yaw_link_fine.stl diff --git a/alr_envs/envs/mujoco/beerpong/beerpong.py b/fancy_gym/envs/mujoco/beerpong/beerpong.py similarity index 94% rename from alr_envs/envs/mujoco/beerpong/beerpong.py rename to fancy_gym/envs/mujoco/beerpong/beerpong.py index bacdd4d..9fcfdd8 100644 --- a/alr_envs/envs/mujoco/beerpong/beerpong.py +++ b/fancy_gym/envs/mujoco/beerpong/beerpong.py @@ -32,13 +32,12 @@ class BeerPongEnv(MujocoEnv, utils.EzPickle): def __init__(self): self._steps = 0 # Small Context -> Easier. Todo: Should we do different versions? - # self.xml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "assets", - # "beerpong_wo_cup" + ".xml") + # self.xml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "assets", "beerpong_wo_cup.xml") # self._cup_pos_min = np.array([-0.32, -2.2]) # self._cup_pos_max = np.array([0.32, -1.2]) self.xml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "assets", - "beerpong_wo_cup_big_table" + ".xml") + "beerpong_wo_cup_big_table.xml") self._cup_pos_min = np.array([-1.42, -4.05]) self._cup_pos_max = np.array([1.42, -1.25]) @@ -127,7 +126,7 @@ class BeerPongEnv(MujocoEnv, utils.EzPickle): if not crash: reward, reward_infos = self._get_reward(applied_action) - is_collided = reward_infos['is_collided'] # TODO: Remove if self collision does not make a difference + is_collided = reward_infos['is_collided'] # TODO: Remove if self collision does not make a difference done = is_collided self._steps += 1 else: @@ -182,7 +181,7 @@ class BeerPongEnv(MujocoEnv, utils.EzPickle): # Is this needed? # self._is_collided = self._check_collision_with_itself([self.geom_id(name) for name in CUP_COLLISION_OBJ]) - if self._steps == MAX_EPISODE_STEPS_BEERPONG-1: # or self._is_collided: + if self._steps == MAX_EPISODE_STEPS_BEERPONG - 1: # or self._is_collided: min_dist = np.min(self.dists) final_dist = self.dists_final[-1] if self.ball_ground_contact_first: @@ -218,7 +217,7 @@ class BeerPongEnv(MujocoEnv, utils.EzPickle): return reward, infos def _check_contacts(self): - #TODO proper contact detection using sensors? + # TODO proper contact detection using sensors? if not self.ball_table_contact: self.ball_table_contact = self._check_collision({self.geom_id("ball_geom")}, {self.geom_id("table_contact_geom")}) @@ -237,9 +236,9 @@ class BeerPongEnv(MujocoEnv, utils.EzPickle): self.ball_ground_contact_first = self._check_collision({self.geom_id("ball_geom")}, {self.geom_id("ground")}) - # Checks if id_set1 has a collision with id_set2 - def _check_collision(self, id_set_1, id_set_2): + def _check_collision(self, id_set_1, id_set_2=None): """ + Checks if id_set1 has a collision with id_set2. If id_set_2 is set to None, it will check for a collision with itself (id_set_1). """ collision_id_set = id_set_2 - id_set_1 if id_set_2 is not None else id_set_1 @@ -279,19 +278,19 @@ class BeerPongEnvStepBasedEpisodicReward(BeerPongEnv): return ob, reward, done, infos -# class ALRBeerBongEnvStepBased(ALRBeerBongEnv): +# class BeerBongEnvStepBased(BeerBongEnv): # def __init__(self, frame_skip=1, apply_gravity_comp=True, noisy=False, rndm_goal=False, cup_goal_pos=None): # super().__init__(frame_skip, apply_gravity_comp, noisy, rndm_goal, cup_goal_pos) # self.release_step = 62 # empirically evaluated for frame_skip=2! # # def step(self, a): # if self._steps < self.release_step: -# return super(ALRBeerBongEnvStepBased, self).step(a) +# return super(BeerBongEnvStepBased, self).step(a) # else: # reward = 0 # done = False # while not done: -# sub_ob, sub_reward, done, sub_infos = super(ALRBeerBongEnvStepBased, self).step(np.zeros(a.shape)) +# sub_ob, sub_reward, done, sub_infos = super(BeerBongEnvStepBased, self).step(np.zeros(a.shape)) # if not done or sub_infos['sim_crash']: # reward += sub_reward # else: @@ -315,9 +314,9 @@ class BeerPongEnvStepBasedEpisodicReward(BeerPongEnv): if __name__ == "__main__": env = BeerPongEnv() env.seed(0) - # env = ALRBeerBongEnvStepBased(frame_skip=2) - # env = ALRBeerBongEnvStepBasedEpisodicReward(frame_skip=2) - # env = ALRBeerBongEnvFixedReleaseStep(frame_skip=2) + # env = BeerBongEnvStepBased(frame_skip=2) + # env = BeerBongEnvStepBasedEpisodicReward(frame_skip=2) + # env = BeerBongEnvFixedReleaseStep(frame_skip=2) import time env.reset() diff --git a/alr_envs/envs/classic_control/base_reacher/__init__.py b/fancy_gym/envs/mujoco/beerpong/deprecated/__init__.py similarity index 100% rename from alr_envs/envs/classic_control/base_reacher/__init__.py rename to fancy_gym/envs/mujoco/beerpong/deprecated/__init__.py diff --git a/alr_envs/envs/mujoco/beerpong/deprecated/beerpong.py b/fancy_gym/envs/mujoco/beerpong/deprecated/beerpong.py similarity index 94% rename from alr_envs/envs/mujoco/beerpong/deprecated/beerpong.py rename to fancy_gym/envs/mujoco/beerpong/deprecated/beerpong.py index 9006842..015e887 100644 --- a/alr_envs/envs/mujoco/beerpong/deprecated/beerpong.py +++ b/fancy_gym/envs/mujoco/beerpong/deprecated/beerpong.py @@ -5,7 +5,7 @@ import numpy as np from gym import utils from gym.envs.mujoco import MujocoEnv -from alr_envs.envs.mujoco.beerpong.deprecated.beerpong_reward_staged import BeerPongReward +from fancy_gym.envs.mujoco.beerpong.deprecated.beerpong_reward_staged import BeerPongReward class BeerPongEnv(MujocoEnv, utils.EzPickle): @@ -155,19 +155,19 @@ class BeerPongEnvStepBasedEpisodicReward(BeerPongEnv): return ob, reward, done, infos -# class BeerBongEnvStepBased(ALRBeerBongEnv): +# class BeerBongEnvStepBased(BeerBongEnv): # def __init__(self, frame_skip=1, apply_gravity_comp=True, noisy=False, rndm_goal=False, cup_goal_pos=None): # super().__init__(frame_skip, apply_gravity_comp, noisy, rndm_goal, cup_goal_pos) # self.release_step = 62 # empirically evaluated for frame_skip=2! # # def step(self, a): # if self._steps < self.release_step: -# return super(ALRBeerBongEnvStepBased, self).step(a) +# return super(BeerBongEnvStepBased, self).step(a) # else: # reward = 0 # done = False # while not done: -# sub_ob, sub_reward, done, sub_infos = super(ALRBeerBongEnvStepBased, self).step(np.zeros(a.shape)) +# sub_ob, sub_reward, done, sub_infos = super(BeerBongEnvStepBased, self).step(np.zeros(a.shape)) # if not done or sub_infos['sim_crash']: # reward += sub_reward # else: @@ -191,9 +191,9 @@ class BeerPongEnvStepBasedEpisodicReward(BeerPongEnv): if __name__ == "__main__": env = BeerPongEnv(frame_skip=2) env.seed(0) - # env = ALRBeerBongEnvStepBased(frame_skip=2) - # env = ALRBeerBongEnvStepBasedEpisodicReward(frame_skip=2) - # env = ALRBeerBongEnvFixedReleaseStep(frame_skip=2) + # env = BeerBongEnvStepBased(frame_skip=2) + # env = BeerBongEnvStepBasedEpisodicReward(frame_skip=2) + # env = BeerBongEnvFixedReleaseStep(frame_skip=2) import time env.reset() diff --git a/alr_envs/envs/mujoco/beerpong/deprecated/beerpong_reward_staged.py b/fancy_gym/envs/mujoco/beerpong/deprecated/beerpong_reward_staged.py similarity index 100% rename from alr_envs/envs/mujoco/beerpong/deprecated/beerpong_reward_staged.py rename to fancy_gym/envs/mujoco/beerpong/deprecated/beerpong_reward_staged.py diff --git a/alr_envs/envs/mujoco/beerpong/mp_wrapper.py b/fancy_gym/envs/mujoco/beerpong/mp_wrapper.py similarity index 94% rename from alr_envs/envs/mujoco/beerpong/mp_wrapper.py rename to fancy_gym/envs/mujoco/beerpong/mp_wrapper.py index c4a83de..b5e6687 100644 --- a/alr_envs/envs/mujoco/beerpong/mp_wrapper.py +++ b/fancy_gym/envs/mujoco/beerpong/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Union, Tuple import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/envs/mujoco/half_cheetah_jump/__init__.py b/fancy_gym/envs/mujoco/half_cheetah_jump/__init__.py similarity index 100% rename from alr_envs/envs/mujoco/half_cheetah_jump/__init__.py rename to fancy_gym/envs/mujoco/half_cheetah_jump/__init__.py diff --git a/alr_envs/envs/mujoco/half_cheetah_jump/assets/cheetah.xml b/fancy_gym/envs/mujoco/half_cheetah_jump/assets/cheetah.xml similarity index 100% rename from alr_envs/envs/mujoco/half_cheetah_jump/assets/cheetah.xml rename to fancy_gym/envs/mujoco/half_cheetah_jump/assets/cheetah.xml diff --git a/alr_envs/envs/mujoco/half_cheetah_jump/half_cheetah_jump.py b/fancy_gym/envs/mujoco/half_cheetah_jump/half_cheetah_jump.py similarity index 98% rename from alr_envs/envs/mujoco/half_cheetah_jump/half_cheetah_jump.py rename to fancy_gym/envs/mujoco/half_cheetah_jump/half_cheetah_jump.py index 3d948ac..e0a5982 100644 --- a/alr_envs/envs/mujoco/half_cheetah_jump/half_cheetah_jump.py +++ b/fancy_gym/envs/mujoco/half_cheetah_jump/half_cheetah_jump.py @@ -1,16 +1,16 @@ import os from typing import Tuple, Union, Optional +import numpy as np from gym.core import ObsType from gym.envs.mujoco.half_cheetah_v4 import HalfCheetahEnv -import numpy as np MAX_EPISODE_STEPS_HALFCHEETAHJUMP = 100 class HalfCheetahJumpEnv(HalfCheetahEnv): """ - ctrl_cost_weight 0.1 -> 0.0 + _ctrl_cost_weight 0.1 -> 0.0 """ def __init__(self, diff --git a/alr_envs/envs/mujoco/half_cheetah_jump/mp_wrapper.py b/fancy_gym/envs/mujoco/half_cheetah_jump/mp_wrapper.py similarity index 86% rename from alr_envs/envs/mujoco/half_cheetah_jump/mp_wrapper.py rename to fancy_gym/envs/mujoco/half_cheetah_jump/mp_wrapper.py index 9681b3a..11b169b 100644 --- a/alr_envs/envs/mujoco/half_cheetah_jump/mp_wrapper.py +++ b/fancy_gym/envs/mujoco/half_cheetah_jump/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Tuple, Union import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/envs/mujoco/hopper_jump/__init__.py b/fancy_gym/envs/mujoco/hopper_jump/__init__.py similarity index 100% rename from alr_envs/envs/mujoco/hopper_jump/__init__.py rename to fancy_gym/envs/mujoco/hopper_jump/__init__.py diff --git a/alr_envs/envs/mujoco/hopper_jump/assets/hopper_jump.xml b/fancy_gym/envs/mujoco/hopper_jump/assets/hopper_jump.xml similarity index 100% rename from alr_envs/envs/mujoco/hopper_jump/assets/hopper_jump.xml rename to fancy_gym/envs/mujoco/hopper_jump/assets/hopper_jump.xml diff --git a/alr_envs/envs/mujoco/hopper_jump/assets/hopper_jump_on_box.xml b/fancy_gym/envs/mujoco/hopper_jump/assets/hopper_jump_on_box.xml similarity index 100% rename from alr_envs/envs/mujoco/hopper_jump/assets/hopper_jump_on_box.xml rename to fancy_gym/envs/mujoco/hopper_jump/assets/hopper_jump_on_box.xml diff --git a/alr_envs/envs/mujoco/hopper_jump/hopper_jump.py b/fancy_gym/envs/mujoco/hopper_jump/hopper_jump.py similarity index 98% rename from alr_envs/envs/mujoco/hopper_jump/hopper_jump.py rename to fancy_gym/envs/mujoco/hopper_jump/hopper_jump.py index 5a334a2..329ea89 100644 --- a/alr_envs/envs/mujoco/hopper_jump/hopper_jump.py +++ b/fancy_gym/envs/mujoco/hopper_jump/hopper_jump.py @@ -1,8 +1,8 @@ -import copy import os import numpy as np from gym.envs.mujoco.hopper_v4 import HopperEnv + MAX_EPISODE_STEPS_HOPPERJUMP = 250 @@ -111,7 +111,7 @@ class HopperJumpEnv(HopperEnv): goal=self.goal[:1], goal_dist=goal_dist, height_rew=self.max_height, - healthy_reward=self.healthy_reward * 2, + healthy_reward=self.healthy_reward, healthy=self.is_healthy, contact_dist=self.contact_dist or 0 ) @@ -132,14 +132,11 @@ class HopperJumpEnv(HopperEnv): self.max_height = 0 self._steps = 0 - noise_low = -np.zeros(self.model.nq) + noise_low = np.zeros(self.model.nq) noise_low[3] = -0.5 noise_low[4] = -0.2 - noise_low[5] = 0 noise_high = np.zeros(self.model.nq) - noise_high[3] = 0 - noise_high[4] = 0 noise_high[5] = 0.785 qpos = ( @@ -159,6 +156,8 @@ class HopperJumpEnv(HopperEnv): self.init_floor_contact = False self.contact_dist = None + self.data.geom() + return observation def _is_floor_foot_contact(self): diff --git a/alr_envs/envs/mujoco/hopper_jump/hopper_jump_on_box.py b/fancy_gym/envs/mujoco/hopper_jump/hopper_jump_on_box.py similarity index 99% rename from alr_envs/envs/mujoco/hopper_jump/hopper_jump_on_box.py rename to fancy_gym/envs/mujoco/hopper_jump/hopper_jump_on_box.py index e184723..f9834bd 100644 --- a/alr_envs/envs/mujoco/hopper_jump/hopper_jump_on_box.py +++ b/fancy_gym/envs/mujoco/hopper_jump/hopper_jump_on_box.py @@ -1,7 +1,7 @@ -from gym.envs.mujoco.hopper_v4 import HopperEnv +import os import numpy as np -import os +from gym.envs.mujoco.hopper_v4 import HopperEnv MAX_EPISODE_STEPS_HOPPERJUMPONBOX = 250 diff --git a/alr_envs/envs/mujoco/hopper_jump/mp_wrapper.py b/fancy_gym/envs/mujoco/hopper_jump/mp_wrapper.py similarity index 90% rename from alr_envs/envs/mujoco/hopper_jump/mp_wrapper.py rename to fancy_gym/envs/mujoco/hopper_jump/mp_wrapper.py index 0f5e8a8..d46fa92 100644 --- a/alr_envs/envs/mujoco/hopper_jump/mp_wrapper.py +++ b/fancy_gym/envs/mujoco/hopper_jump/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Union, Tuple import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/envs/mujoco/hopper_throw/__init__.py b/fancy_gym/envs/mujoco/hopper_throw/__init__.py similarity index 100% rename from alr_envs/envs/mujoco/hopper_throw/__init__.py rename to fancy_gym/envs/mujoco/hopper_throw/__init__.py diff --git a/alr_envs/envs/mujoco/hopper_throw/assets/hopper_throw.xml b/fancy_gym/envs/mujoco/hopper_throw/assets/hopper_throw.xml similarity index 100% rename from alr_envs/envs/mujoco/hopper_throw/assets/hopper_throw.xml rename to fancy_gym/envs/mujoco/hopper_throw/assets/hopper_throw.xml diff --git a/alr_envs/envs/mujoco/hopper_throw/assets/hopper_throw_in_basket.xml b/fancy_gym/envs/mujoco/hopper_throw/assets/hopper_throw_in_basket.xml similarity index 100% rename from alr_envs/envs/mujoco/hopper_throw/assets/hopper_throw_in_basket.xml rename to fancy_gym/envs/mujoco/hopper_throw/assets/hopper_throw_in_basket.xml diff --git a/alr_envs/envs/mujoco/hopper_throw/hopper_throw.py b/fancy_gym/envs/mujoco/hopper_throw/hopper_throw.py similarity index 100% rename from alr_envs/envs/mujoco/hopper_throw/hopper_throw.py rename to fancy_gym/envs/mujoco/hopper_throw/hopper_throw.py index 3b2ce46..e69cea6 100644 --- a/alr_envs/envs/mujoco/hopper_throw/hopper_throw.py +++ b/fancy_gym/envs/mujoco/hopper_throw/hopper_throw.py @@ -1,8 +1,8 @@ import os from typing import Optional -from gym.envs.mujoco.hopper_v4 import HopperEnv import numpy as np +from gym.envs.mujoco.hopper_v4 import HopperEnv MAX_EPISODE_STEPS_HOPPERTHROW = 250 diff --git a/alr_envs/envs/mujoco/hopper_throw/hopper_throw_in_basket.py b/fancy_gym/envs/mujoco/hopper_throw/hopper_throw_in_basket.py similarity index 99% rename from alr_envs/envs/mujoco/hopper_throw/hopper_throw_in_basket.py rename to fancy_gym/envs/mujoco/hopper_throw/hopper_throw_in_basket.py index fb46809..76ef861 100644 --- a/alr_envs/envs/mujoco/hopper_throw/hopper_throw_in_basket.py +++ b/fancy_gym/envs/mujoco/hopper_throw/hopper_throw_in_basket.py @@ -1,9 +1,8 @@ import os from typing import Optional -from gym.envs.mujoco.hopper_v4 import HopperEnv - import numpy as np +from gym.envs.mujoco.hopper_v4 import HopperEnv MAX_EPISODE_STEPS_HOPPERTHROWINBASKET = 250 diff --git a/alr_envs/envs/mujoco/hopper_throw/mp_wrapper.py b/fancy_gym/envs/mujoco/hopper_throw/mp_wrapper.py similarity index 86% rename from alr_envs/envs/mujoco/hopper_throw/mp_wrapper.py rename to fancy_gym/envs/mujoco/hopper_throw/mp_wrapper.py index 247668f..cad680a 100644 --- a/alr_envs/envs/mujoco/hopper_throw/mp_wrapper.py +++ b/fancy_gym/envs/mujoco/hopper_throw/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Tuple, Union import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/envs/mujoco/reacher/__init__.py b/fancy_gym/envs/mujoco/reacher/__init__.py similarity index 100% rename from alr_envs/envs/mujoco/reacher/__init__.py rename to fancy_gym/envs/mujoco/reacher/__init__.py diff --git a/alr_envs/envs/mujoco/reacher/assets/reacher_5links.xml b/fancy_gym/envs/mujoco/reacher/assets/reacher_5links.xml similarity index 100% rename from alr_envs/envs/mujoco/reacher/assets/reacher_5links.xml rename to fancy_gym/envs/mujoco/reacher/assets/reacher_5links.xml diff --git a/alr_envs/envs/mujoco/reacher/assets/reacher_7links.xml b/fancy_gym/envs/mujoco/reacher/assets/reacher_7links.xml similarity index 100% rename from alr_envs/envs/mujoco/reacher/assets/reacher_7links.xml rename to fancy_gym/envs/mujoco/reacher/assets/reacher_7links.xml diff --git a/alr_envs/envs/mujoco/reacher/mp_wrapper.py b/fancy_gym/envs/mujoco/reacher/mp_wrapper.py similarity index 90% rename from alr_envs/envs/mujoco/reacher/mp_wrapper.py rename to fancy_gym/envs/mujoco/reacher/mp_wrapper.py index 1c1e2f1..0464640 100644 --- a/alr_envs/envs/mujoco/reacher/mp_wrapper.py +++ b/fancy_gym/envs/mujoco/reacher/mp_wrapper.py @@ -1,9 +1,8 @@ from typing import Union, Tuple -import gym import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/envs/mujoco/reacher/reacher.py b/fancy_gym/envs/mujoco/reacher/reacher.py similarity index 88% rename from alr_envs/envs/mujoco/reacher/reacher.py rename to fancy_gym/envs/mujoco/reacher/reacher.py index 3d52be7..ccd0073 100644 --- a/alr_envs/envs/mujoco/reacher/reacher.py +++ b/fancy_gym/envs/mujoco/reacher/reacher.py @@ -4,22 +4,24 @@ import numpy as np from gym import utils from gym.envs.mujoco import MujocoEnv +MAX_EPISODE_STEPS_REACHER = 200 + class ReacherEnv(MujocoEnv, utils.EzPickle): """ More general version of the gym mujoco Reacher environment """ - def __init__(self, sparse: bool = False, n_links: int = 5, ctrl_cost_weight: int = 1): + def __init__(self, sparse: bool = False, n_links: int = 5, reward_weight: float = 1, ctrl_cost_weight: float = 1): utils.EzPickle.__init__(**locals()) self._steps = 0 self.n_links = n_links - self.ctrl_cost_weight = ctrl_cost_weight - self.sparse = sparse - self.reward_weight = 1 if not sparse else 200 + + self._ctrl_cost_weight = ctrl_cost_weight + self._reward_weight = reward_weight file_name = f'reacher_{n_links}links.xml' @@ -31,7 +33,7 @@ class ReacherEnv(MujocoEnv, utils.EzPickle): def step(self, action): self._steps += 1 - is_reward = not self.sparse or (self.sparse and self._steps == 200) + is_reward = not self.sparse or (self.sparse and self._steps == MAX_EPISODE_STEPS_REACHER) reward_dist = 0.0 angular_vel = 0.0 @@ -39,7 +41,7 @@ class ReacherEnv(MujocoEnv, utils.EzPickle): reward_dist = self.distance_reward() angular_vel = self.velocity_reward() - reward_ctrl = -self.ctrl_cost_weight * np.square(action).sum() + reward_ctrl = -self._ctrl_cost_weight * np.square(action).sum() reward = reward_dist + reward_ctrl + angular_vel self.do_simulation(action, self.frame_skip) @@ -58,7 +60,7 @@ class ReacherEnv(MujocoEnv, utils.EzPickle): def distance_reward(self): vec = self.get_body_com("fingertip") - self.get_body_com("target") - return -self.reward_weight * np.linalg.norm(vec) + return -self._reward_weight * np.linalg.norm(vec) def velocity_reward(self): return -10 * np.square(self.data.qvel.flat[:self.n_links]).sum() if self.sparse else 0.0 diff --git a/alr_envs/envs/mujoco/walker_2d_jump/__init__.py b/fancy_gym/envs/mujoco/walker_2d_jump/__init__.py similarity index 100% rename from alr_envs/envs/mujoco/walker_2d_jump/__init__.py rename to fancy_gym/envs/mujoco/walker_2d_jump/__init__.py diff --git a/alr_envs/envs/mujoco/walker_2d_jump/assets/walker2d.xml b/fancy_gym/envs/mujoco/walker_2d_jump/assets/walker2d.xml similarity index 100% rename from alr_envs/envs/mujoco/walker_2d_jump/assets/walker2d.xml rename to fancy_gym/envs/mujoco/walker_2d_jump/assets/walker2d.xml diff --git a/alr_envs/envs/mujoco/walker_2d_jump/mp_wrapper.py b/fancy_gym/envs/mujoco/walker_2d_jump/mp_wrapper.py similarity index 86% rename from alr_envs/envs/mujoco/walker_2d_jump/mp_wrapper.py rename to fancy_gym/envs/mujoco/walker_2d_jump/mp_wrapper.py index f91d494..d55e9d2 100644 --- a/alr_envs/envs/mujoco/walker_2d_jump/mp_wrapper.py +++ b/fancy_gym/envs/mujoco/walker_2d_jump/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Tuple, Union import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/envs/mujoco/walker_2d_jump/walker_2d_jump.py b/fancy_gym/envs/mujoco/walker_2d_jump/walker_2d_jump.py similarity index 100% rename from alr_envs/envs/mujoco/walker_2d_jump/walker_2d_jump.py rename to fancy_gym/envs/mujoco/walker_2d_jump/walker_2d_jump.py index dadf8fd..ed663d2 100644 --- a/alr_envs/envs/mujoco/walker_2d_jump/walker_2d_jump.py +++ b/fancy_gym/envs/mujoco/walker_2d_jump/walker_2d_jump.py @@ -1,8 +1,8 @@ import os from typing import Optional -from gym.envs.mujoco.walker2d_v4 import Walker2dEnv import numpy as np +from gym.envs.mujoco.walker2d_v4 import Walker2dEnv MAX_EPISODE_STEPS_WALKERJUMP = 300 diff --git a/alr_envs/envs/mujoco/beerpong/deprecated/__init__.py b/fancy_gym/examples/__init__.py similarity index 100% rename from alr_envs/envs/mujoco/beerpong/deprecated/__init__.py rename to fancy_gym/examples/__init__.py diff --git a/alr_envs/examples/examples_dmc.py b/fancy_gym/examples/examples_dmc.py similarity index 87% rename from alr_envs/examples/examples_dmc.py rename to fancy_gym/examples/examples_dmc.py index 2d2c8fe..75648b7 100644 --- a/alr_envs/examples/examples_dmc.py +++ b/fancy_gym/examples/examples_dmc.py @@ -1,4 +1,4 @@ -import alr_envs +import fancy_gym def example_dmc(env_id="dmc:fish-swim", seed=1, iterations=1000, render=True): @@ -16,7 +16,7 @@ def example_dmc(env_id="dmc:fish-swim", seed=1, iterations=1000, render=True): Returns: """ - env = alr_envs.make(env_id, seed) + env = fancy_gym.make(env_id, seed) rewards = 0 obs = env.reset() print("observation shape:", env.observation_space.shape) @@ -40,12 +40,12 @@ def example_dmc(env_id="dmc:fish-swim", seed=1, iterations=1000, render=True): def example_custom_dmc_and_mp(seed=1, iterations=1, render=True): """ - Example for running a custom motion primitive based environments. + Example for running a custom movement primitive based environments. Our already registered environments follow the same structure. - Hence, this also allows to adjust hyperparameters of the motion primitives. + Hence, this also allows to adjust hyperparameters of the movement primitives. Yet, we recommend the method above if you are just interested in chaining those parameters for existing tasks. We appreciate PRs for custom environments (especially MP wrappers of existing tasks) - for our repo: https://github.com/ALRhub/alr_envs/ + for our repo: https://github.com/ALRhub/fancy_gym/ Args: seed: seed for deterministic behaviour iterations: Number of rollout steps to run @@ -60,7 +60,7 @@ def example_custom_dmc_and_mp(seed=1, iterations=1, render=True): # Replace this wrapper with the custom wrapper for your environment by inheriting from the RawInterfaceWrapper. # You can also add other gym.Wrappers in case they are needed. - wrappers = [alr_envs.dmc.suite.ball_in_cup.MPWrapper] + wrappers = [fancy_gym.dmc.suite.ball_in_cup.MPWrapper] # # For a ProMP trajectory_generator_kwargs = {'trajectory_generator_type': 'promp'} phase_generator_kwargs = {'phase_generator_type': 'linear'} @@ -83,10 +83,10 @@ def example_custom_dmc_and_mp(seed=1, iterations=1, render=True): # basis_generator_kwargs = {'basis_generator_type': 'rbf', # 'num_basis': 5 # } - env = alr_envs.make_bb(env_id=base_env_id, wrappers=wrappers, black_box_kwargs={}, - traj_gen_kwargs=trajectory_generator_kwargs, controller_kwargs=controller_kwargs, - phase_kwargs=phase_generator_kwargs, basis_kwargs=basis_generator_kwargs, - seed=seed) + env = fancy_gym.make_bb(env_id=base_env_id, wrappers=wrappers, black_box_kwargs={}, + traj_gen_kwargs=trajectory_generator_kwargs, controller_kwargs=controller_kwargs, + phase_kwargs=phase_generator_kwargs, basis_kwargs=basis_generator_kwargs, + seed=seed) # This renders the full MP trajectory # It is only required to call render() once in the beginning, which renders every consecutive trajectory. diff --git a/alr_envs/examples/examples_general.py b/fancy_gym/examples/examples_general.py similarity index 95% rename from alr_envs/examples/examples_general.py rename to fancy_gym/examples/examples_general.py index 33c2740..1a89e30 100644 --- a/alr_envs/examples/examples_general.py +++ b/fancy_gym/examples/examples_general.py @@ -3,7 +3,7 @@ from collections import defaultdict import gym import numpy as np -import alr_envs +import fancy_gym def example_general(env_id="Pendulum-v1", seed=1, iterations=1000, render=True): @@ -21,7 +21,7 @@ def example_general(env_id="Pendulum-v1", seed=1, iterations=1000, render=True): """ - env = alr_envs.make(env_id, seed) + env = fancy_gym.make(env_id, seed) rewards = 0 obs = env.reset() print("Observation shape: ", env.observation_space.shape) @@ -56,7 +56,7 @@ def example_async(env_id="HoleReacher-v0", n_cpu=4, seed=int('533D', 16), n_samp Returns: Tuple of (obs, reward, done, info) with type np.ndarray """ - env = gym.vector.AsyncVectorEnv([alr_envs.make_rank(env_id, seed, i) for i in range(n_cpu)]) + env = gym.vector.AsyncVectorEnv([fancy_gym.make_rank(env_id, seed, i) for i in range(n_cpu)]) # OR # envs = gym.vector.AsyncVectorEnv([make_env(env_id, seed + i) for i in range(n_cpu)]) diff --git a/alr_envs/examples/examples_metaworld.py b/fancy_gym/examples/examples_metaworld.py similarity index 88% rename from alr_envs/examples/examples_metaworld.py rename to fancy_gym/examples/examples_metaworld.py index aa6820e..0fa7066 100644 --- a/alr_envs/examples/examples_metaworld.py +++ b/fancy_gym/examples/examples_metaworld.py @@ -1,4 +1,4 @@ -import alr_envs +import fancy_gym def example_dmc(env_id="fish-swim", seed=1, iterations=1000, render=True): @@ -17,7 +17,7 @@ def example_dmc(env_id="fish-swim", seed=1, iterations=1000, render=True): Returns: """ - env = alr_envs.make(env_id, seed) + env = fancy_gym.make(env_id, seed) rewards = 0 obs = env.reset() print("observation shape:", env.observation_space.shape) @@ -42,12 +42,12 @@ def example_dmc(env_id="fish-swim", seed=1, iterations=1000, render=True): def example_custom_dmc_and_mp(seed=1, iterations=1, render=True): """ - Example for running a custom motion primitive based environments. + Example for running a custom movement primitive based environments. Our already registered environments follow the same structure. - Hence, this also allows to adjust hyperparameters of the motion primitives. + Hence, this also allows to adjust hyperparameters of the movement primitives. Yet, we recommend the method above if you are just interested in chaining those parameters for existing tasks. We appreciate PRs for custom environments (especially MP wrappers of existing tasks) - for our repo: https://github.com/ALRhub/alr_envs/ + for our repo: https://github.com/ALRhub/fancy_gym/ Args: seed: seed for deterministic behaviour (TODO: currently not working due to an issue in MetaWorld code) iterations: Number of rollout steps to run @@ -62,7 +62,7 @@ def example_custom_dmc_and_mp(seed=1, iterations=1, render=True): # Replace this wrapper with the custom wrapper for your environment by inheriting from the RawInterfaceWrapper. # You can also add other gym.Wrappers in case they are needed. - wrappers = [alr_envs.meta.goal_object_change_mp_wrapper.MPWrapper] + wrappers = [fancy_gym.meta.goal_object_change_mp_wrapper.MPWrapper] # # For a ProMP # trajectory_generator_kwargs = {'trajectory_generator_type': 'promp'} # phase_generator_kwargs = {'phase_generator_type': 'linear'} @@ -80,10 +80,10 @@ def example_custom_dmc_and_mp(seed=1, iterations=1, render=True): basis_generator_kwargs = {'basis_generator_type': 'rbf', 'num_basis': 5 } - env = alr_envs.make_bb(env_id=base_env_id, wrappers=wrappers, black_box_kwargs={}, - traj_gen_kwargs=trajectory_generator_kwargs, controller_kwargs=controller_kwargs, - phase_kwargs=phase_generator_kwargs, basis_kwargs=basis_generator_kwargs, - seed=seed) + env = fancy_gym.make_bb(env_id=base_env_id, wrappers=wrappers, black_box_kwargs={}, + traj_gen_kwargs=trajectory_generator_kwargs, controller_kwargs=controller_kwargs, + phase_kwargs=phase_generator_kwargs, basis_kwargs=basis_generator_kwargs, + seed=seed) # This renders the full MP trajectory # It is only required to call render() once in the beginning, which renders every consecutive trajectory. diff --git a/alr_envs/examples/examples_movement_primitives.py b/fancy_gym/examples/examples_movement_primitives.py similarity index 86% rename from alr_envs/examples/examples_movement_primitives.py rename to fancy_gym/examples/examples_movement_primitives.py index 49b4ee0..22e95ac 100644 --- a/alr_envs/examples/examples_movement_primitives.py +++ b/fancy_gym/examples/examples_movement_primitives.py @@ -1,4 +1,4 @@ -import alr_envs +import fancy_gym def example_mp(env_name="HoleReacherProMP-v0", seed=1, iterations=1, render=True): @@ -15,7 +15,7 @@ def example_mp(env_name="HoleReacherProMP-v0", seed=1, iterations=1, render=True """ # Equivalent to gym, we have a make function which can be used to create environments. # It takes care of seeding and enables the use of a variety of external environments using the gym interface. - env = alr_envs.make(env_name, seed) + env = fancy_gym.make(env_name, seed) returns = 0 # env.render(mode=None) @@ -52,7 +52,7 @@ def example_mp(env_name="HoleReacherProMP-v0", seed=1, iterations=1, render=True def example_custom_mp(env_name="Reacher5dProMP-v0", seed=1, iterations=1, render=True): """ - Example for running a motion primitive based environment, which is already registered + Example for running a movement primitive based environment, which is already registered Args: env_name: DMP env_id seed: seed for deterministic behaviour @@ -64,8 +64,8 @@ def example_custom_mp(env_name="Reacher5dProMP-v0", seed=1, iterations=1, render """ # Changing the arguments of the black box env is possible by providing them to gym as with all kwargs. # E.g. here for way to many basis functions - env = alr_envs.make(env_name, seed, basis_generator_kwargs={'num_basis': 1000}) - # env = alr_envs.make(env_name, seed) + env = fancy_gym.make(env_name, seed, basis_generator_kwargs={'num_basis': 1000}) + # env = fancy_gym.make(env_name, seed) # mp_dict.update({'black_box_kwargs': {'learn_sub_trajectories': True}}) # mp_dict.update({'black_box_kwargs': {'do_replanning': lambda pos, vel, t: lambda t: t % 100}}) @@ -91,12 +91,12 @@ def example_custom_mp(env_name="Reacher5dProMP-v0", seed=1, iterations=1, render def example_fully_custom_mp(seed=1, iterations=1, render=True): """ - Example for running a custom motion primitive based environments. + Example for running a custom movement primitive based environments. Our already registered environments follow the same structure. - Hence, this also allows to adjust hyperparameters of the motion primitives. + Hence, this also allows to adjust hyperparameters of the movement primitives. Yet, we recommend the method above if you are just interested in changing those parameters for existing tasks. We appreciate PRs for custom environments (especially MP wrappers of existing tasks) - for our repo: https://github.com/ALRhub/alr_envs/ + for our repo: https://github.com/ALRhub/fancy_gym/ Args: seed: seed iterations: Number of rollout steps to run @@ -110,7 +110,7 @@ def example_fully_custom_mp(seed=1, iterations=1, render=True): # Replace this wrapper with the custom wrapper for your environment by inheriting from the RawInterfaceWrapper. # You can also add other gym.Wrappers in case they are needed. - wrappers = [alr_envs.envs.classic_control.hole_reacher.MPWrapper] + wrappers = [fancy_gym.envs.classic_control.hole_reacher.MPWrapper] # # For a ProMP # trajectory_generator_kwargs = {'trajectory_generator_type': 'promp', @@ -131,10 +131,10 @@ def example_fully_custom_mp(seed=1, iterations=1, render=True): basis_generator_kwargs = {'basis_generator_type': 'rbf', 'num_basis': 5 } - env = alr_envs.make_bb(env_id=base_env_id, wrappers=wrappers, black_box_kwargs={}, - traj_gen_kwargs=trajectory_generator_kwargs, controller_kwargs=controller_kwargs, - phase_kwargs=phase_generator_kwargs, basis_kwargs=basis_generator_kwargs, - seed=seed) + env = fancy_gym.make_bb(env_id=base_env_id, wrappers=wrappers, black_box_kwargs={}, + traj_gen_kwargs=trajectory_generator_kwargs, controller_kwargs=controller_kwargs, + phase_kwargs=phase_generator_kwargs, basis_kwargs=basis_generator_kwargs, + seed=seed) if render: env.render(mode="human") diff --git a/alr_envs/examples/examples_open_ai.py b/fancy_gym/examples/examples_open_ai.py similarity index 74% rename from alr_envs/examples/examples_open_ai.py rename to fancy_gym/examples/examples_open_ai.py index fad3847..a4a162d 100644 --- a/alr_envs/examples/examples_open_ai.py +++ b/fancy_gym/examples/examples_open_ai.py @@ -1,10 +1,10 @@ -import alr_envs +import fancy_gym def example_mp(env_name, seed=1, render=True): """ - Example for running a motion primitive based version of a OpenAI-gym environment, which is already registered. - For more information on motion primitive specific stuff, look at the traj_gen examples. + Example for running a movement primitive based version of a OpenAI-gym environment, which is already registered. + For more information on movement primitive specific stuff, look at the traj_gen examples. Args: env_name: ProMP env_id seed: seed @@ -13,7 +13,7 @@ def example_mp(env_name, seed=1, render=True): """ # While in this case gym.make() is possible to use as well, we recommend our custom make env function. - env = alr_envs.make(env_name, seed) + env = fancy_gym.make(env_name, seed) returns = 0 obs = env.reset() diff --git a/alr_envs/examples/pd_control_gain_tuning.py b/fancy_gym/examples/pd_control_gain_tuning.py similarity index 94% rename from alr_envs/examples/pd_control_gain_tuning.py rename to fancy_gym/examples/pd_control_gain_tuning.py index 8a74e6a..407bfa1 100644 --- a/alr_envs/examples/pd_control_gain_tuning.py +++ b/fancy_gym/examples/pd_control_gain_tuning.py @@ -1,16 +1,17 @@ from collections import OrderedDict import numpy as np -import alr_envs from matplotlib import pyplot as plt +import fancy_gym + # This might work for some environments, however, please verify either way the correct trajectory information # for your environment are extracted below SEED = 1 env_id = "Reacher5dProMP-v0" -env = alr_envs.make(env_id, seed=SEED, controller_kwargs={'p_gains': 0.05, 'd_gains': 0.05}).env +env = fancy_gym.make(env_id, seed=SEED, controller_kwargs={'p_gains': 0.05, 'd_gains': 0.05}).env env.action_space.seed(SEED) # Plot difference between real trajectory and target MP trajectory diff --git a/alr_envs/meta/README.MD b/fancy_gym/meta/README.MD similarity index 100% rename from alr_envs/meta/README.MD rename to fancy_gym/meta/README.MD diff --git a/alr_envs/meta/__init__.py b/fancy_gym/meta/__init__.py similarity index 93% rename from alr_envs/meta/__init__.py rename to fancy_gym/meta/__init__.py index fcc87cc..04438f4 100644 --- a/alr_envs/meta/__init__.py +++ b/fancy_gym/meta/__init__.py @@ -40,7 +40,7 @@ for _task in _goal_change_envs: register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_goal_change_promp ) ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -55,7 +55,7 @@ for _task in _object_change_envs: kwargs_dict_object_change_promp['name'] = f'metaworld:{_task}' register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_object_change_promp ) ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -81,7 +81,7 @@ for _task in _goal_and_object_change_envs: register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_goal_and_object_change_promp ) ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) @@ -97,7 +97,7 @@ for _task in _goal_and_endeffector_change_envs: register( id=_env_id, - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_goal_and_endeffector_change_promp ) ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) diff --git a/alr_envs/meta/base_metaworld_mp_wrapper.py b/fancy_gym/meta/base_metaworld_mp_wrapper.py similarity index 90% rename from alr_envs/meta/base_metaworld_mp_wrapper.py rename to fancy_gym/meta/base_metaworld_mp_wrapper.py index d2af07d..ae800ff 100644 --- a/alr_envs/meta/base_metaworld_mp_wrapper.py +++ b/fancy_gym/meta/base_metaworld_mp_wrapper.py @@ -3,7 +3,7 @@ from typing import Tuple, Union import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class BaseMetaworldMPWrapper(RawInterfaceWrapper, ABC): diff --git a/alr_envs/meta/goal_change_mp_wrapper.py b/fancy_gym/meta/goal_change_mp_wrapper.py similarity index 94% rename from alr_envs/meta/goal_change_mp_wrapper.py rename to fancy_gym/meta/goal_change_mp_wrapper.py index 5580eae..a8eabb5 100644 --- a/alr_envs/meta/goal_change_mp_wrapper.py +++ b/fancy_gym/meta/goal_change_mp_wrapper.py @@ -1,6 +1,6 @@ import numpy as np -from alr_envs.meta.base_metaworld_mp_wrapper import BaseMetaworldMPWrapper +from fancy_gym.meta.base_metaworld_mp_wrapper import BaseMetaworldMPWrapper class MPWrapper(BaseMetaworldMPWrapper): @@ -10,8 +10,8 @@ class MPWrapper(BaseMetaworldMPWrapper): You can verify this by executing the code below for your environment id and check if the output is non-zero at the same indices. ```python - import alr_envs - env = alr_envs.make(env_id, 1) + import fancy_gym + env = fancy_gym.make(env_id, 1) print(env.reset() - env.reset()) array([ 0. , 0. , 0. , 0. , 0, 0 , 0 , 0. , 0. , 0. , diff --git a/alr_envs/meta/goal_endeffector_change_mp_wrapper.py b/fancy_gym/meta/goal_endeffector_change_mp_wrapper.py similarity index 94% rename from alr_envs/meta/goal_endeffector_change_mp_wrapper.py rename to fancy_gym/meta/goal_endeffector_change_mp_wrapper.py index baa5789..c299597 100644 --- a/alr_envs/meta/goal_endeffector_change_mp_wrapper.py +++ b/fancy_gym/meta/goal_endeffector_change_mp_wrapper.py @@ -1,6 +1,6 @@ import numpy as np -from alr_envs.meta.base_metaworld_mp_wrapper import BaseMetaworldMPWrapper +from fancy_gym.meta.base_metaworld_mp_wrapper import BaseMetaworldMPWrapper class MPWrapper(BaseMetaworldMPWrapper): @@ -10,8 +10,8 @@ class MPWrapper(BaseMetaworldMPWrapper): You can verify this by executing the code below for your environment id and check if the output is non-zero at the same indices. ```python - import alr_envs - env = alr_envs.make(env_id, 1) + import fancy_gym + env = fancy_gym.make(env_id, 1) print(env.reset() - env.reset()) array([ !=0 , !=0 , !=0 , 0. , 0., 0. , 0. , 0. , 0. , 0. , diff --git a/alr_envs/meta/goal_object_change_mp_wrapper.py b/fancy_gym/meta/goal_object_change_mp_wrapper.py similarity index 94% rename from alr_envs/meta/goal_object_change_mp_wrapper.py rename to fancy_gym/meta/goal_object_change_mp_wrapper.py index dcc0777..ae667a6 100644 --- a/alr_envs/meta/goal_object_change_mp_wrapper.py +++ b/fancy_gym/meta/goal_object_change_mp_wrapper.py @@ -1,6 +1,6 @@ import numpy as np -from alr_envs.meta.base_metaworld_mp_wrapper import BaseMetaworldMPWrapper +from fancy_gym.meta.base_metaworld_mp_wrapper import BaseMetaworldMPWrapper class MPWrapper(BaseMetaworldMPWrapper): @@ -10,8 +10,8 @@ class MPWrapper(BaseMetaworldMPWrapper): You can verify this by executing the code below for your environment id and check if the output is non-zero at the same indices. ```python - import alr_envs - env = alr_envs.make(env_id, 1) + import fancy_gym + env = fancy_gym.make(env_id, 1) print(env.reset() - env.reset()) array([ 0. , 0. , 0. , 0. , !=0, !=0 , !=0 , 0. , 0. , 0. , diff --git a/alr_envs/meta/object_change_mp_wrapper.py b/fancy_gym/meta/object_change_mp_wrapper.py similarity index 94% rename from alr_envs/meta/object_change_mp_wrapper.py rename to fancy_gym/meta/object_change_mp_wrapper.py index f2daec7..6faecc9 100644 --- a/alr_envs/meta/object_change_mp_wrapper.py +++ b/fancy_gym/meta/object_change_mp_wrapper.py @@ -1,6 +1,6 @@ import numpy as np -from alr_envs.meta.base_metaworld_mp_wrapper import BaseMetaworldMPWrapper +from fancy_gym.meta.base_metaworld_mp_wrapper import BaseMetaworldMPWrapper class MPWrapper(BaseMetaworldMPWrapper): @@ -10,8 +10,8 @@ class MPWrapper(BaseMetaworldMPWrapper): You can verify this by executing the code below for your environment id and check if the output is non-zero at the same indices. ```python - import alr_envs - env = alr_envs.make(env_id, 1) + import fancy_gym + env = fancy_gym.make(env_id, 1) print(env.reset() - env.reset()) array([ 0. , 0. , 0. , 0. , !=0 , !=0 , !=0 , 0. , 0. , 0. , diff --git a/alr_envs/open_ai/README.MD b/fancy_gym/open_ai/README.MD similarity index 100% rename from alr_envs/open_ai/README.MD rename to fancy_gym/open_ai/README.MD diff --git a/alr_envs/open_ai/__init__.py b/fancy_gym/open_ai/__init__.py similarity index 77% rename from alr_envs/open_ai/__init__.py rename to fancy_gym/open_ai/__init__.py index 4542aae..3e0b770 100644 --- a/alr_envs/open_ai/__init__.py +++ b/fancy_gym/open_ai/__init__.py @@ -1,10 +1,11 @@ -from gym import register from copy import deepcopy +from gym import register + from . import mujoco from .deprecated_needs_gym_robotics import robotics -ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS = {"DMP": [], "ProMP": []} +ALL_GYM_MOVEMENT_PRIMITIVE_ENVIRONMENTS = {"DMP": [], "ProMP": []} DEFAULT_BB_DICT_ProMP = { "name": 'EnvName', @@ -35,17 +36,17 @@ kwargs_dict_reacher_promp['name'] = "Reacher-v2" kwargs_dict_reacher_promp['wrappers'].append(mujoco.reacher_v2.MPWrapper) register( id='ReacherProMP-v2', - entry_point='alr_envs.utils.make_env_helpers:make_bb_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_bb_env_helper', kwargs=kwargs_dict_reacher_promp ) -ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append("ReacherProMP-v2") +ALL_GYM_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append("ReacherProMP-v2") """ The Fetch environments are not supported by gym anymore. A new repository (gym_robotics) is supporting the environments. However, the usage and so on needs to be checked register( id='FetchSlideDenseProMP-v1', - entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_promp_env_helper', kwargs={ "name": "gym.envs.robotics:FetchSlideDense-v1", "wrappers": [FlattenObservation, robotics.fetch.MPWrapper], @@ -59,11 +60,11 @@ register( } } ) -ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append("FetchSlideDenseProMP-v1") +ALL_GYM_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append("FetchSlideDenseProMP-v1") register( id='FetchSlideProMP-v1', - entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_promp_env_helper', kwargs={ "name": "gym.envs.robotics:FetchSlide-v1", "wrappers": [FlattenObservation, robotics.fetch.MPWrapper], @@ -77,11 +78,11 @@ register( } } ) -ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append("FetchSlideProMP-v1") +ALL_GYM_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append("FetchSlideProMP-v1") register( id='FetchReachDenseProMP-v1', - entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_promp_env_helper', kwargs={ "name": "gym.envs.robotics:FetchReachDense-v1", "wrappers": [FlattenObservation, robotics.fetch.MPWrapper], @@ -95,11 +96,11 @@ register( } } ) -ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append("FetchReachDenseProMP-v1") +ALL_GYM_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append("FetchReachDenseProMP-v1") register( id='FetchReachProMP-v1', - entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper', + entry_point='fancy_gym.utils.make_env_helpers:make_promp_env_helper', kwargs={ "name": "gym.envs.robotics:FetchReach-v1", "wrappers": [FlattenObservation, robotics.fetch.MPWrapper], @@ -113,5 +114,5 @@ register( } } ) -ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append("FetchReachProMP-v1") +ALL_GYM_MOVEMENT_PRIMITIVE_ENVIRONMENTS["ProMP"].append("FetchReachProMP-v1") """ diff --git a/alr_envs/examples/__init__.py b/fancy_gym/open_ai/deprecated_needs_gym_robotics/__init__.py similarity index 100% rename from alr_envs/examples/__init__.py rename to fancy_gym/open_ai/deprecated_needs_gym_robotics/__init__.py diff --git a/alr_envs/open_ai/deprecated_needs_gym_robotics/robotics/__init__.py b/fancy_gym/open_ai/deprecated_needs_gym_robotics/robotics/__init__.py similarity index 100% rename from alr_envs/open_ai/deprecated_needs_gym_robotics/robotics/__init__.py rename to fancy_gym/open_ai/deprecated_needs_gym_robotics/robotics/__init__.py diff --git a/alr_envs/open_ai/deprecated_needs_gym_robotics/robotics/fetch/__init__.py b/fancy_gym/open_ai/deprecated_needs_gym_robotics/robotics/fetch/__init__.py similarity index 100% rename from alr_envs/open_ai/deprecated_needs_gym_robotics/robotics/fetch/__init__.py rename to fancy_gym/open_ai/deprecated_needs_gym_robotics/robotics/fetch/__init__.py diff --git a/alr_envs/open_ai/deprecated_needs_gym_robotics/robotics/fetch/mp_wrapper.py b/fancy_gym/open_ai/deprecated_needs_gym_robotics/robotics/fetch/mp_wrapper.py similarity index 96% rename from alr_envs/open_ai/deprecated_needs_gym_robotics/robotics/fetch/mp_wrapper.py rename to fancy_gym/open_ai/deprecated_needs_gym_robotics/robotics/fetch/mp_wrapper.py index 331aa40..e96698a 100644 --- a/alr_envs/open_ai/deprecated_needs_gym_robotics/robotics/fetch/mp_wrapper.py +++ b/fancy_gym/open_ai/deprecated_needs_gym_robotics/robotics/fetch/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Union import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/open_ai/mujoco/__init__.py b/fancy_gym/open_ai/mujoco/__init__.py similarity index 100% rename from alr_envs/open_ai/mujoco/__init__.py rename to fancy_gym/open_ai/mujoco/__init__.py diff --git a/alr_envs/open_ai/mujoco/reacher_v2/__init__.py b/fancy_gym/open_ai/mujoco/reacher_v2/__init__.py similarity index 100% rename from alr_envs/open_ai/mujoco/reacher_v2/__init__.py rename to fancy_gym/open_ai/mujoco/reacher_v2/__init__.py diff --git a/alr_envs/open_ai/mujoco/reacher_v2/mp_wrapper.py b/fancy_gym/open_ai/mujoco/reacher_v2/mp_wrapper.py similarity index 89% rename from alr_envs/open_ai/mujoco/reacher_v2/mp_wrapper.py rename to fancy_gym/open_ai/mujoco/reacher_v2/mp_wrapper.py index 5833f6c..b2fa04c 100644 --- a/alr_envs/open_ai/mujoco/reacher_v2/mp_wrapper.py +++ b/fancy_gym/open_ai/mujoco/reacher_v2/mp_wrapper.py @@ -2,7 +2,7 @@ from typing import Union import numpy as np -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper class MPWrapper(RawInterfaceWrapper): diff --git a/alr_envs/utils/__init__.py b/fancy_gym/utils/__init__.py similarity index 100% rename from alr_envs/utils/__init__.py rename to fancy_gym/utils/__init__.py diff --git a/alr_envs/utils/make_env_helpers.py b/fancy_gym/utils/make_env_helpers.py similarity index 94% rename from alr_envs/utils/make_env_helpers.py rename to fancy_gym/utils/make_env_helpers.py index f88cfcc..0f832ae 100644 --- a/alr_envs/utils/make_env_helpers.py +++ b/fancy_gym/utils/make_env_helpers.py @@ -21,15 +21,15 @@ except Exception: # catch Exception due to Mujoco-py pass -import alr_envs -from alr_envs.black_box.black_box_wrapper import BlackBoxWrapper -from alr_envs.black_box.factory.basis_generator_factory import get_basis_generator -from alr_envs.black_box.factory.controller_factory import get_controller -from alr_envs.black_box.factory.phase_generator_factory import get_phase_generator -from alr_envs.black_box.factory.trajectory_generator_factory import get_trajectory_generator -from alr_envs.black_box.raw_interface_wrapper import RawInterfaceWrapper -from alr_envs.utils.time_aware_observation import TimeAwareObservation -from alr_envs.utils.utils import nested_update +import fancy_gym +from fancy_gym.black_box.black_box_wrapper import BlackBoxWrapper +from fancy_gym.black_box.factory.basis_generator_factory import get_basis_generator +from fancy_gym.black_box.factory.controller_factory import get_controller +from fancy_gym.black_box.factory.phase_generator_factory import get_phase_generator +from fancy_gym.black_box.factory.trajectory_generator_factory import get_trajectory_generator +from fancy_gym.black_box.raw_interface_wrapper import RawInterfaceWrapper +from fancy_gym.utils.time_aware_observation import TimeAwareObservation +from fancy_gym.utils.utils import nested_update def make_rank(env_id: str, seed: int, rank: int = 0, return_callable=True, **kwargs): @@ -264,7 +264,7 @@ def make_dmc( register( id=gym_id, - entry_point='alr_envs.dmc.dmc_wrapper:DMCWrapper', + entry_point='fancy_gym.dmc.dmc_wrapper:DMCWrapper', kwargs={'env': lambda: env}, max_episode_steps=max_episode_steps, ) @@ -316,7 +316,7 @@ def make_gym(env_id, seed, **kwargs): kwargs = all_kwargs # Add seed to kwargs for bb environments to pass seed to step environments - all_bb_envs = sum(alr_envs.ALL_MOVEMENT_PRIMITIVE_ENVIRONMENTS.values(), []) + all_bb_envs = sum(fancy_gym.ALL_MOVEMENT_PRIMITIVE_ENVIRONMENTS.values(), []) if env_id in all_bb_envs: kwargs.update({"seed": seed}) diff --git a/alr_envs/utils/time_aware_observation.py b/fancy_gym/utils/time_aware_observation.py similarity index 99% rename from alr_envs/utils/time_aware_observation.py rename to fancy_gym/utils/time_aware_observation.py index 92a7e9d..4fa0d74 100644 --- a/alr_envs/utils/time_aware_observation.py +++ b/fancy_gym/utils/time_aware_observation.py @@ -5,9 +5,8 @@ Copyright (c) 2016 OpenAI (https://openai.com) Wrapper for adding time aware observations to environment observation. """ -import numpy as np - import gym +import numpy as np from gym.spaces import Box diff --git a/alr_envs/utils/utils.py b/fancy_gym/utils/utils.py similarity index 100% rename from alr_envs/utils/utils.py rename to fancy_gym/utils/utils.py diff --git a/setup.py b/setup.py index 92d7225..b8627dc 100644 --- a/setup.py +++ b/setup.py @@ -29,15 +29,15 @@ setup( install_requires=[ 'gym>=0.24.0', ], - packages=[package for package in find_packages() if package.startswith("alr_envs")], - # packages=['alr_envs', 'alr_envs.envs', 'alr_envs.open_ai', 'alr_envs.dmc', 'alr_envs.meta', 'alr_envs.utils'], + packages=[package for package in find_packages() if package.startswith("fancy_gym")], + # packages=['fancy_gym', 'fancy_gym.envs', 'fancy_gym.open_ai', 'fancy_gym.dmc', 'fancy_gym.meta', 'fancy_gym.utils'], package_data={ - "alr_envs": [ + "fancy_gym": [ "envs/mujoco/*/assets/*.xml", ] }, python_requires=">=3.6", - url='https://github.com/ALRhub/alr_envs/', + url='https://github.com/ALRhub/fancy_gym/', # license='AGPL-3.0 license', author_email='', description='Simple Gym: Aggregating interface for various RL environments with support for Black Box approaches.' diff --git a/test/test_custom.py b/test/test_custom.py index c3d71f8..65633f8 100644 --- a/test/test_custom.py +++ b/test/test_custom.py @@ -3,11 +3,11 @@ import unittest import gym import numpy as np -import alr_envs # noqa -from alr_envs.utils.make_env_helpers import make +import fancy_gym # noqa +from fancy_gym.utils.make_env_helpers import make CUSTOM_IDS = [spec.id for spec in gym.envs.registry.all() if - "alr_envs" in spec.entry_point and 'make_bb_env_helper' not in spec.entry_point] + "fancy_gym" in spec.entry_point and 'make_bb_env_helper' not in spec.entry_point] SEED = 1 @@ -101,7 +101,7 @@ class TestCustomEnvironments(unittest.TestCase): def test_bb_functionality(self): """Tests that black box environments run without errors using random actions.""" - for traj_gen, env_ids in alr_envs.ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): + for traj_gen, env_ids in fancy_gym.ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): with self.subTest(msg=traj_gen): for id in env_ids: with self.subTest(msg=id): @@ -109,7 +109,7 @@ class TestCustomEnvironments(unittest.TestCase): def test_bb_determinism(self): """Tests that for black box environment identical seeds produce identical trajectories.""" - for traj_gen, env_ids in alr_envs.ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): + for traj_gen, env_ids in fancy_gym.ALL_ALR_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): with self.subTest(msg=traj_gen): self._run_env_determinism(env_ids) diff --git a/test/test_dmc.py b/test/test_dmc.py index 4a67ecd..0800a67 100644 --- a/test/test_dmc.py +++ b/test/test_dmc.py @@ -2,11 +2,10 @@ import unittest import gym import numpy as np - from dm_control import suite, manipulation -import alr_envs -from alr_envs import make +import fancy_gym +from fancy_gym import make SUITE_IDS = [f'dmc:{env}-{task}' for env, task in suite.ALL_TASKS if env != "lqr"] MANIPULATION_IDS = [f'dmc:manipulation-{task}' for task in manipulation.ALL if task.endswith('_features')] @@ -114,7 +113,7 @@ class TestDMCEnvironments(unittest.TestCase): def test_bb_functionality(self): """Tests that black box environments run without errors using random actions.""" - for traj_gen, env_ids in alr_envs.ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): + for traj_gen, env_ids in fancy_gym.ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): with self.subTest(msg=traj_gen): for id in env_ids: with self.subTest(msg=id): @@ -122,7 +121,7 @@ class TestDMCEnvironments(unittest.TestCase): def test_bb_determinism(self): """Tests that for black box environment identical seeds produce identical trajectories.""" - for traj_gen, env_ids in alr_envs.ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): + for traj_gen, env_ids in fancy_gym.ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): with self.subTest(msg=traj_gen): self._run_env_determinism(env_ids) diff --git a/test/test_gym.py b/test/test_gym.py index 4aff70d..c8252d0 100644 --- a/test/test_gym.py +++ b/test/test_gym.py @@ -3,11 +3,11 @@ import unittest import gym import numpy as np -import alr_envs -from alr_envs import make +import fancy_gym +from fancy_gym import make GYM_IDS = [spec.id for spec in gym.envs.registry.all() if - "alr_envs" not in spec.entry_point and 'make_bb_env_helper' not in spec.entry_point] + "fancy_gym" not in spec.entry_point and 'make_bb_env_helper' not in spec.entry_point] SEED = 1 @@ -101,7 +101,7 @@ class TestGymEnvironments(unittest.TestCase): def test_bb_functionality(self): """Tests that black box environments run without errors using random actions.""" - for traj_gen, env_ids in alr_envs.ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS.items(): + for traj_gen, env_ids in fancy_gym.ALL_GYM_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): with self.subTest(msg=traj_gen): for id in env_ids: with self.subTest(msg=id): @@ -109,7 +109,7 @@ class TestGymEnvironments(unittest.TestCase): def test_bb_determinism(self): """Tests that for black box environment identical seeds produce identical trajectories.""" - for traj_gen, env_ids in alr_envs.ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS.items(): + for traj_gen, env_ids in fancy_gym.ALL_GYM_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): with self.subTest(msg=traj_gen): self._run_env_determinism(env_ids) diff --git a/test/test_metaworld.py b/test/test_metaworld.py index 2f7af22..f10d54a 100644 --- a/test/test_metaworld.py +++ b/test/test_metaworld.py @@ -2,11 +2,11 @@ import unittest import gym import numpy as np - -import alr_envs -from alr_envs import make from metaworld.envs import ALL_V2_ENVIRONMENTS_GOAL_OBSERVABLE +import fancy_gym +from fancy_gym import make + METAWORLD_IDS = [f'metaworld:{env.split("-goal-observable")[0]}' for env, _ in ALL_V2_ENVIRONMENTS_GOAL_OBSERVABLE.items()] SEED = 1 @@ -102,7 +102,7 @@ class TestMetaWorldEnvironments(unittest.TestCase): def test_bb_functionality(self): """Tests that black box environments run without errors using random actions.""" - for traj_gen, env_ids in alr_envs.ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): + for traj_gen, env_ids in fancy_gym.ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): with self.subTest(msg=traj_gen): for id in env_ids: with self.subTest(msg=id): @@ -110,7 +110,7 @@ class TestMetaWorldEnvironments(unittest.TestCase): def test_bb_determinism(self): """Tests that for black box environment identical seeds produce identical trajectories.""" - for traj_gen, env_ids in alr_envs.ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): + for traj_gen, env_ids in fancy_gym.ALL_METAWORLD_MOVEMENT_PRIMITIVE_ENVIRONMENTS.items(): with self.subTest(msg=traj_gen): self._run_env_determinism(env_ids)