Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix bugs in kettle_asset.xml to ensure compatibility with the latest MuJoCo versions #255

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

Josh00-Lu
Copy link
Contributor

@Josh00-Lu Josh00-Lu commented Nov 9, 2024

Description

There's a missing tag in kettle_asset.xml. This will bring errors in the latest version of MuJoCo (>3.16). I have validated that this change does not change the behavior of the environment for older versions of mujoco (3.1.6, 3.0.1). However, the behavior in MuJoCo version (<3.0, e.g. 2.1.5) remains to be checked (if needed).

Related issues $ temp fixes includes:
Farama-Foundation/D4RL#236 (comment)
CleanDiffuserTeam/CleanDiffuser#24
Farama-Foundation/D4RL#238 (comment)

Type of change

Please delete options that are not relevant.

  • Documentation only change (no code changed)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Notes

This behavior aligns with other assets descriptions in kitchen. For example, in microwave:

    <default>
        <default class="microwave">
            <joint damping="2" frictionloss="2" armature=".01" limited="true"/>
            <geom conaffinity="0" contype="0" group="1" material="micro_black" type="mesh"/>
            <default class="micro_collision">
                <geom conaffinity="1" condim="3" contype="0" group="4" margin="0.001" material="micro_collision_blue" solimp=".8 .9 .01" solref=".02 1"/>
            </default>
        </default>
    </default>

in oven:

    <default>
        <default class="oven">
            <joint armature="0.001" damping="2" limited="true"/>
            <geom conaffinity="0" contype="0" group="1" material="oven_metal" type="mesh"/>
            <default class="ovenlight" >
                <light directional="false" castshadow="true" attenuation="0.03 0.03 0.03" cutoff="100" exponent="25" diffuse=".7 .65 .65" specular=".3 .3 .3"/>
            </default>
            <default class="oven_collision">
                <geom conaffinity="1" condim="3" contype="0" group="4" margin="0.001" material="oven_collision_blue" type="mesh"/>
            </default>
        </default>
    </default>

However, in kettle

    <default class="kettle">
        <joint damping="2" frictionloss="2" armature=".01" limited="true" />
        <geom conaffinity="0" contype="0" group="1" material="kettle_white" type="mesh"/>
        <default class="kettle_collision">
            <geom conaffinity="1" condim="4" contype="1" group="4" margin="0.001" material="kettle_collision_blue" solimp=".8 .9 .01" solref=".02 1" type="mesh"/>
        </default>
    </default>

I hope this typo could be fixed soon. Since in latest version of MuJoCo, the default tag without name is identified as "main default", which will bring errors like:

ValueError: XML Error: top-level default class 'main' cannot be renamed

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

…MuJoCo versions

There's a missing <default> tag in kettle_asset.xml. This will bring errors in the latest version of MuJoCo (>3.16). I have validated that this change does not change the behavior of the environment for older versions of mujoco (3.1.6, 3.0.1). However, the behavior in MuJoCo version (<3.0, e.g. 2.1.5) remains to be checked.
@Kallinteris-Andreas
Copy link
Collaborator

Please also validate fot version 2 of MuJoCo, and provide the code you used to validate it.

@Kallinteris-Andreas
Copy link
Collaborator

i validated it https://github.com/Kallinteris-Andreas/gymnasium-changes-validation/tree/main/kitchen_xml

@Kallinteris-Andreas Kallinteris-Andreas merged commit 185a95c into Farama-Foundation:main Dec 5, 2024
6 checks passed
@Kallinteris-Andreas Kallinteris-Andreas changed the title Fix bugs in kettle_asset.xml to ensure compatibility with the latest MuJoCo versions Fix bugs in kettle_asset.xml to ensure compatibility with the latest MuJoCo versions Dec 5, 2024
@Josh00-Lu Josh00-Lu deleted the patch-1 branch December 15, 2024 15:50
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants