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

Possible bug in symbolic observations of openable entities #95

Open
rikifunt opened this issue Dec 2, 2024 · 0 comments
Open

Possible bug in symbolic observations of openable entities #95

rikifunt opened this issue Dec 2, 2024 · 0 comments

Comments

@rikifunt
Copy link

rikifunt commented Dec 2, 2024

Hi,

I think there might be a bug in observations.symbolic (https://github.com/epignatelli/navix/blob/main/navix/observations.py#L101), which makes locked and open doors have identical observations. Currently, the relevant lines that compute the observation (https://github.com/epignatelli/navix/blob/main/navix/observations.py#L132) are:

        if isinstance(entity, Openable):
            entity_state = entity.open + (entity.requires != jnp.zeros(entity.shape))

Which means entity_state will be 1 if the door is either open or locked, and 0 when it is closed but does not require anything to be opened. Is this the intended behavior? From my understanding of the docstring of the function, it should instead be something like:

        if isinstance(entity, Openable):
            entity_state = (1 - entity.open) + (entity.requires != jnp.zeros(entity.shape))

which results in:

  • 0 if the door is open
  • 1 if the door is closed but has no requirements
  • 2 if the door is locked and requires a key

If this is the case, I can also submit a PR with a fix if needed. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: TODOs
Development

No branches or pull requests

1 participant