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

自定义的xml 文件不在仿真环境显示 #548

Open
flyme45 opened this issue Jan 12, 2025 · 4 comments · May be fixed by #553
Open

自定义的xml 文件不在仿真环境显示 #548

flyme45 opened this issue Jan 12, 2025 · 4 comments · May be fixed by #553

Comments

@flyme45
Copy link

flyme45 commented Jan 12, 2025

my xml can be displayed in mujoco but not in genesis.
but i can see the Coordinate axis of every links in genesis
截图 2025-01-12 23-29-44
cu1tuv54335aig467u9g

this is my xml:
`



<asset>
    <texture type="skybox" builtin="gradient" rgb1="0.3 0.5 0.7" rgb2="0 0 0" width="512" height="512" />
    <texture name="texplane" type="2d" builtin="checker" rgb1=".2 .3 .4" rgb2=".1 0.15 0.2" width="512" height="512" mark="cross" markrgb=".8 .8 .8" />

    <material name="matplane" reflectance="0.3" texture="texplane" texrepeat="1 1" texuniform="true" />
    
    <mesh file="path/to/your/stl/file.stl"/>
</asset>

<worldbody>
    <light directional="true" diffuse=".4 .4 .4" specular="0.1 0.1 0.1" pos="0 0 5.0" dir="0 0 -1" castshadow="false" />
    <light directional="true" diffuse=".6 .6 .6" specular="0.2 0.2 0.2" pos="0 0 4" dir="0 0 -1" />

    <geom name="ground" type="plane" size="0 0 1" pos="0 0 0" quat="1 0 0 0" material="matplane" condim="1" />

    <body name="b0" pos="0 0 1">
        <geom type="box" size="0.2 0.025 0.025" rgba=".8 .2 .1 1" />
        <body name="b1" pos="-0.2 0 -0.2" euler="0 90 0">
            <geom type="box" size="0.2 0.025 0.025" rgba=".8 .2 .1 1" />
            <joint name="j0" type="hinge" pos="-0.2 0 0" axis="0 1 0" />
            <body name="b3" pos="0.2 0 0.2" euler="0 -90 0">
                <geom type="box" size="0.2 0.025 0.025" rgba=".8 .2 .1 1" />
                <joint name="j3" type="hinge" pos="-0.2 0 0" axis="0 1 0" />
            </body>
        </body>
        <body name="b2" pos="0.2 0 -0.2" euler="0 90 0">
            <geom type="box" size="0.2 0.025 0.025" rgba=".8 .2 .1 1" />
            <joint name="j2" type="hinge" pos="-0.2 0 0" axis="0 1 0" />
        </body>
    </body>
</worldbody>

<contact>
    <exclude name="e0" body1="b0" body2="b1" />
    <exclude name="e1" body1="b0" body2="b2" />
    <exclude name="e2" body1="b3" body2="b2" />
</contact>

<equality>
    <connect name="c1" body1="b2" body2="b3" anchor="0.2 0 0" />
</equality>

<actuator>
    <position joint="j0" ctrllimited="true" ctrlrange="-0.875 0.875" />
    <position joint="j2" ctrllimited="true" ctrlrange="-0.875 0.875" />
    <position joint="j3" ctrllimited="true" ctrlrange="-0.875 0.875" />
</actuator>
` **and i also used stl , obj in the other xml, also can not show in genesis ,same phenomenon as the picture**
@flyme45
Copy link
Author

flyme45 commented Jan 12, 2025

who can do me a favor ? I'd appreciate it.

@flyme45
Copy link
Author

flyme45 commented Jan 12, 2025

I skimmed #164, but I think not doing collision detection is a tricky solution, and I think there would be a better solution?

@flyme45
Copy link
Author

flyme45 commented Jan 12, 2025

the "connect"sign in mujoco has the other replacement in genesis?

Likhithsai2580 added a commit to Likhithsai2580/Genesis that referenced this issue Jan 13, 2025
Fixes Genesis-Embodied-AI#548

Add handling for `contype` and `conaffinity` attributes in the simulation environment.

* Update `genesis/utils/mjcf.py` to parse `contype` and `conaffinity` attributes in the `parse_geom` function and set them to 0 if not specified.
* Update `genesis/engine/entities/rigid_entity/rigid_entity.py` to handle `contype` and `conaffinity` attributes in the `_load_MJCF` method and pass them to the `RigidGeom` constructor.
@Hippozhibos
Copy link

Hippozhibos commented Jan 15, 2025

我是设置了两套,一套用于可视化,把 contype 和 conaffinity 都设为0。另一套用于碰撞检测,contype, conaffinity都设为1。Genesis官方给的franka的xml文件也是用了类似设置,也可见这个issue里的中后段 #461 。虽然不知道为什么,但好像genesis里用于碰撞检测的几何体不能可视化,可视化的几何体不能用于碰撞检测。你可以先试试看。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants