dojo-sim / Dojo.jl

A differentiable physics engine for robotics
MIT License
294 stars 25 forks source link

Multiple mechanisms in one simulation #75

Open MrstupidJ opened 1 year ago

MrstupidJ commented 1 year ago

Hi,

Just wonder if it is possible to have multiple mechanisms in one simulation so that we can simulate multiple robots or some simple tasks like pick up and place items. A short example would be much appreciated, thanks for your help!

Cheers!

janbruedigam commented 1 year ago

You can manually create a single Mechanism with multiple sub-mechanisms simply by connecting all of them to the same origin. Parsing of multiple URDF files at once is currently not supported, but would be a nice feature that shouldn't be too difficult to implement. Feel free to create a pull request. Manually you would parse the URDF files individually, and replace the joints connecting each mechanism to their origin with the same joint type to a single origin.

Kevin-ZhangClutchit commented 11 months ago

Hi @janbruedigam , thanks for the hints provided here. But may I ask what do you means by "connecting" here, suppose I use the panda mechanism and cartpole mechanism, do I just add all the cartpole parts to the end of the panda body,joints,contacts vector while setting the origin as the same of panda?

janbruedigam commented 11 months ago

Yes, that should work