Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Schema regeneration in 985d0940 dropped three declarations MuJoCo 3.12 accepts (contact sensor, jointinparent references, custom numeric arrays)

未关闭
#552 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

将 HEAD 中的 dm_control/mjcf/schema.xml 与重新生成前的版本 985d0940^ 进行比较,重点关注 sensor/contact、actuator/jointinparent 和 custom/numeric data 声明。重现 issue 中的三个案例,然后运行 mjcf test suite,并添加回归测试以证明 contact parsing、attach() joint references 和 numeric arrays 已恢复正常工作。

由索引模型根据 Issue 内容生成。

描述

Commit 985d0940 regenerated dm_control/mjcf/schema.xml and dropped three declarations that were present before and that MuJoCo 3.12 still accepts. All three reproduce at HEAD (6b3298d) with mujoco 3.12.0.

1. <sensor> lost its <contact> child

from dm_control import mjcf
xml = """<mujoco>
  <worldbody><body name="b"><joint name="j" type="slide"/><geom name="g" size="0.1"/></body></worldbody>
  <sensor><contact name="cs" geom1="g" num="1" data="found" reduce="netforce"/></sensor>
</mujoco>"""
mjcf.from_xml_string(xml)
# KeyError: "Line ...: error while parsing element <contact>: 'contact'"

mujoco.MjModel.from_xml_string(xml) loads the same model fine.

2. jointinparent degraded from reference to string on all nine actuator elements

Because it is no longer a type="reference" reference_namespace="joint" attribute, attach() does not prefix the joint name, and the composed model fails to compile:

child = mjcf.RootElement(model='child')
body = child.worldbody.add('body', name='b')
body.add('joint', name='j', type='hinge')
body.add('geom', name='g', size=[0.1])
child.actuator.add('general', name='a', jointinparent='j')
parent = mjcf.RootElement(model='parent')
parent.attach(child)
mjcf.Physics.from_mjcf_model(parent)
# Error: unknown transmission target 'j' for actuator id = 0

3. custom/numeric data degraded from float array to string

root = mjcf.RootElement(model='m')
root.custom.add('numeric', name='x', data=[1, 2, 3])
# ValueError: during initialization of attribute 'data' of element <numeric>: Expect a string value: got [1, 2, 3]

This worked on the prior release.

In all three cases the pre-regeneration schema (985d0940^) had the correct declaration; restoring those three pieces fixes all three without affecting the rest of the mjcf test suite. PR incoming with the restore plus regression tests. If the preferred fix is in the schema generator rather than the checked-in file, the repro set here should transfer directly.

主要语言
Python
星标
4.7k
派生
765
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google-deepmind/dm_control 的其他 Issue

查看 google-deepmind/dm_control 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。