This commit is contained in:
Fabian
2022-07-07 10:47:04 +02:00
parent 4a3134d7be
commit fc00cf8a87
24 changed files with 235 additions and 302 deletions
@@ -0,0 +1,21 @@
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
ALL_TYPES = ["motor", "velocity", "position", "metaworld"]
def get_controller(controller_type: str, **kwargs):
controller_type = controller_type.lower()
if controller_type == "motor":
return PDController(**kwargs)
elif controller_type == "velocity":
return VelController()
elif controller_type == "position":
return PosController()
elif controller_type == "metaworld":
return MetaWorldController()
else:
raise ValueError(f"Specified controller type {controller_type} not supported, "
f"please choose one of {ALL_TYPES}.")