google-deepmind / google-deepmind/dm_control

How to create an environment to give depth images?

Offen
#211 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
4.7k
Forks
764
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

The vision environment provide only RGB images, instead of RGBD (depth) images, but I see some partial implementation of depth images. Here's my attempt to set `depth=True`, but it failes because the `dtype` is set to uint8 which cannot be `inf`.

```
import collections

import numpy as np
from dm_control import manipulation
from dm_control.manipulation.bricks import _reassemble
from dm_control.manipulation.shared import registry, tags, observations
from dm_control.manipulation.shared.observations import ObservationSettings, _ENABLED_FEATURE, _ENABLED_FTT, \
_DISABLED_FEATURE, CameraObservableSpec, ObservableSpec

class MyCameraObservableSpec(collections.namedtuple(
'CameraObservableSpec', ('depth', 'height', 'width') + ObservableSpec._fields)):
"""Configuration options for camera observables."""
__slots__ = ()

ENABLED_CAMERA_DEPTH = MyCameraObservableSpec(
height=84,
width=84,
enabled=True,
depth=True,
update_interval=1,
buffer_size=1,
delay=0,
aggregator=None,
corruptor=None)

VISION_DEPTH = ObservationSettings(
proprio=_ENABLED_FEATURE,
ftt=_ENABLED_FTT,
prop_pose=_DISABLED_FEATURE,
camera=ENABLED_CAMERA_DEPTH)

@registry.add(tags.VISION)
def my_env():
return _reassemble(obs_settings=VISION_DEPTH,
num_bricks=5,
randomize_initial_order=True,
randomize_desired_order=True)

env = manipulation.load('my_env', seed=0)

spec = env.action_spec()

for i in range(10):
a = np.random.uniform(spec.minimum, spec.maximum, spec.shape)
time_step = env.step(a)
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.