Skip to content
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

Does it support multi-drone simulation? #188

Open
Yuan-Mingkang opened this issue Feb 27, 2025 · 3 comments
Open

Does it support multi-drone simulation? #188

Yuan-Mingkang opened this issue Feb 27, 2025 · 3 comments

Comments

@Yuan-Mingkang
Copy link

Hi, I would like to ask if this project supports multiple drone simulations in the same environment. It seems to focus mainly on single drone simulations, is it capable of making modifications for multi-drone simulations?
If so, where would you suggest I start?

@Federico-PizarroBejarano
Copy link
Collaborator

Hi @Yuan-Mingkang, honestly I am unsure how much work it would be to make the gym work for multiple drones. The gym was based on https://github.com/utiasDSL/gym-pybullet-drones, which is specifically made for multiple drones. gym-pybullet-drones may be more suitable for your research, and it should be possible to move code you need from our gym to gym-pybullet-drones. However, in theory I think it should be possible to modify our gym for this, just cannot comment on how much work it would be.

@Yuan-Mingkang
Copy link
Author

Thank you for your reply~ I have worked on modifying your project and am now able to implement multi-drone simulation. I'm using MPC to control the drones, but I'm running into CPU arithmetic issues, no matter how many drones I run, I can only use 2 cores of the CPU, and they all reach 100% load. This situation is causing my simulation to be very choppy, I would like to use multiprocessing, but after my evaluation, the code modifications are very large, do you have any clue? Make the simulation can operate on more CPU cores.

@Federico-PizarroBejarano
Copy link
Collaborator

Hi @Yuan-Mingkang, I'm happy you've got it working so quickly! Unfortunately I am not sure how to add multiprocessing, I am definitely no expert there. I know that pybullet and MPC in general are CPU intensive and somewhat hard to multi-process. Only thing I can think of is forking a new process to handle calculating the next action for each drone, and then stepping the environment with all the actions in the parent process. However, I am not sure how to implement this other than trying multiprocessing.Pool. I'm sorry I can't be of more help, let us know how your multi-drone simulation goes and whether you need any additional help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants