legged_gym icon indicating copy to clipboard operation
legged_gym copied to clipboard

Fail to support different envs

Open lingxiao-guo opened this issue 1 year ago • 5 comments

Hello! I am currently attempting to train robots in different environments using a set of networks, but I have encountered an issue where it seems that isaacgym does not support creating more than one environment. The following code and error message provide a brief explanation:

def train(args):
    env, env_cfg = task_registry.make_env(name=args.task, args=args) # args.task = 'anymal_c_flat'
    args_ = copy.deepcopy(args)
    args_.task = 'cassie'
    env_, env_cfg_ = task_registry.make_env(name=args_.task, args=args_)

And after running it, the console shows:

/buildAgent/work/99bede84aa0a52c2/source/foundation/FdFoundation.cpp (166) : invalid operation : Foundation object exists already. Only one instance per process can be created.

lingxiao-guo avatar Jul 13 '23 11:07 lingxiao-guo

@glx15534565855 Were you able to create the new env? I am also working on that.

dipampatel18 avatar Dec 10 '23 02:12 dipampatel18

Yes I solved it. Using  gym.create_actor() instead of create_env. Check the docs/index.html located in your isaacgym packages for detailed usage. Also you can find the usage in the example "actor_scaling.py" in the docs.

Hope that helps

------------------ 原始邮件 ------------------ 发件人: "leggedrobotics/legged_gym" @.>; 发送时间: 2023年12月10日(星期天) 上午10:33 @.>; @.@.>; 主题: Re: [leggedrobotics/legged_gym] Fail to support different envs (Issue #46)

@glx15534565855 Were you able to create the new env? I am also working on that.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

lingxiao-guo avatar Dec 10 '23 11:12 lingxiao-guo

@glx15534565855 Thanks a lot for your issue, I have met the same problem. How do you solve it? For example, if I hope to create two environments 'anymal_c_flat' and 'cassie', how can I achieve it?

yingchengyang avatar Mar 25 '24 06:03 yingchengyang

@glx15534565855 Thanks a lot for your issue, I have met the same problem. How do you solve it? For example, if I hope to create two environments 'anymal_c_flat' and 'cassie', how can I achieve it?

@yingchengyang Have you solved the issue? I guess the solution by @glx15534565855 means diving into the lower level of code and creating multiple heterogenous actors (and before that, envs) in a single sim. But to my knowledge, envs in a single sim can only take steps simultaneously. Do you have any idea if I want to specify which env to step?

yaocj97 avatar Jun 14 '24 13:06 yaocj97

No, I have not solved this problem. I would appreciate a lot if you have any ideas.

yingchengyang avatar Jun 15 '24 04:06 yingchengyang