Skip to content

Commit

Permalink
Fixes typo in constructor for physics events (#217)
Browse files Browse the repository at this point in the history
# Description

This MR fixes a bug introduced in #207 which was assigning tuples to the
`invalidate_handle` member in `AssetBase` and `SensorBase`.

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

## 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
  • Loading branch information
Mayankm96 authored Oct 27, 2023
1 parent bac9735 commit 6ae3c3f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion source/extensions/omni.isaac.orbit/config/extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

# Note: Semantic Versioning is used: https://semver.org/
version = "0.9.22"
version = "0.9.23"

# Description
title = "ORBIT framework for Robot Learning"
Expand Down
10 changes: 10 additions & 0 deletions source/extensions/omni.isaac.orbit/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Changelog
---------

0.9.23 (2023-10-27)
~~~~~~~~~~~~~~~~~~~

Fixed
^^^^^

* Fixed a typo in the :class:`AssetBase` and :class:`SensorBase` that effected the class destructor.
Earlier, a tuple was being created in the constructor instead of the actual object.


0.9.22 (2023-10-26)
~~~~~~~~~~~~~~~~~~~

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,16 @@ def __init__(self, cfg: AssetBaseCfg):
# note: Use weakref on all callbacks to ensure that this object can be deleted when its destructor is called.
# add callbacks for stage play/stop
# The order is set to 10 which is arbitrary but should be lower priority than the default order of 0
physx_interface = omni.physx.acquire_physx_interface()
self._initialize_handle = physx_interface.get_simulation_event_stream_v2().create_subscription_to_pop_by_type(
physx_event_stream = omni.physx.acquire_physx_interface().get_simulation_event_stream_v2()
self._initialize_handle = physx_event_stream.create_subscription_to_pop_by_type(
int(omni.physx.bindings._physx.SimulationEvent.RESUMED),
lambda event, obj=weakref.proxy(self): obj._initialize_callback(event),
order=10,
)
self._invalidate_initialize_handle = (
physx_interface.get_simulation_event_stream_v2().create_subscription_to_pop_by_type(
int(omni.physx.bindings._physx.SimulationEvent.STOPPED),
lambda event, obj=weakref.proxy(self): obj._invalidate_initialize_callback(event),
order=10,
),
self._invalidate_initialize_handle = physx_event_stream.create_subscription_to_pop_by_type(
int(omni.physx.bindings._physx.SimulationEvent.STOPPED),
lambda event, obj=weakref.proxy(self): obj._invalidate_initialize_callback(event),
order=10,
)
# add callback for debug visualization
if self.cfg.debug_vis:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,16 @@ def __init__(self, cfg: SensorBaseCfg):
# note: Use weakref on callbacks to ensure that this object can be deleted when its destructor is called.
# add callbacks for stage play/stop
# The order is set to 10 which is arbitrary but should be lower priority than the default order of 0
physx_interface = omni.physx.acquire_physx_interface()
self._initialize_handle = physx_interface.get_simulation_event_stream_v2().create_subscription_to_pop_by_type(
physx_event_stream = omni.physx.acquire_physx_interface().get_simulation_event_stream_v2()
self._initialize_handle = physx_event_stream.create_subscription_to_pop_by_type(
int(omni.physx.bindings._physx.SimulationEvent.RESUMED),
lambda event, obj=weakref.proxy(self): obj._initialize_callback(event),
order=10,
)
self._invalidate_initialize_handle = (
physx_interface.get_simulation_event_stream_v2().create_subscription_to_pop_by_type(
int(omni.physx.bindings._physx.SimulationEvent.STOPPED),
lambda event, obj=weakref.proxy(self): obj._invalidate_initialize_callback(event),
order=10,
),
self._invalidate_initialize_handle = physx_event_stream.create_subscription_to_pop_by_type(
int(omni.physx.bindings._physx.SimulationEvent.STOPPED),
lambda event, obj=weakref.proxy(self): obj._invalidate_initialize_callback(event),
order=10,
)
# add callback for debug visualization
if self.cfg.debug_vis:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def main():
robot.set_joint_position_target(robot.data.default_joint_pos.clone())
robot.write_data_to_sim()
# perform step
sim.step(render=app_launcher.RENDER)
sim.step()
# update sim-time
sim_time += sim_dt
count += 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_external_force_on_single_body(self):
robot.set_joint_position_target(robot.data.default_joint_pos.clone())
robot.write_data_to_sim()
# perform step
self.sim.step(render=app_launcher.RENDER)
self.sim.step()
# update buffers
robot.update(self.dt)
# check condition that the robots have fallen down
Expand Down Expand Up @@ -194,7 +194,7 @@ def test_external_force_on_multiple_bodies(self):
robot.set_joint_position_target(robot.data.default_joint_pos.clone())
robot.write_data_to_sim()
# perform step
self.sim.step(render=app_launcher.RENDER)
self.sim.step()
# update buffers
robot.update(self.dt)
# check condition
Expand Down

0 comments on commit 6ae3c3f

Please sign in to comment.