Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The slide property is not rendered in Unity. #2165

Open
2 tasks done
mg638 opened this issue Oct 22, 2024 · 1 comment
Open
2 tasks done

The slide property is not rendered in Unity. #2165

mg638 opened this issue Oct 22, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mg638
Copy link

mg638 commented Oct 22, 2024

Intro

hello. I am working on the mujoco project with Unity. This time, I used a slide in the model, but it came out normally in the simulator, but it was not created properly in Unity, so I would like to inquire.

My setup

3.2.0
Unity 2022.3.4f1

What's happening? What did you expect?

376986195-04cf5639-1202-440d-ab07-65627dcee209
376986183-7f3a8b7a-ecf4-4524-ae31-aed45b1264f4

As shown in the image, the slider is rendered normally in the simulator, but is not rendered in Unity.

Steps for reproduction

The model was imported using import mujoco scene using the Unity plugin.

Minimal model for reproduction

I couldn't reveal all the information about the model, so I only wrote some of it.

			<body name="slider1_dump" pos="0 0 0"  euler="0 0 12">
                    <site name="slider1_origin" pos="0 0 0" size=".001"/>
			<!-- <composite type="cable" curve="s 0 0" count="6 1 1" size="0.51 0.15 0.25" offset="0 0 0" initial="ball" prefix="cable1_">
				<plugin plugin="mujoco.elasticity.cable">
					<config key="twist" value="1e7"/>
					<config key="bend" value="4e6"/>
					<config key="vmax" value="1e-2"/>
				</plugin>
				<joint kind="main" damping=".015"/>
				<geom type="capsule" size=".005" rgba=".8 .2 .1 1" condim="1"/>
			</composite> -->
			</body>
		</body>
		
		<body name="slider2" pos="-0.14 0.15 0.035"  euler="0 0 -90">
			<inertial pos="0 0 0" euler="0 0 0" mass="0.5" diaginertia="0.001 0.001 0.001"/>
			<geom name="slider2_geom" type="box" pos="0 0 0" size="0.02 0.02 0.015" rgba="0. 0. 0.5 1"/>
			<joint name="slide2" type="slide" pos="0 0 0" range="-0.15 0.15" limited="true" axis="1 0 0" damping="0.1"/>
			
			<body name="slider2_dump" pos="0 0 0"  euler="18 0 9">
                    <site name="slider2_origin" pos="0 0 0" size=".001"/>
			<!-- <composite type="cable" curve="s 0 0" count="11 1 1" size="1.05 0.25 0.25" offset="0 0 0" initial="ball" prefix="cable2_">
				<plugin plugin="mujoco.elasticity.cable">
					<config key="twist" value="1e7"/>
					<config key="bend" value="4e6"/>
					<config key="vmax" value="5e-3"/>
				</plugin>
				<joint kind="main" damping=".015"/>
				<geom type="capsule" size=".005" rgba=".8 .2 .1 1" condim="1"/>
			</composite> -->
			</body>
		</body>
		
		<body name="slider3" pos="-0.14 0.15 -0.075"  euler="0 0 -90">
			<inertial pos="0 0 0" euler="0 0 0" mass="0.5" diaginertia="0.001 0.001 0.001"/>
			<geom name="slider3_geom" type="box" pos="0 0 0" size="0.02 0.02 0.015" rgba="0. 0.3 0. 1"/>
			<joint name="slide3" type="slide" pos="0 0 0" range="-0.15 0.15" limited="true" axis="1 0 0" damping="0.1"/>
			
			<body name="slider3_dump" pos="0 0 0"  euler="0 0 12">
                    <site name="slider3_origin" pos="0 0 0" size=".001"/>
			<!-- <composite type="cable" curve="s 0 0" count="6 1 1" size="0.51 0.15 0.25" offset="0 0 0" initial="ball" prefix="cable3_">
				<plugin plugin="mujoco.elasticity.cable">
					<config key="twist" value="1e7"/>
					<config key="bend" value="4e6"/>
					<config key="vmax" value="1e-2"/>
				</plugin>
				<joint kind="main" damping=".015"/>
				<geom type="capsule" size=".005" rgba=".8 .2 .1 1" condim="1"/>
			</composite> -->
			</body>
		</body>
		
		<body name="slider4" pos="-0.14 0.15 -0.035"  euler="0 0 -90">
			<inertial pos="0 0 0" euler="0 0 0" mass="0.5" diaginertia="0.001 0.001 0.001"/>
			<geom name="slider4_geom" type="box" pos="0 0 0" size="0.02 0.02 0.015" rgba="0. 0. 0.5 1"/>
			<joint name="slide4" type="slide" pos="0 0 0" range="-0.15 0.15" limited="true" axis="1 0 0" damping="0.1"/>
			
			<body name="slider4_dump" pos="0 0 0"  euler="-18 0 9">
                    <site name="slider4_origin" pos="0 0 0" size=".001"/>
			<!-- <composite type="cable" curve="s 0 0" count="11 1 1" size="1.05 0.25 0.25" offset="0 0 0" initial="ball" prefix="cable4_">
				<plugin plugin="mujoco.elasticity.cable">
					<config key="twist" value="1e7"/>
					<config key="bend" value="4e6"/>
					<config key="vmax" value="2e-3"/>
				</plugin>
				<joint kind="main" damping=".015"/>
				<geom type="capsule" size=".005" rgba=".8 .2 .1 1" condim="1"/>
			</composite> -->
			</body>
		</body>

...

Code required for reproduction

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

@mg638 mg638 added the bug Something isn't working label Oct 22, 2024
@Balint-H
Copy link
Collaborator

Balint-H commented Nov 4, 2024

Hello, apologies for the delayed response. This is because the Unity package currently does not support the loading of MuJoCo plugins such as elasticity. We have a WIP solution the development of which has been paused for a while, but I'm returning to it. My estimated time to finish it is the end of November.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants