7
7
import importlib .util
8
8
import urllib .error
9
9
10
- from gym .core import ObsType
11
-
12
10
_has_isaac = importlib .util .find_spec ("isaacgym" ) is not None
13
11
14
12
if _has_isaac :
25
23
from contextlib import nullcontext
26
24
from pathlib import Path
27
25
from sys import platform
28
- from typing import Optional , Tuple , Union
26
+ from typing import Optional , Union
29
27
from unittest import mock
30
28
31
29
import numpy as np
@@ -653,14 +651,17 @@ def __init__(self):
653
651
self .observation_space = gym .spaces .Box (- 1 , 1 )
654
652
655
653
def step (self , action ):
654
+ assert isinstance (action , dict )
655
+ assert isinstance (action ["a0" ], np .ndarray )
656
+ assert isinstance (action ["a1" ], np .ndarray )
656
657
return (0.5 , 0.0 , False , False , {})
657
658
658
659
def reset (
659
660
self ,
660
661
* ,
661
662
seed : Optional [int ] = None ,
662
663
options : Optional [dict ] = None ,
663
- ) -> Tuple [ ObsType , dict ] :
664
+ ):
664
665
return (0.0 , {})
665
666
666
667
env = CompositeActionEnv ()
@@ -686,14 +687,17 @@ def __init__(self):
686
687
self .observation_space = gym .spaces .Box (- 1 , 1 )
687
688
688
689
def step (self , action ):
690
+ assert isinstance (action , dict )
691
+ assert isinstance (action ["a0" ], np .ndarray )
692
+ assert isinstance (action ["a1" ], np .ndarray )
689
693
return (0.5 , 0.0 , False , False , {})
690
694
691
695
def reset (
692
696
self ,
693
697
* ,
694
698
seed : Optional [int ] = None ,
695
699
options : Optional [dict ] = None ,
696
- ) -> Tuple [ ObsType , dict ] :
700
+ ):
697
701
return (0.0 , {})
698
702
699
703
env = CompositeActionEnv ()
0 commit comments