-
Notifications
You must be signed in to change notification settings - Fork 518
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
Generalize command resampling #224
base: main
Are you sure you want to change the base?
Conversation
# Description This MR fixes the color of the ground in Orbit. It is now black since we like that color more. It also fixes the setting of the translation of the ground plane. Earlier, it was taking z height from the configuration. Instead, now it expects to get the full translation as an argument to its function. This is needed to make it consistent with interactive scene designing API. ## Type of change - Bug fix (non-breaking change which fixes an issue) - Breaking change (fix or feature that would cause existing functionality to not work as expected) ## Screenshot ![new_ground](https://github.com/isaac-orbit/orbit/assets/12863862/8e729cb4-875f-476f-aa32-39cab38ad925) ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./orbit.sh --format` - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] 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
Did a very high-level parse of the code. Overall, this is an interesting feature. However, it seems that resampling time term inherited from a manager term class is an overkill. Wouldn't it be easier to have it as a function instead? From what I see, the following function signature should suffice. def my_samping_func(env_ids: Sequence[int], *args) -> torch.Tensor |
A simple function would suffice for some applications but even the current fixed time resampling mechanism needs persistent storage you cannot have inside a function. It needs to keep track of the time left. So I definitely think a resampling class is necessary.
But if you think it would be better to create a dedicated resampling class for this behavior, I could be convinced that the manager is not necessary :) |
3e7a470
to
cfcabba
Compare
@Mayankm96 Any movement on this? Happy to resolve all conflicts, if you are still interested in this. |
Description
This introduces the concept of a
ResamplingManager
andResamplingTerm
s. This generalizes command resampling beyond the currently implemented fixed time resampling.Every
CommandTerm
now owns aResamplingManager
which it calls during thecompute()
call to determine whether commands should be resampled.A
ResamplingManger
can contain multipleRewardTerm
s to obtain diverse behavior.All current example RL environment configs which used a command other than the
NullCommand
where changed to use the newFixedFrequency
resampling term, which replicates the current behavior. TheNullCommand
now simply receives nowResamplingTerm
and is therefore never resampled, as desired.However, this is a breaking change for people who created their own RL configs outside of the Orbit main branch. Luckily, this is very easy to fix with a single line code change:
resampling_time_range=(10.0, 10.0)
-->resampling={"fixed_frequency": FixedFrequencyCfg(resampling_time_range=(10.0, 10.0))},
I also added a new
RandomChance
resampling term as an example, which resamples environments with a fixed probability.Fixes #223
Type of change
Checklist
pre-commit
checks with./orbit.sh --format
./orbit.sh --test
and they passconfig/extension.toml
fileCONTRIBUTORS.md
or my name already exists there