rohanpsingh / mc_mujoco

MuJoCo interface for mc-rtc
https://arxiv.org/abs/2209.00274
BSD 2-Clause "Simplified" License
77 stars 18 forks source link

set contype and conaffinity to 0 for floors in robot XML #10

Closed rohanpsingh closed 2 years ago

rohanpsingh commented 2 years ago

@gergondet How about this solution to the issue of multiple floors being loaded (mentioned here: https://github.com/isri-aist/hrp5p_mj_description/pull/3)? I think setting disabling collision detection for the floor inside of robot XML should not impact the simulation speed.

gergondet commented 2 years ago

Hi @rohanpsingh

I don't like too much that the name of the robot and the name of the body are hard-coded. Furthermore this would break if you are using an environment that has its own ground but not using the ground environment.

I think setting disabling collision detection for the floor inside of robot XML should not impact the simulation speed.

You can try with this controller with and without your patch (with a ground included in the JVRC1 model): https://github.com/gergondet/multi_robot_sample

It pops 5 robots and you should notice a difference without your patch when the ground is included in the robot model

rohanpsingh commented 2 years ago

I don't like too much that the name of the robot and the name of the body are hard-coded.

That makes sense, but the only constraint it places on the user is that the floor geom in robot XML should be named "floor". The robot name comes from mc-rtc so perhaps that won't be a problem? Or maybe what we can do it to disable collision with any or all geoms attached to the world body.

It pops 5 robots and you should notice a difference without your patch when the ground is included in the robot model

I tried MultiRobot but in my environment, it is extremely slow even if 1 floor is loaded (as far as I can see). Why is that happening?

rohanpsingh commented 2 years ago

If this doesn't work, I like your solution too:

What we can do is:

have a model without the ground that we give to mc_mujoco have a model with the ground for other uses with the tag this can be achieved easily

gergondet commented 2 years ago

I tried MultiRobot but in my environment, it is extremely slow even if 1 floor is loaded (as far as I can see). Why is that happening?

You can try without the controller but the extra robots put some load on everything

The robot name comes from mc-rtc so perhaps that won't be a problem?

The body name is the lesser problem (it can be ok to document this behavior). The biggest issue is that it could be surprising that your "ground" body in a different environment (not env/ground) is filtered out because of this...

I like your solution too:

Yes. I think this is less surprising.

rohanpsingh commented 2 years ago

OK, this PR was a bad idea and must not be merged. The better solution is to have a separate robot model XML with the ground model.