• fyu-bdai's avatar
    Fixes loading of ContactSensor when using it in an extension (#529) · 1928161b
    fyu-bdai authored
    # Description
    
    This MR initializes `self._body_physx_view = None` in the init method of the
    `ContactSensor` class.
    
    This is needed to use ContactSensors with `debug_vis=True` while running
    Orbit as an extension, such as EvalSim.
    
    Currently, `ContactSensor._initialize_impl` initializes and sets the
    value of `self._body_physx_view`. However, when running in extension
    mode, `ContactSensor._initialize_impl` is called _after_
    `ContactSensor._debug_vis_callback`, which causes an error to appear
    upon loading an environment because `ContactSensor._debug_vis_callback`
    references `self._body_physx_view` that have not been initialized.
    
    With `self._body_physx_vew` initialized to None in the init method of
    `ContactSensor`, it allows `ContactSensor._debug_vis_callback` to be
    safely called before `ContactSensor._initialize_impl`.
    
    ## Type of change
    
    - Bug fix (non-breaking change which fixes an issue)
    
    ## 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 run all the tests with `./orbit.sh --test` and they pass
    - [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
    1928161b
Name
Last commit
Last update
..
CHANGELOG.rst Loading commit data...
README.md Loading commit data...