Skip to content

Commit

Permalink
deploy: ff6c965
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayankm96 committed Jul 4, 2024
1 parent c6b07c9 commit 6c70ae6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions _modules/omni/isaac/lab/sim/simulation_context.html
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ <h1>Source code for omni.isaac.lab.sim.simulation_context</h1><div class="highli
<span class="kn">import</span> <span class="nn">enum</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">torch</span>
<span class="kn">import</span> <span class="nn">traceback</span>
<span class="kn">import</span> <span class="nn">weakref</span>
<span class="kn">from</span> <span class="nn">collections.abc</span> <span class="kn">import</span> <span class="n">Iterator</span>
Expand Down Expand Up @@ -681,6 +682,12 @@ <h1>Source code for omni.isaac.lab.sim.simulation_context</h1><div class="highli
<span class="c1"># note: we do it once here because it reads the VERSION file from disk and is not expected to change.</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_isaacsim_version</span> <span class="o">=</span> <span class="n">get_version</span><span class="p">()</span>

<span class="c1"># create a tensor for gravity</span>
<span class="c1"># note: this line is needed to create a &quot;tensor&quot; in the device to avoid issues with torch 2.1 onwards.</span>
<span class="c1"># the issue is with some heap memory corruption when torch tensor is created inside the asset class.</span>
<span class="c1"># you can reproduce the issue by commenting out this line and running the test `test_articulation.py`.</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_gravity_tensor</span> <span class="o">=</span> <span class="n">torch</span><span class="o">.</span><span class="n">tensor</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">cfg</span><span class="o">.</span><span class="n">gravity</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">torch</span><span class="o">.</span><span class="n">float32</span><span class="p">,</span> <span class="n">device</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">cfg</span><span class="o">.</span><span class="n">device</span><span class="p">)</span>

<span class="c1"># add callback to deal the simulation app when simulation is stopped.</span>
<span class="c1"># this is needed because physics views go invalid once we stop the simulation</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">builtins</span><span class="o">.</span><span class="n">ISAAC_LAUNCHED_FROM_TERMINAL</span><span class="p">:</span>
Expand Down

0 comments on commit 6c70ae6

Please sign in to comment.