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 support for heterogeneous observations #864

Closed
jsmith-bdai opened this issue Aug 23, 2024 · 2 comments
Closed

Add support for heterogeneous observations #864

jsmith-bdai opened this issue Aug 23, 2024 · 2 comments
Assignees
Labels
dev team Issue or pull request created by the dev team

Comments

@jsmith-bdai
Copy link
Collaborator

  • Add the ability to mix non-homogeneous observations, for example images and with proprioceptive states.

  • Add example task:
    Cartpole balancing towards a red sphere. Observations: cartpole joint state, RGB image of the scene

@Mayankm96 Mayankm96 added the dev team Issue or pull request created by the dev team label Sep 5, 2024
@Toni-SM
Copy link
Contributor

Toni-SM commented Sep 15, 2024

Proposal (after some discussions with @kellyguo11): Define the spaces using both: gym.spaces and python basic data types (for simplicity) indistinctly in env configs files as follows. Use the names observation_space, action_space and state_space rather than num_observations, num_actions and num_spaces in configs files to define them respectively.

Fundamental spaces:

gym.spaces python basic data type
Box int or list of int (e.g.: 10, [64, 64, 3])
Discrete set (e.g.: {2})
MultiDiscrete list of sets (e.g.: [{2}, {5}])

Composite spaces:

gym.spaces python basic data type
Dict dict (e.g.: {"joints": 10, "camera": [64, 64, 3], "gripper": {2}})
Tuple tuple (e.g.: (10, [64, 64, 3], {2}))

@Mayankm96
Copy link
Contributor

I am not a huge fan of having to manually specify this space since users (in robotics at least) are usually changing the observations and actions on the fly while prototyping the environment. Changing the observation function and then the gym.Space for it seems cumbersome and requires "counting" dimensions (which is very erroneous).

Particuarly, for the manager based environment workflow, we expect users to only provide the "terms" and we infer everything from those terms. Having to specify the numbers for explicit spaces would add more steps for the user (unless we can think of a nicer solution).

But in general, I agree. We should handle spaces somewhat correctly.

kellyguo11 pushed a commit that referenced this issue Oct 17, 2024
# Description

This PR add supports for different Gymnasium spaces (`Box`, `Discrete`,
`MultiDiscrete`, `Tuple` and `Dict`) to define observation, action and
state spaces in the direct workflow.

See
#864 (comment)

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- New feature (non-breaking change which adds functionality)
- This change requires a documentation update

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev team Issue or pull request created by the dev team
Projects
None yet
Development

No branches or pull requests

5 participants