• David Hoeller's avatar
    Modifies `ObservationManager` and `RewardManager` to take functions in each... · b25d6673
    David Hoeller authored
    Modifies `ObservationManager` and `RewardManager` to take functions in each term's configuration (#61)
    
    # Description
    
    This PR modifies the `ObservationManager` and `RewardManager` to change
    their default behavior. Earlier they expected that users inherit from
    the class and define member functions inside it to compute the terms.
    The function name was resolved from the term name itself. However, this
    prevented the reuse of common terms and the rewriting of a lot of code
    across environments.
    
    The changes made in this PR add another argument `func` to the term
    dictionary which now expects a function directly. This way users can use
    the same function multiple times for different terms. Example:
    
    ```python
    def get_contact_force(env, bodies):
       ....
       
    class ObservationManagerCfg:
    
       term_1 = {"func": get_contact_force, "bodies": "base"}
       term_2 = {"func": get_contact_force, "bodies": ".*_FOOT"}
    ```
    
    The older class implementations have been moved to
    `omni.isaac.orbit.compat.utils.mdp` for compatibility.
    
    Additionally, we include `ManagerBase` and `ManagerBaseTermCfg` as a
    base class to ensure a better signature on how configuration terms are
    handled.
    
    ## Type of change
    
    - Breaking change (fix or feature that would cause existing
    functionality to not work as expected)
    - This change requires a documentation update
    
    ## Checklist
    
    - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
    `./orbit.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
    
    ---------
    Co-authored-by: 's avatarMayank Mittal <mittalma@leggedrobotics.com>
    b25d6673
Name
Last commit
Last update
..
index.rst Loading commit data...
orbit.actuators.group.rst Loading commit data...
orbit.actuators.model.rst Loading commit data...
orbit.app.rst Loading commit data...
orbit.asset_loader.rst Loading commit data...
orbit.command_generators.rst Loading commit data...
orbit.compat.rst Loading commit data...
orbit.devices.rst Loading commit data...
orbit.markers.rst Loading commit data...
orbit.objects.articulated.rst Loading commit data...
orbit.objects.rigid.rst Loading commit data...
orbit.robots.rst Loading commit data...
orbit.sensors.rst Loading commit data...
orbit.terrains.rst Loading commit data...
orbit.utils.assets.rst Loading commit data...
orbit.utils.kit.rst Loading commit data...
orbit.utils.math.rst Loading commit data...
orbit.utils.mdp.rst Loading commit data...
orbit.utils.rst Loading commit data...
orbit_envs.isaac_env.rst Loading commit data...
orbit_envs.utils.data_collector.rst Loading commit data...
orbit_envs.utils.rst Loading commit data...
orbit_envs.utils.wrappers.rst Loading commit data...