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

Large Scene support + DoF locking #7

Open
yuvaltassa opened this issue Oct 18, 2021 · 8 comments
Open

Large Scene support + DoF locking #7

yuvaltassa opened this issue Oct 18, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@yuvaltassa
Copy link
Collaborator

Currently there is no mechanism in MuJoCo for locking (a.k.a, sleeping, freezing) degrees-of-freedom. This is important for e.g. simulating large scenes.

This could be implemented either at the level of joints, or at the level of subtrees (children of the world body).

@yuvaltassa yuvaltassa added the enhancement New feature or request label Oct 18, 2021
@venkataarikatlaagility
Copy link

@yuvaltassa are there any updates on this feature? If not, do you have any suggestions on the best way to go about it?

@yuvaltassa
Copy link
Collaborator Author

Yes and no.

Very generally, MuJoCo was designed to simulate medium sized scenes, so handling of large scenes can be improved in many ways, and large scenes are indeed one of our top priorities. We've already made changes and have several more coming soon that will reduce and eventually eliminate quadratic memory allocation in mjData (MuJoCo uses sparse math, but in some important places assumes for convenience that dense memory is available). This will enable the most basic of all large-scene features: fit the scene in memory 🤠

Following this, a very low hanging fruit which we intend to work on soon is MuJoCo's inefficient broadphase collision detection, which prunes far too few narrowphase calls. This leads to a large unnecessary slowdown, yet is not hard to improve.

Only after these steps are complete does it make sense to move towards the two features required for actual large scenes: dof freezing and parallel handling of contact islands (cliques of contacts and dofs). There are many decisions to make here and different possible approaches, and these will take time to figure out.

In terms of timeline, I can say that the features described in the first two paragraphs are planned for 2023. It is fair to hope that the detailed design of the dof freezing and contact islands will also happen, but it's hard to imagine the implementation being completed this year.

I hope this makes sense.

@venkataarikatlaagility
Copy link

It's good to hear that this is part of your plans. Looking forward to the improvements.

@peterdavidfagan
Copy link
Contributor

+1 on this feature, it would be nice to have the option to lock and unlock joints for tuning actuators.

@gedalia
Copy link

gedalia commented Apr 8, 2024

+1 as well, we're looking at supporting larger worlds and wondering what the best options are, being able to pause physics on idle areas of the scene till they are disturbed would go along way to helping our performance goals.

@yuvaltassa
Copy link
Collaborator Author

There are two potential variants of dof sleeping:

  1. Sleep ("lock") individual joints.
  2. Sleep entire world sub-trees (a free body, a whole robot, etc).

Could people comment on whether 2 would be good enough for their purposes or if they really need 1?

@gedalia
Copy link

gedalia commented Apr 8, 2024

I think 2 would work for us. I guess it depends on how flexible it is. But at the very least it would allow us to build a sim where we had a decent number of objects where we aren't always interacting with everything.

@peterdavidfagan
Copy link
Contributor

peterdavidfagan commented Apr 9, 2024

For my use case, functionality 1. was what I was looking for. With this being said I have subsequently changed strategy a bit, for the most part I have been able to work by building controllers that use the motor actuator model and this seems to work well for what I needed. As a result, I don't personally have an immediate need for 1. but it would be nice to have this flexibility nonetheless.

I also think 2. would be super useful, I haven't progressed to overly complex scenes yet but I can imagine this will be something I may also encounter in future.

No immediate need for either feature right now on my side but I would prefer option 1. due to its generality.

@yuvaltassa yuvaltassa changed the title Degree-of-freedom locking Large Scene support May 14, 2024
@yuvaltassa yuvaltassa changed the title Large Scene support Large Scene support + DoF locking May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants