@@ -104,10 +104,12 @@ def step(self, action: dict[str, Any]) -> tuple[dict[str, Any], float, bool, boo
104104 return obs , 0.0 , False , bool (truncated ), info
105105
106106 def reset (
107- self , seed : dict [str , int | None ] | None = None , options : dict [str , Any ] | None = None # type: ignore
107+ self ,
108+ seed : dict [str , int | None ] | None = None ,
109+ options : dict [str , Any ] | None = None , # type: ignore
108110 ) -> tuple [dict [str , Any ], dict [str , Any ]]:
109111 if seed is None :
110- seed = { key : None for key in self .env .envs }
112+ seed = dict . fromkeys ( self .env .envs )
111113 if options is None :
112114 options = {key : {} for key in self .env .envs }
113115 obs = {}
@@ -196,7 +198,6 @@ def __init__(
196198 self .sim .open_gui ()
197199
198200 def step (self , action : dict [str , Any ]) -> tuple [dict [str , Any ], SupportsFloat , bool , bool , dict [str , Any ]]:
199-
200201 self .collision_env .get_wrapper_attr ("robot" ).set_joints_hard (self .unwrapped .robot .get_joint_position ())
201202 _ , _ , _ , _ , info = self .collision_env .step (action )
202203
@@ -219,7 +220,7 @@ def step(self, action: dict[str, Any]) -> tuple[dict[str, Any], SupportsFloat, b
219220 return obs , reward , done , truncated , info
220221
221222 def reset (
222- self , seed : int | None = None , options : dict [str , Any ] | None = None
223+ self , * , seed : int | None = None , options : dict [str , Any ] | None = None
223224 ) -> tuple [dict [str , Any ], dict [str , Any ]]:
224225 # check if move to home is collision free
225226 if self .check_home_collision :
@@ -333,7 +334,7 @@ def __init__(
333334 self .y_offset = y_offset
334335
335336 def reset (
336- self , seed : int | None = None , options : dict [str , Any ] | None = None
337+ self , * , seed : int | None = None , options : dict [str , Any ] | None = None
337338 ) -> tuple [dict [str , Any ], dict [str , Any ]]:
338339 if options is not None and "RandomObjectPos.init_object_pose" in options :
339340 assert isinstance (
@@ -381,7 +382,7 @@ def __init__(self, env: gym.Env, simulation: sim.Sim, include_rotation: bool = F
381382 self .cube_joint_name = cube_joint_name
382383
383384 def reset (
384- self , seed : int | None = None , options : dict [str , Any ] | None = None
385+ self , * , seed : int | None = None , options : dict [str , Any ] | None = None
385386 ) -> tuple [dict [str , Any ], dict [str , Any ]]:
386387 obs , info = super ().reset (seed = seed , options = options )
387388 self .sim .step (1 )
@@ -456,11 +457,7 @@ def step(self, action: dict[str, Any]):
456457 reward /= 3 # type: ignore
457458 return obs , reward , success , truncated , info
458459
459- def reset (
460- self ,
461- seed : dict [str , int | None ] | None = None ,
462- options : dict [str , Any ] | None = None , # type: ignore
463- ):
460+ def reset (self , * , seed : int | None = None , options : dict [str , Any ] | None = None ):
464461 obs , info = super ().reset ()
465462 self .home_pose = self .unwrapped .robot .get_cartesian_position ()
466463 return obs , info
0 commit comments