fix: allow users to set agents' collision groups by depth#712
Conversation
|
Thank you for the contribution. This is simply default behavior to ensure no adjacent links can ever collide. That being said for more complex articulations with a ton of links in sequence we may want to disable the option for setting collision bits automatically and require the user to custom define a more efficient collision disabling setup I think the 32 maximum is a limitation of physx however, @fbxiang any way to increase it or would one have to combine more links into the same collision groups? |
|
For now, I think we should add the error being thrown at load time or just stop adding collision points after 32. Since allowing this invalid state leads to a lot of confusion later on. |
|
Actually there is a better fix that should be done. Namely adjacent links always have collisions disabled in physx anyway. The mjcf loader should just check if the links are physically adjacent or not (whether they have collision meshes, since some links are dummy links). For links that are adjacent in terms of Mujoco (since mujoco supports link + many joints to another link), we should disable collisions if there are more than one joint. The collision group bits maxing out at 32 is a limitation of the physx simulation backend. For a more efficient collision disabling setup I will add documentation soon about how e.g. the G1 humanoid robot is modelled for efficiency. |
.mjcffile,ActorBuilder.collision_groups[2]is greater thanActorBuilder.collision_groupsto beuint32uint32.mjcf, rather than later.mjcfso there are less collision groupsgroup_collisions_by_depth = Truein the agent class