Note
This example is available as a jupyter notebook here.
import ring
import mediapy as media
import jax
from diodem import load_data
sys_str = """
<x_xy>
<worldbody>
<geom dim="0.1" type="xyz"></geom>
<body joint="free" name="seg" pos="0 0 .5">
<geom color="dustin_exp_blue" dim="0.15 0.075 0.05" mass="0.2" pos="0.03 0 0" type="box"></geom>
<body joint="frozen" name="imu" pos="0.0 0.0 0.03">
<geom color="dustin_exp_orange" dim="0.05 0.03 0.02" mass="0.1" type="box"></geom>
</body>
</body>
</worldbody>
</x_xy>
"""
sys = ring.System.create(sys_str)
(X, y), (key, q, x, _) = ring.RCMG(sys, keep_output_extras=True).to_list()[0]
media.show_video(sys.render(x, width=640, height=480, camera="target", render_every_nth=4), fps=25)