Skip to content

Commit

Permalink
[fix] fox bug for how to use robot and how to use sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
APX103 committed Sep 6, 2024
1 parent bd4015d commit d4a29e5
Show file tree
Hide file tree
Showing 12 changed files with 538 additions and 20 deletions.
11 changes: 10 additions & 1 deletion docs/_modules/grutopia/core/env.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ <h1>Source code for grutopia.core.env</h1><div class="highlight"><pre>
<span class="sd"> ----------------------------------------------------------------------</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">:</span> <span class="n">SimulatorConfig</span><span class="p">,</span> <span class="n">headless</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">webrtc</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">:</span> <span class="n">SimulatorConfig</span><span class="p">,</span> <span class="n">headless</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">webrtc</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> <span class="n">native</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_simulation_config</span> <span class="o">=</span> <span class="kc">None</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_render</span> <span class="o">=</span> <span class="kc">None</span>
<span class="c1"># Setup Multitask Env Parameters</span>
Expand All @@ -298,6 +298,15 @@ <h1>Source code for grutopia.core.env</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">_simulation_app</span><span class="o">.</span><span class="n">set_setting</span><span class="p">(</span><span class="s1">&#39;/ngx/enabled&#39;</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
<span class="n">enable_extension</span><span class="p">(</span><span class="s1">&#39;omni.services.streamclient.webrtc&#39;</span><span class="p">)</span>

<span class="k">elif</span> <span class="n">native</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">omni.isaac.core.utils.extensions</span> <span class="kn">import</span> <span class="n">enable_extension</span> <span class="c1"># noqa</span>

<span class="bp">self</span><span class="o">.</span><span class="n">_simulation_app</span><span class="o">.</span><span class="n">set_setting</span><span class="p">(</span><span class="s2">&quot;/app/window/drawMouse&quot;</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_simulation_app</span><span class="o">.</span><span class="n">set_setting</span><span class="p">(</span><span class="s2">&quot;/app/livestream/proto&quot;</span><span class="p">,</span> <span class="s2">&quot;ws&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_simulation_app</span><span class="o">.</span><span class="n">set_setting</span><span class="p">(</span><span class="s2">&quot;/app/livestream/websocket/framerate_limit&quot;</span><span class="p">,</span> <span class="mi">120</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_simulation_app</span><span class="o">.</span><span class="n">set_setting</span><span class="p">(</span><span class="s2">&quot;/ngx/enabled&quot;</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
<span class="n">enable_extension</span><span class="p">(</span><span class="s2">&quot;omni.kit.livestream.native&quot;</span><span class="p">)</span>

<span class="kn">from</span> <span class="nn">grutopia.core</span> <span class="kn">import</span> <span class="n">datahub</span> <span class="c1"># noqa E402.</span>
<span class="kn">from</span> <span class="nn">grutopia.core.runner</span> <span class="kn">import</span> <span class="n">SimulatorRunner</span> <span class="c1"># noqa E402.</span>

Expand Down
2 changes: 2 additions & 0 deletions docs/_modules/grutopia/core/robot/controller.html
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ <h1>Source code for grutopia.core.robot.controller</h1><div class="highlight"><p
<span class="n">controller_map</span> <span class="o">=</span> <span class="p">{}</span>
<span class="n">available_controllers</span> <span class="o">=</span> <span class="p">{</span><span class="n">a</span><span class="o">.</span><span class="n">name</span><span class="p">:</span> <span class="n">a</span> <span class="k">for</span> <span class="n">a</span> <span class="ow">in</span> <span class="n">robot_model</span><span class="o">.</span><span class="n">controllers</span><span class="p">}</span>

<span class="k">if</span> <span class="n">config</span><span class="o">.</span><span class="n">controller_params</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">return</span> <span class="n">controller_map</span>
<span class="k">for</span> <span class="n">controller_param</span> <span class="ow">in</span> <span class="n">config</span><span class="o">.</span><span class="n">controller_params</span><span class="p">:</span>
<span class="n">controller_name</span> <span class="o">=</span> <span class="n">controller_param</span><span class="o">.</span><span class="n">name</span>
<span class="k">if</span> <span class="n">controller_name</span> <span class="ow">in</span> <span class="n">available_controllers</span><span class="p">:</span>
Expand Down
Loading

0 comments on commit d4a29e5

Please sign in to comment.