google-deepmind / google-deepmind/dm_control

Adding skin file to mjcf model

Đang mở
#384 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
4.7k
Fork
764
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello,
I'm relatively new to Mujoco and the dm_control package.
I've encountered the following issue, that I am not able to solve on my own.

At first I wanted to add a skin file via the mjcf interface of dm_control but this didn't work and the following error appeared.
```
│ ~/.pyenv/versions/3.8.10/lib/python3.8/site-packages/dm_control/mjcf/skin.py:85 in │
│ serialize │
│ │
│ 82 out.write(skin.texcoords.astype(' MAX_BODY_NAME_LENGTH: │
│ 87 │ raise ValueError( │
│ 88 │ │ 'body name is longer than permitted by the skin file format '
AttributeError: 'NoneType' object has no attribute 'full_identifier'

```

To make sure this is not due to my wrong way of using the library I created a minimal xml file that works in the basic mujoco viewer. The skin file will be displayed correctly. Here is the minimal xml file

```










```
If I'm running this minimal script and loading the above minimal.xml I get the same exception as before even though the same xml file worked in mujoco.viewer.launch
```

from dm_control import composer
from dm_control import viewer
from dm_control import mjcf

class Environment(composer.Entity):

def _build(self, environment_xml: str):
self._model = mjcf.from_path(environment_xml)

@property
def mjcf_model(self):
return self._model

class ExampleTask(composer.Task):

def __init__(self, environment_xml: str):
super().__init__()
self._root_entity = Environment(environment_xml)
self._task_observables = {}

@property
def root_entity(self):
return self._root_entity

@property
def task_observables(self):
return self._task_observables

def get_reward(self, physics):
return 0

def create_and_view(environment_xml: str):
task= ExampleTask(environment_xml)
env = composer.Environment(task)
env.reset()
viewer.launch(env)

if __name__ == "__main__":
create_and_view("minimal.xml")

```
Commenting out the `

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.