Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add UUID config to simulator visual sensors #472

Merged
merged 5 commits into from
Sep 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion habitat/core/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ class Sensor:

def __init__(self, *args: Any, **kwargs: Any) -> None:
self.config = kwargs["config"] if "config" in kwargs else None
self.uuid = self._get_uuid(*args, **kwargs)
if hasattr(self.config, "UUID"):
# We allow any sensor config to override the UUID
self.uuid = self.config.UUID
else:
Copy link
Contributor Author

@Skylion007 Skylion007 Sep 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathfac Actually, I am not sure I like this method because calling _get_uuid will return the wrong UUID. We really should remove the internal method INMO

self.uuid = self._get_uuid(*args, **kwargs)
self.sensor_type = self._get_sensor_type(*args, **kwargs)
self.observation_space = self._get_observation_space(*args, **kwargs)

Expand Down