Skip to content

Generalize rewards manager - #221

Closed
lorenwel wants to merge 5 commits into
isaac-sim:mainfrom
lorenwel:feature/generalize_rewards
Closed

lorenwel wants to merge 5 commits into
isaac-sim:mainfrom
lorenwel:feature/generalize_rewards

Conversation

@lorenwel

@lorenwel lorenwel commented Jan 29, 2024 •

Copy link
Copy Markdown
Contributor

Description

Generalizes the reward manager to allow for multiple "reward groups" made of multiple terms instead of a single one.
Is backwards compatible with the previous setup, if just reward terms are added to the config.

Fixes #220

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update (Maybe, not sure)

Checklist

  • I have run the pre-commit checks with ./orbit.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have run all the tests with ./orbit.sh --test and they pass
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@Mayankm96 Mayankm96 added the enhancement New feature or request label Jan 29, 2024
@Mayankm96

Mayankm96 commented Jan 31, 2024 •

Copy link
Copy Markdown
Contributor

Thanks for this MR. Will review this in the following days and add feedback. Probably also want to do this for termination manager.

The main blocking question is that with this, do we expect that the Env class returns a dict of rewards? Or it should still return a single tensor, and we put all the miscellaneous groups to extras? The latter seems to be closer to Gymnasium definitions.

@lorenwel

lorenwel commented Feb 7, 2024

Copy link
Copy Markdown
Contributor Author

The way I implemented this at the moment, is that it will return a single Tensor if there are no reward groups and a dict of tensors when there are multiple.
The reason I chose this, is because it might be hard to eventually decide which is the "main reward". In the case of CMDP with a single reward and cost this might be easy, but for things like multi-critic, where you have a dedicated critic network per reward term, it is unclear how this should be split up.

I'm not sure how much downstream complexity this would involve for the multi-critic case in learning frameworks other than rsl_rl. There, it was a fairly straight-forward modification to the OnPolicyRunner to move all Tensors in the dict to GPU/CPU (plus some logging stuff).

Generally, to me it is always a bit confusing when "major" information for learning is put into the "extras" dictionary. Then it suddenly becomes a core thing, depending on the situation.
It's already like that with the observations, which I find confusing, but that's a separate issue.

@lorenwel

lorenwel commented Jun 7, 2024

Copy link
Copy Markdown
Contributor Author

@Fe1777 Thank you for the updated PR description.
@Mayankm96 Any update on whether this is something you are still interested in and if so, if the architecture is fine. I also didn't get a response in #220 since January.

We've been using this internally since then and it works fine for us.
I'm happy to resolve the conflicts, if you are generally fine with the architecture.

@lorenwel

Copy link
Copy Markdown
Contributor Author

Superseded by #729

@lorenwel lorenwel closed this Jul 25, 2024
kellyguo11 pushed a commit that referenced this pull request Jan 30, 2025
# Description

- Updated kit file for xr to include async rendering and GPU limit
increase
- Set xr anchor to active camera
- Conditionally remove rate limiting in record_demos.py if handtracking
is used


## Type of change

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

- Bug fix (non-breaking change which fixes an issue)

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## 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
-->
jtigue-bdai pushed a commit that referenced this pull request Apr 14, 2025
# Description

- Updated kit file for xr to include async rendering and GPU limit
increase
- Set xr anchor to active camera
- Conditionally remove rate limiting in record_demos.py if handtracking
is used


## Type of change

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

- Bug fix (non-breaking change which fixes an issue)

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## 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
-->
SevenFo pushed a commit to SevenFo/IsaacLab that referenced this pull request May 19, 2025
# Description

- Updated kit file for xr to include async rendering and GPU limit
increase
- Set xr anchor to active camera
- Conditionally remove rate limiting in record_demos.py if handtracking
is used


## Type of change

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

- Bug fix (non-breaking change which fixes an issue)

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## 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
-->
LJones-alt pushed a commit to LJones-alt/IsaacLab-Laura that referenced this pull request Jul 1, 2026
# Description

- Updated kit file for xr to include async rendering and GPU limit
increase
- Set xr anchor to active camera
- Conditionally remove rate limiting in record_demos.py if handtracking
is used


## Type of change

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

- Bug fix (non-breaking change which fixes an issue)

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## 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

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Proposal] RewardManager cannot handle multiple critics

2 participants