-
Notifications
You must be signed in to change notification settings - Fork 724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Converting an existing gazebo environment into vectorized environment #831
Comments
The built-in VecEnvs only support launching multiple instances of the same environment. You have to modify the Gazebo environment to include multiple robots to gather data, and then implement a VecEnv wrapper that correctly handles this data (pretends to be multiple environments, but in reality just passes on the data from a single environment with multiple agents). Unity ML Agents repository could give some tips on how to do the former, as they "parallelize" learning in Unity environment in a similar fashion. |
Thank you so much for your quick response. I will look into that. |
Is this what you want?
|
No @ChengYen-Tang , I have a Gazebo environment, and I have step, get_obs, reset etc. functions defined for a single agent in the environment. I tried training a single agent with PPO, but the training process is too slow, I need to run multiple agents to speed up the training. Now I cannot launch multiple Gazebo instances as Gazebo needs a good amount of memory, so I want to launch multiple robot instances in a single Gazebo environment. I am not exactly sure how I can do that. Do I need to define the methods of VecEnv class? If yes it would be great if you can point me to some example code if someone has tried to do the same. I am going through Unity ML Agents but still it is not clear. Thanks for looking into the issue. |
Take in consideration that, depending of the robot you're using, the simulation in Gazebo could become a bottleneck. In other words, when multiple robots are part of the simulation, the RTF of Gazebo could drop significantly since after all the |
Thank you @diegoferigo I will consider that. |
@utsavpatel22 Hey there, have you managed to define this kind of vectorized environment with multiple robots in a single gazebo environment? If yes, how does it work? Can you share some code, or tips please? I am trying to do the same thing. |
I am trying to train a mobile robot using stable baselines. I have created a custom environment so stable baselines can be used to train the robot. Now the issues is if I just use a single agent then the training process takes a lot of time. I am trying to vectorize the environment but I could not find any detailed documentation on that. I cannot launch multiple gazebo instances as each takes a lot of computational resources. I want to launch multiple robots in a single gazebo environment and train them parallelly. Does anyone have any experience with this?
The text was updated successfully, but these errors were encountered: