Replies: 1 comment
-
I believe the cfgs are supposed to be members of the TableTop scene cfg class. For me, something like the following worked class TableTopSceneCfg(InteractiveSceneCfg):
def __init__(*args, **kwargs):
super().__init__(*args, **kwargs)
self.dome_light = AssetBaseCfg(...)
self.ground = AssetBaseCfg(...)
# collect all configs
sphere_cfgs = {}
for i in range(N):
sphere_cfgs[f"sphere_{i}"] = AssetBaseCfg(...)
# set the cfgs as members of the class
for k, v in sphere_cfgs.items():
self.__setattr__(k, v) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
I'm trying to spawn multiple assets in one environment. I was following the tutorial and looked at some example codes of Orbit using the following structure:
What I need would be, for example, to spawn multiple spheres in one environment with different positions, rotations, and so on. With the configclass above I added several spheres into the environment with:
where I repeated the snippet above and manually specified the index
i
. But spawning assets this way is highly inefficient and easy to make mistakes. So I tried to initialize a list before setting up the class and assign assets for each element in the list:But this will cause an error:
It is the same even if I do:
before passing the list into the configclass.
I'm writing to ask if there is a proper way to automatically spawn multiple assets in one environment. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions