Raise exception on invalid env_mode
This commit is contained in:
parent
f102e49581
commit
079225cd1b
@ -25,10 +25,6 @@ class AirHockeyEnv(Environment):
|
|||||||
of position, velocity and acceleration of the shape (20, 3, n_joints)
|
of position, velocity and acceleration of the shape (20, 3, n_joints)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if env_mode == None:
|
|
||||||
print("Please specify one of the environments in [3dof-hit, 3dof-defend, 7dof-hit, 7dof-defend, tournament]")
|
|
||||||
exit()
|
|
||||||
|
|
||||||
env_dict = {
|
env_dict = {
|
||||||
"tournament": position.IiwaPositionTournament,
|
"tournament": position.IiwaPositionTournament,
|
||||||
|
|
||||||
@ -39,6 +35,9 @@ class AirHockeyEnv(Environment):
|
|||||||
"3dof-defend": position.PlanarPositionDefend
|
"3dof-defend": position.PlanarPositionDefend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if env_mode not in env_dict:
|
||||||
|
raise Exception(f"Please specify one of the environments in {list(env_dict.keys())} for env_mode parameter!")
|
||||||
|
|
||||||
if env_mode == "tournament" and type(interpolation_order) != tuple:
|
if env_mode == "tournament" and type(interpolation_order) != tuple:
|
||||||
interpolation_order = (interpolation_order, interpolation_order)
|
interpolation_order = (interpolation_order, interpolation_order)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user