google-deepmind / google-deepmind/dm_control

Removing dclass-attribute

未关闭
#478 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
4.7k
派生
764
PR 合并指标
30 天内没有已合并 PR

描述

Hello,

I am trying to remove `class` attributes as it is unnecessary for joints in my use-case.

When I try to use the `del` command [example](https://github.com/google-deepmind/dm_control/blob/ed424509c0a0e8ddf7a43824924de483026ad9cc/dm_control/mjcf/README.md#modifying-xml-attributes):
```
joints = mjcf_model.find_all('joint')
# Remove class-attribute from 'joint' heading
for joint in joints:
if type(joint.dclass) is str:
del joint.dclass
```
, I get the following error:
```
Traceback (most recent call last):
File "/home/arnab/UWARL_catkin_ws/src/uwarl-mujoco-summit-wam-sim/src/main_rob_dup.py", line 817, in
del joints[0].dclass
File "/home/arnab/.local/lib/python3.8/site-packages/dm_control/mjcf/element.py", line 711, in __delattr__
raise AttributeError('object has no attribute: {}'.format(name))
AttributeError: object has no attribute: dclass
```
I need to remove the custom-named classes that the script generates as MuJoCo 2.2.x (Ubuntu 20.04) gives me errors when it is presented with:
```

```
, but not with this:
```

```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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