How to implement dynamically-created/destroyed snapping joints #2852
-
IntroHello everybody, My setupMuJoCo 3.2.6, Simulate, Windows 11, Visual Studio 22 C++, Intel Core Ultra 165 w/ NVIDIA RTX graphics. My questionFor doing stable assemblies in a VR maintainance simulator based on ODE, I use to create/destroy a joint linking two bodies whenever assembly/disassembly (breaking) conditions hold (e.g. distance a/o angle b/w the two over/below certain thresholds) - a sort of breakable snaps b/w two bodies to directly manipulate in VR. Minimal model and/or code that explain my questionIf you encountered the issue in a complex model, please simplify it as much as possible (while still reproducing the issue). Model: minimal XML<mujoco>
<worldbody>
<light pos="0 0 1"/>
<geom type="sphere" size="1" rgba="1 0 0 1"/>
</worldbody>
</mujoco>
Code: import mujoco
import mediapy as media
model = mujoco.MjModel.from_xml_string(xml)
data = mujoco.MjData(model)
with mujoco.Renderer(model) as renderer:
mujoco.mj_forward(model, data)
renderer.update_scene(data)
media.show_image(renderer.render())Confirmations
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
This seems a suitable answer to my question:
https://stackoverflow.com/questions/72171510/is-there-a-convenient-way-to-dynamically-create-constraints-between-two-bodies-i#:~:text=Equality%20constraints%20have%20an%20eq_active,1692