<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>ishan.sh</title>
  <subtitle>Personal writing, experiments, and notes from Ishan.</subtitle>
  <link href="https://ishan.sh/feed.xml" rel="self"/>
  <link href="https://ishan.sh/"/>
  <updated>2026-05-03T00:00:00.000Z</updated>
  <id>https://ishan.sh/</id>
  <author><name>Ishan</name><email>ishandotsh@gmail.com</email></author>
  
    <entry>
      <title>pi-computer-use Port</title>
      <link href="https://ishan.sh/experiments/pi-computer-use-port/"/>
      <updated>2026-05-03T00:00:00.000Z</updated>
      <id>https://ishan.sh/experiments/pi-computer-use-port/</id>
      <summary>Smol computer use extension</summary>
      <content type="html"><![CDATA[&lt;p&gt;used pi and gpt 5.5 to extend the &lt;a href=&quot;https://github.com/injaneity/pi-computer-use&quot;&gt;pi-computer-use&lt;/a&gt; extension for &lt;a href=&quot;https://pi.dev/&quot;&gt;pi&lt;/a&gt; to also work on ubuntu. I spent about 10 minutes working on this.&lt;/p&gt;
&lt;a class=&quot;github-card&quot; href=&quot;https://github.com/ishandotsh/pi-computer-use&quot;&gt;
  &lt;span class=&quot;github-card-icon&quot; aria-hidden=&quot;true&quot;&gt;
    &lt;svg viewBox=&quot;0 0 16 16&quot; width=&quot;24&quot; height=&quot;24&quot; fill=&quot;currentColor&quot;&gt;&lt;path d=&quot;M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82A7.65 7.65 0 0 1 8 3.87c.68 0 1.36.09 2 .26 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;
  &lt;/span&gt;
  &lt;span class=&quot;github-card-content&quot;&gt;
    &lt;span class=&quot;github-card-eyebrow&quot;&gt;GitHub repository&lt;/span&gt;
    &lt;strong&gt;ishandotsh/pi-computer-use&lt;/strong&gt;
    &lt;span&gt;View the repository on GitHub.&lt;/span&gt;
  &lt;/span&gt;
&lt;/a&gt;
&lt;p&gt;Just an experiment (probably) never working on this again&lt;/p&gt;
&lt;figure class=&quot;video-embed&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot;&gt;
    &lt;source src=&quot;https://ishan.sh/assets/images/pi-computer-use-port/silly.mp4&quot; type=&quot;video/mp4&quot; /&gt;
    &lt;a href=&quot;https://ishan.sh/assets/images/pi-computer-use-port/silly.mp4&quot;&gt;Download video&lt;/a&gt;
  &lt;/video&gt;
  &lt;figcaption&gt;Silly demo&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Sorry, a better demo:&lt;/p&gt;
&lt;figure class=&quot;video-embed&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot;&gt;
    &lt;source src=&quot;https://ishan.sh/assets/images/pi-computer-use-port/spotify.mp4&quot; type=&quot;video/mp4&quot; /&gt;
    &lt;a href=&quot;https://ishan.sh/assets/images/pi-computer-use-port/spotify.mp4&quot;&gt;Download video&lt;/a&gt;
  &lt;/video&gt;
  &lt;figcaption&gt;Spotify demo&lt;/figcaption&gt;
&lt;/figure&gt;
]]></content>
    </entry>
  
    <entry>
      <title>Building with Local Qwen3.6</title>
      <link href="https://ishan.sh/experiments/please-be-good-local-qwen-3.6/"/>
      <updated>2026-05-03T00:00:00.000Z</updated>
      <id>https://ishan.sh/experiments/please-be-good-local-qwen-3.6/</id>
      <summary>Built this website twice using Qwen3.6 and GPT5.5. Local models are almost great</summary>
      <content type="html"><![CDATA[&lt;p&gt;I&#39;ve spent the last couple of weeks playing around with running local models on my RTX3090 24gb. I tried doing a similar thing about an year ago but local models were nowhere near as useful as they are now and I was left pretty disappointed.&lt;/p&gt;
&lt;p&gt;Thanks to a bunch of people its been really easy getting started:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sudo: &lt;div class=&quot;tweet-embed&quot;&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-theme=&quot;dark&quot; data-dnt=&quot;true&quot;&gt;&lt;a href=&quot;https://twitter.com/sudoingX/status/2049056800759042459&quot;&gt;&lt;/a&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;Club3090: &lt;a href=&quot;https://github.com/noonghunna/club-3090&quot;&gt;https://github.com/noonghunna/club-3090&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But people on twitter post metrics that are engineered to grab your attention, and are not representative of how these models perform on tasks that I&#39;d like to do.
Example:&lt;/p&gt;
&lt;div class=&quot;tweet-embed&quot;&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-theme=&quot;dark&quot; data-dnt=&quot;true&quot;&gt;&lt;a href=&quot;https://twitter.com/sudoingX/status/2050656277207089406&quot;&gt;&lt;/a&gt;&lt;/blockquote&gt;&lt;/div&gt;
&lt;div class=&quot;tweet-embed&quot;&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-theme=&quot;dark&quot; data-dnt=&quot;true&quot;&gt;&lt;a href=&quot;https://twitter.com/largePrawn/status/2050431948766814553&quot;&gt;&lt;/a&gt;&lt;/blockquote&gt;&lt;/div&gt;
&lt;p&gt;Its cool, but its useless. Also, hermes is a pretty good full-featured harness, but my overwhelmed self likes the simpler Pi.&lt;/p&gt;
&lt;p&gt;Here&#39;s a weekend experiment I ran.&lt;/p&gt;
&lt;h2&gt;Setup&lt;/h2&gt;
&lt;p&gt;How I ran Qwen3.6-27b:&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;./build/bin/llama-server &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
  &lt;span class=&quot;token parameter variable&quot;&gt;-hf&lt;/span&gt; unsloth/Qwen3.6-27B-GGUF:Q4_K_M &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
  &lt;span class=&quot;token parameter variable&quot;&gt;-ngl&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;99&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
  &lt;span class=&quot;token parameter variable&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;131072&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
  &lt;span class=&quot;token parameter variable&quot;&gt;-np&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
  &lt;span class=&quot;token parameter variable&quot;&gt;-fa&lt;/span&gt; on &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
  &lt;span class=&quot;token parameter variable&quot;&gt;-ctk&lt;/span&gt; q8_0 &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
  &lt;span class=&quot;token parameter variable&quot;&gt;-ctv&lt;/span&gt; turbo3 &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
  &lt;span class=&quot;token parameter variable&quot;&gt;--metrics&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
  &lt;span class=&quot;token parameter variable&quot;&gt;--jinja&lt;/span&gt; --chat-template-kwargs &lt;span class=&quot;token string&quot;&gt;&#39;{&quot;enable_thinking&quot;: false}&#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Context length of 128K tokens, flash attention, asymmetric KV cache with key quantization of q8_0 and value quantization set to Turbo3 (thanks to &lt;a href=&quot;https://github.com/TheTom/turboquant_plus&quot;&gt;Tom Turney&lt;/a&gt;).
Also I turned thinking off. I&#39;ve noticed that Qwen models seem to overthink and get stuck in loops. It also fills the context window that pushes these models to the &amp;quot;dumb zone&amp;quot; quicker.&lt;/p&gt;
&lt;p&gt;I used Matt Pocock&#39;s &lt;a href=&quot;https://www.aihero.dev/my-grill-me-skill-has-gone-viral&quot;&gt;/grill-me skill &lt;/a&gt; to get to a shared understanding of the plan for this website. I ran it through Qwen and here&#39;s the entire conversation I had with it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://ishan.sh/sessions/ishandotsh-grill-me-pt1.html&quot;&gt;Initial session&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ishan.sh/sessions/ishandotsh-grill-me-pt2.html&quot;&gt;Expansion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I gave the exact same plan to gpt5.5 and qwen3.6 running via the pi-coding-agent harness. The full conversations are here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://ishan.sh/sessions/gpt5.5-session.html&quot;&gt;jipity 5.5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ishan.sh/sessions/qwen3.6-session.html&quot;&gt;qwen3.6&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Results&lt;/h2&gt;
&lt;p&gt;GPT5.5 obviously nailed it first try. And it completed the task the fastest.&lt;/p&gt;
&lt;p&gt;Qwen3.6&#39;s implementation was pretty good. It made a lot of mistakes, took way longer to get there, but it got there! It wasn&#39;t fun or delightful like I&#39;ve come to expect from frontier labs, but my PC isn&#39;t exactly a frontier lab. It looked like this (notice the spelling mistake &amp;quot;Ischan&amp;quot; in the subheading):&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/please-be-good-local-qwen-3.6/qwen3.6-output.png&quot; alt=&quot;Qwen Output&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And if you needed any proof that turning thinking off was the right move, here&#39;s what Qwen3.6+Thinking built with the exact same prompt and plan:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/please-be-good-local-qwen-3.6/qwen3.6-th-output.png&quot; alt=&quot;Qwen Thinking Output&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I (gpt-5.5) built a &lt;a href=&quot;https://github.com/ishandotsh/llamacpp-metrics&quot;&gt;small tool to track llamacpp&#39;s performance&lt;/a&gt;.
The performance was okay in the beginning but as context increased it slowed way down:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Run length:&lt;/strong&gt; 4142s wall (~69 min). 3942s active, 200s idle.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Output:&lt;/strong&gt; 46,054 tokens generated, 277,568 prompt tokens processed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Decode rate degraded over the run:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;First sample: 28.08 tok/s&lt;/li&gt;
&lt;li&gt;Final sample: 16.19 tok/s (-42%)&lt;/li&gt;
&lt;li&gt;First-half average: 23.44 tok/s&lt;/li&gt;
&lt;li&gt;Second-half average: 17.13 tok/s&lt;/li&gt;
&lt;li&gt;Min: 16.19, Max: 28.09 (across 403 ten-second samples)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As the KV cache fills, decode gets cheaper-per-step but slower-per-token, and the re-prompting (qwen kept re-reading files) of long files makes prompt-eval the dominant cost. By the back half of the run, throughput is below 60% of the cold-start rate. And Qwen made a lot of smaller mistakes. Claude Opus 4.6 (xhigh)&#39;s &lt;a href=&quot;https://ishan.sh/sessions/qwen3.6-vs-gpt5.5-report/&quot;&gt;analysis of the performance and code differences&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Using local models reminds me of when I was younger playing GTA-V on my old PC, slightly changing settings to maximize how good the game looked vs having a playable FPS. Using frontier models is like when I got a good enough PC to not care about all that and got on with playing my game.&lt;/p&gt;
]]></content>
    </entry>
  
    <entry>
      <title>Isaac Sim Accelerated: Part 3</title>
      <link href="https://ishan.sh/posts/isaac-sim-acc-part-3/"/>
      <updated>2024-07-03T00:00:00.000Z</updated>
      <id>https://ishan.sh/posts/isaac-sim-acc-part-3/</id>
      <summary>Part 3 of the Isaac Sim Series focuses on connecting the robot and its sensors to ROS1 Noetic using action graphs. I&#39;ve written utility functions that you can use to simplify building the action graphs that can get really tedious to make.</summary>
      <content type="html"><![CDATA[&lt;p&gt;Git Repository: &lt;a href=&quot;https://github.com/ishandotsh/isaac-sim-starter&quot;&gt;https://github.com/ishandotsh/isaac-sim-starter&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Recap&lt;/h2&gt;
&lt;p&gt;Once all sensors are attached to the robot from &lt;a href=&quot;https://ishan.sh/posts/isaac-sim-acc-part-2&quot;&gt;Part 2&lt;/a&gt;, we can access the sensor data through ROS using action graphs.&lt;/p&gt;
&lt;h2&gt;Connecting to ROS (ActionGraph)&lt;/h2&gt;
&lt;p&gt;With the environment, robot, and sensors ready we can start publishing topics. The way to do that in Isaac is to use action graphs - similar to Unity, but for robots.&lt;/p&gt;
&lt;p&gt;Go through the ROS tutorials on the Isaac Sim documentation or you’ll feel lost in this section: &lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/ros_tutorials/index.html&quot;&gt;https://docs.omniverse.nvidia.com/isaacsim/latest/ros_tutorials/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;BTW, this is the cheatsheet part of the article. Writing out these actiongraphs is kind of tedious.&lt;/p&gt;
&lt;h3&gt;Cameras&lt;/h3&gt;
&lt;p&gt;Let’s build an actiongraph that publishes the camera’s image to /camera/color and camera info to /camera/camera_info. Here’s how to do it using the GUI (annoying): &lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/ros_tutorials/tutorial_ros_camera.html&quot;&gt;https://docs.omniverse.nvidia.com/isaacsim/latest/ros_tutorials/tutorial_ros_camera.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/isaac-sim-acc-part-3/actiongraph.png&quot; alt=&quot;actiongraph&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In python (also annoying, but less mouse clicking):&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Enable ROS1 Bridge extension (for ROS1 Nodes)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;isaac&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;core&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;utils&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;extensions &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; enable_extension
enable_extension&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;core &lt;span class=&quot;token keyword&quot;&gt;as&lt;/span&gt; og
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; usdrt&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Sdf
controller &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Controller
keys &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Keys

camera_graph_config &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;graph_path&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/CameraActionGraph&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;evaluator_name&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;execution&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# https://docs.omniverse.nvidia.com/kit/docs/omni.graph/latest/omni.graph.core/omni.graph.core.Controller.html#omni.graph.core.Controller.edit&lt;/span&gt;

camera_graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; _&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; _&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; _ &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;edit&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
     camera_graph_config&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
          keys&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CREATE_NODES&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;OnPlaybackTick&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.graph.action.OnPlaybackTick&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CreateRenderProduct&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.core_nodes.IsaacCreateRenderProduct&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CameraHelperRgb&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;   &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1CameraHelper&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CameraHelperInfo&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1CameraHelper&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          keys&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CONNECT&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;OnPlaybackTick.outputs:tick&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;CreateRenderProduct.inputs:execIn&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CreateRenderProduct.outputs:execOut&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;CameraHelperRgb.inputs:execIn&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CreateRenderProduct.outputs:execOut&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;CameraHelperInfo.inputs:execIn&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CreateRenderProduct.outputs:renderProductPath&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;CameraHelperRgb.inputs:renderProductPath&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CreateRenderProduct.outputs:renderProductPath&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;CameraHelperInfo.inputs:renderProductPath&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          keys&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;SET_VALUES&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CreateRenderProduct.inputs:cameraPrim&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;usdrt&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Sdf&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Path&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;camera_path&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CameraHelperRgb.inputs:frameId&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;camera&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CameraHelperRgb.inputs:topicName&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;camera/color&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CameraHelperRgb.inputs:type&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;rgb&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CameraHelperInfo.inputs:frameId&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;camera&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CameraHelperInfo.inputs:topicName&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;camera/camera_info&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;CameraHelperInfo.inputs:type&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;camera_info&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;     
     &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-bash&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;$ rostopic list
/camera/camera_info
/camera/color
/rosout
/rosout_agg&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In RVIZ:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/isaac-sim-acc-part-3/rviz.png&quot; alt=&quot;rviz&quot; /&gt;&lt;/p&gt;
&lt;p&gt;What I like to do is build the simplest graph then add nodes using helper functions. All helper functions are available at utils/utils.py in the repo.&lt;/p&gt;
&lt;p&gt;Here’s the simplest graph with a OnPlaybackTick node, and a publish ROS Clock node:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;graph_config &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;graph_path&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/ActionGraph&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;evaluator_name&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;execution&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; _&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; _&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; _ &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;edit&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
     graph_config&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
          keys&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CREATE_NODES&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;OnPlaybackTick&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.graph.action.OnPlaybackTick&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadSimTime&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.core_nodes.IsaacReadSimulationTime&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;PublishClock&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1PublishClock&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Keys&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CONNECT&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;OnPlaybackTick.outputs:tick&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;PublishClock.inputs:execIn&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadSimTime.outputs:simulationTime&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;PublishClock.inputs:timeStamp&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Keys&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;SET_VALUES&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;PublishClock.inputs:topicName&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/clock&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
     &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/isaac-sim-acc-part-3/simple-ag.png&quot; alt=&quot;simple-ag&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then use helper functions to attach any number of cameras/lidars. Note that these don&#39;t &amp;quot;add&amp;quot; the sensor to the robot, they add the action graph nodes to the action graph.&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;add_camera&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
        graph&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        camera_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# full path to camera prim&lt;/span&gt;
        camera_name&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# node identifier (not related to ros)&lt;/span&gt;
        colorFrameId&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        colorTopicName&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        infoFrameId&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        infoTopicName&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        depthFrameId &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        depthTopicName &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;

    isDepthCam &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;False&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;depthFrameId&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;depthTopicName&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;You must provide both depthFrameId and depthTopicName to create a depth camera&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Skipping creating depth camera&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        isDepthCam &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;False&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;depthFrameId&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        isDepthCam &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;True&lt;/span&gt;

    graph_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_path_to_graph&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    tick_node_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/OnPlaybackTick&#39;&lt;/span&gt;
    create_render_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/CreateRenderProduct&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; camera_name
    rgb_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/CameraHelperRgb&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; camera_name
    info_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/CameraHelperInfo&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; camera_name
    
    controller &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Controller
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;create_render_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.core_nodes.IsaacCreateRenderProduct&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;rgb_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;    &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1CameraHelper&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;info_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;   &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1CameraHelper&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tick_node_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:tick&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;create_render_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;create_render_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:execOut&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;rgb_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;create_render_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:execOut&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;info_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;create_render_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:renderProductPath&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; rgb_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:renderProductPath&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;create_render_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:renderProductPath&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; info_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:renderProductPath&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;create_render_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:cameraPrim&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;usdrt&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Sdf&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Path&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;camera_path&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;rgb_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:frameId&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;colorFrameId&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;info_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:frameId&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;infoFrameId&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;rgb_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:topicName&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;colorTopicName&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;info_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:topicName&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;infoTopicName&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;rgb_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:type&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;rgb&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;info_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:type&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;camera_info&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;isDepthCam&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        depth_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/CameraHelperDepth&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; camera_name
        controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;depth_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;   &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1CameraHelper&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;create_render_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:execOut&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;depth_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;create_render_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:renderProductPath&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; depth_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:renderProductPath&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;depth_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:frameId&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;depthFrameId&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;depth_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:topicName&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;depthTopicName&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;depth_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:type&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;depth&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Lets add the camera through this helper function:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;add_camera&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; camera_path&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;camera_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; camera_name&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;my_camera&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
                    colorFrameId&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;camera&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; colorTopicName&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;camera/color&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          infoFrameId&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;camera&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; infoTopicName&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;camera/camera_info&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/isaac-sim-acc-part-3/camera-ag.png&quot; alt=&quot;camera-ag&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Lidar&lt;/h3&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;add_lidar&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
        graph&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        lidar_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        lidar_name&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        lidarFrameId&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        lidarTopicName&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        lidarType &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;laser_scan&quot;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# or point_cloud&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    graph_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_path_to_graph&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    tick_node_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/OnPlaybackTick&#39;&lt;/span&gt;
    create_render_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/CreateRenderProduct&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; lidar_name
    lidar_helper_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/LidarHelper&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; lidar_name

    controller &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Controller
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;create_render_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.core_nodes.IsaacCreateRenderProduct&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;lidar_helper_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;    &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1RtxLidarHelper&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tick_node_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:tick&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;create_render_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;create_render_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:execOut&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;lidar_helper_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;create_render_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:renderProductPath&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; lidar_helper_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:renderProductPath&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;create_render_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:cameraPrim&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;usdrt&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Sdf&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Path&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;lidar_path&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;lidar_helper_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:frameId&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;lidarFrameId&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;lidar_helper_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:topicName&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;lidarTopicName&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;lidar_helper_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:type&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;lidarType&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;add_lidar&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; lidar_parent&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;lidar_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;my_lidar&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
          &lt;span class=&quot;token string&quot;&gt;&quot;laser&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;scan&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;laser_scan&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Notice the lidar path needs to be the full path: &lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# /turtlebot3_waffle_pi/base_scan/lidar&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# We defined those earlier when we added the lidar&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I spawned in the Simple Room environment and this is what I see in RVIZ:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/isaac-sim-acc-part-3/lidar_rviz.png&quot; alt=&quot;lidar_rviz&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the spirit of completeness, here’s how to publish PhysX Lidar output via actiongraph in python. This is not a helper function, if you want to use this add it to the simplest action graph we created at the start.&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# This won&#39;t work if the original ActionGraph is also uncommented&lt;/span&gt;
og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;edit&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
     &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;graph_path&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/ActionGraph&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;evaluator_name&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;execution&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
          og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Keys&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CREATE_NODES&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadSimTime&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.core_nodes.IsaacReadSimulationTime&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;OnPlaybackTick&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.graph.action.OnPlaybackTick&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;PublishClock&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1PublishClock&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;

               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadLidar&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.range_sensor.IsaacReadLidarBeams&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;PublishLidar&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1PublishLaserScan&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Keys&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CONNECT&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;OnPlaybackTick.outputs:tick&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;PublishClock.inputs:execIn&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadSimTime.outputs:simulationTime&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;PublishClock.inputs:timeStamp&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;OnPlaybackTick.outputs:tick&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;ReadLidar.inputs:execIn&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadSimTime.outputs:simulationTime&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;PublishLidar.inputs:timeStamp&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadLidar.outputs:execOut&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;               &lt;span class=&quot;token string&quot;&gt;&quot;PublishLidar.inputs:execIn&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadLidar.outputs:azimuthRange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;          &lt;span class=&quot;token string&quot;&gt;&quot;PublishLidar.inputs:azimuthRange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadLidar.outputs:depthRange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;            &lt;span class=&quot;token string&quot;&gt;&quot;PublishLidar.inputs:depthRange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadLidar.outputs:horizontalFov&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;         &lt;span class=&quot;token string&quot;&gt;&quot;PublishLidar.inputs:horizontalFov&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadLidar.outputs:horizontalResolution&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;token string&quot;&gt;&quot;PublishLidar.inputs:horizontalResolution&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadLidar.outputs:intensitiesData&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;       &lt;span class=&quot;token string&quot;&gt;&quot;PublishLidar.inputs:intensitiesData&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadLidar.outputs:linearDepthData&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;       &lt;span class=&quot;token string&quot;&gt;&quot;PublishLidar.inputs:linearDepthData&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadLidar.outputs:numCols&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;               &lt;span class=&quot;token string&quot;&gt;&quot;PublishLidar.inputs:numCols&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadLidar.outputs:numRows&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;               &lt;span class=&quot;token string&quot;&gt;&quot;PublishLidar.inputs:numRows&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadLidar.outputs:rotationRate&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;          &lt;span class=&quot;token string&quot;&gt;&quot;PublishLidar.inputs:rotationRate&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Keys&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;SET_VALUES&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;PublishClock.inputs:topicName&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/clock&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ReadLidarB.inputs:lidarPrim&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/turtlebot3_waffle_pi/base_scan/lidar&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;PublishLidarB.inputs:frameId&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;laser&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;PublishLidarB.inputs:topicName&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;scan&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
          &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
     &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;IMU&lt;/h3&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;add_imu&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; imu_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; imuFrameId&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; imuTopicName&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
     graph_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_path_to_graph&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     tick_node_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/OnPlaybackTick&#39;&lt;/span&gt;
     ros_clock_node_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/ReadSimTime&#39;&lt;/span&gt;
     read_imu_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/ReadIMU&#39;&lt;/span&gt;
     pub_imu_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/PublishIMU&#39;&lt;/span&gt;

     controller &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Controller
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;read_imu_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.sensor.IsaacReadIMU&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;pub_imu_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1PublishImu&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tick_node_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:tick&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; read_imu_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;ros_clock_node_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:simulationTime&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; pub_imu_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:timeStamp&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;read_imu_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:execOut&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; pub_imu_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;read_imu_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:linAcc&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; pub_imu_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:linearAcceleration&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;read_imu_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:angVel&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; pub_imu_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:angularVelocity&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;read_imu_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:orientation&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; pub_imu_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:orientation&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;read_imu_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:imuPrim&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;usdrt&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Sdf&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Path&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;imu_path&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;pub_imu_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:frameId&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;imuFrameId&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;pub_imu_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:topicName&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;imuTopicName&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

add_imu&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; imu_parent&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;/&#39;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;imu_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;IMU&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;imu&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Teleop&lt;/h3&gt;
&lt;p&gt;This is where the concept of Articulations comes in. You have to identify the articulation root for the robot, in this case its “base_footprint”. In custom robots not imported via URDF, you’ll have to add the ArticulationAPI yourself. The joint_names parameter is the same as the ones we applied the DriveAPI to, so we can just pass that same list in. More info: &lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/ros_tutorials/tutorial_ros_drive_turtlebot.html&quot;&gt;https://docs.omniverse.nvidia.com/isaacsim/latest/ros_tutorials/tutorial_ros_drive_turtlebot.html&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; typing &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; List
&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;add_diff_teleop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; robot_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; joint_names&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;List&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; max_linear_speed&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; wheel_distance&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; wheel_radius&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; topic_name&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
     graph_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_path_to_graph&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     tick_node_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/OnPlaybackTick&#39;&lt;/span&gt;
     sub_twist_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/SubscribeTwistDiff&#39;&lt;/span&gt;
     scale_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/ScaleWheel&#39;&lt;/span&gt;
     break_ang_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/Break3_VectorAngVel&#39;&lt;/span&gt;
     break_lin_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/Break3_VectorLinVel&#39;&lt;/span&gt;
     diff_contr_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/DiffController&#39;&lt;/span&gt;
     art_contr_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/ArticulationController&#39;&lt;/span&gt;

         controller &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Controller
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;sub_twist_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1SubscribeTwist&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;scale_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.core_nodes.OgnIsaacScaleToFromStageUnit&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;break_ang_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.graph.nodes.BreakVector3&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;break_lin_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.graph.nodes.BreakVector3&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;diff_contr_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.wheeled_robots.DifferentialController&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;art_contr_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.core_nodes.IsaacArticulationController&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tick_node_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:tick&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;sub_twist_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tick_node_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:tick&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;art_contr_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;sub_twist_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:execOut&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;diff_contr_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;sub_twist_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:angularVelocity&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;break_ang_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:tuple&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;sub_twist_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:linearVelocity&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;scale_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:value&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;scale_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:result&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;break_lin_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:tuple&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;break_ang_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:z&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;diff_contr_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:angularVelocity&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;break_lin_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:x&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;diff_contr_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:linearVelocity&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;diff_contr_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:velocityCommand&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;art_contr_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:velocityCommand&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;sub_twist_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:topicName&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;topic_name&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;diff_contr_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:maxLinearSpeed&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;max_linear_speed&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;diff_contr_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:wheelDistance&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;wheel_distance&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;diff_contr_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:wheelRadius&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;wheel_radius&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;art_contr_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:usePath&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;art_contr_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:robotPath&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_path&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;art_contr_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:jointNames&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;joint_names&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

add_diff_teleop&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;/base_footprint&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; velocity_driven_joints&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.26&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.066&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;cmd_vel&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Odom&lt;/h3&gt;
&lt;p&gt;Publish odom→base_footprint transform on /tf and odometry on /odom:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;add_odometry&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; ogn_node_name&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; chassis_prim_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; chassis_frame_id&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; odom_frame_id&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; odom_topic_name&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
     graph_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_path_to_graph&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     tick_node_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/OnPlaybackTick&#39;&lt;/span&gt;
     ros_clock_node_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/ReadSimTime&#39;&lt;/span&gt;
     compute_odom_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; ogn_node_name
     pub_odom_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/Pub&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; ogn_node_name
     pub_raw_tf_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;PublishRawTFTree&#39;&lt;/span&gt;

     controller &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Controller
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;compute_odom_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.core_nodes.IsaacComputeOdometry&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;pub_odom_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1PublishOdometry&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;pub_raw_tf_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1PublishRawTransformTree&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tick_node_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:tick&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;compute_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tick_node_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:tick&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;pub_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;ros_clock_node_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:simulationTime&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;pub_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:timeStamp&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;compute_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:execOut&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;pub_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;compute_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:angularVelocity&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;pub_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:angularVelocity&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;compute_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:linearVelocity&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;pub_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:linearVelocity&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;compute_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:orientation&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;pub_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:orientation&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;compute_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:position&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;pub_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:position&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;compute_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:execOut&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;pub_raw_tf_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;compute_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:orientation&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;pub_raw_tf_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:rotation&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;compute_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:position&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;pub_raw_tf_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:translation&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;ros_clock_node_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:simulationTime&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;pub_raw_tf_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:timeStamp&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;compute_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:chassisPrim&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;chassis_prim_path&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;pub_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:chassisFrameId&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;chassis_frame_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;pub_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:odomFrameId&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;odom_frame_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;pub_odom_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:topicName&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;odom_topic_name&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;pub_raw_tf_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:childFrameId&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;chassis_frame_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;pub_raw_tf_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:parentFrameId&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;odom_frame_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;pub_raw_tf_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:topicName&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;tf&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

add_odometry&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;ComputeOdometry&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;/base_footprint&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     &lt;span class=&quot;token string&quot;&gt;&quot;base_footprint&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;odom&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;odom&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;TF (tf and tf_static)&lt;/h3&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; typing &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; Optional
&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;add_tf&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; ogn_node_name&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; target_prims&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; topic_name &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;tf&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; parent_prim&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Optional&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; namespace&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Optional&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
     graph_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_path_to_graph&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     tick_node_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/OnPlaybackTick&#39;&lt;/span&gt;
     ros_clock_node_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/ReadSimTime&#39;&lt;/span&gt;
     publish_tf_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; graph_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; ogn_node_name

     controller &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; og&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Controller
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;create_node&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;publish_tf_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;omni.isaac.ros_bridge.ROS1PublishTransformTree&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tick_node_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:tick&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;publish_tf_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:execIn&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;connect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;ros_clock_node_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.outputs:simulationTime&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; publish_tf_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:timeStamp&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

     controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;publish_tf_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:targetPrims&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;target_prims&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;namespace &lt;span class=&quot;token keyword&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;publish_tf_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:nodeNamespace&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;namespace&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;parent_prim &lt;span class=&quot;token keyword&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          controller&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;attribute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;publish_tf_path&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;.inputs:parentPrim&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;parent_prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Isaac Sim will automatically parse links to publish the TF for the entire robot given the articulation root of the robot as the target_prim:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;add_tf&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;PubTF&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; target_prims&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;/base_link&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/isaac-sim-acc-part-3/tree1.png&quot; alt=&quot;tree1&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This will however, publish with “world” as the root node. To prevent that, build the TF tree manually. A lot of ROS packages require publishing of static TFs on /tf_static. This is possible to do through this helper too:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# manual tf tree&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# base_footprint -&gt; base_link on /tf_static&lt;/span&gt;
add_tf&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;PubTFBaseStatic&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;/base_link&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;tf_static&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;/base_footprint&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# defines base_link -&gt; (all other joints) on /tf_static&lt;/span&gt;
static_links &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;
     &lt;span class=&quot;token string&quot;&gt;&quot;camera_link&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;caster_back_left_link&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     &lt;span class=&quot;token string&quot;&gt;&quot;caster_back_right_link&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;imu_link&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;base_scan&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
path_prefix &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/&#39;&lt;/span&gt;
static_links_paths &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;path_prefix &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; link &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; link &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; static_links&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

add_tf&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;PubTFStatic&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; static_links_paths&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;tf_static&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;/base_link&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# base_link -&gt; wheel links on /tf&lt;/span&gt;
wheel_links &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;wheel_left_link&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;wheel_right_link&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
wheel_links_paths &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;path_prefix &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; link &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; link &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; wheel_links&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

add_tf&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;graph&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;PubTFWheels&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; wheel_links_paths&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;tf&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;/base_link&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The result is essentially the same, you can add the camera’s links back through the helper too.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/isaac-sim-acc-part-3/tree_manual.png&quot; alt=&quot;tree_manual&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Wrap up&lt;/h2&gt;
&lt;p&gt;Run the script&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;roscore

&lt;span class=&quot;token comment&quot;&gt;# in another terminal &lt;/span&gt;
./python.sh ./isaac-sim-starter/isaac.py

&lt;span class=&quot;token comment&quot;&gt;# check ros stuff&lt;/span&gt;
rosnode list
rostopic list

&lt;span class=&quot;token comment&quot;&gt;# check RVIZ&lt;/span&gt;
rviz&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With that, you have a working robot in Isaac Sim with the foundational work done. I believe this is a good jumping off point to build your simulation. I&#39;ll list out some features that I wanted to add to this series but haven&#39;t yet:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Custom action graph nodes&lt;/li&gt;
&lt;li&gt;Script nodes&lt;/li&gt;
&lt;li&gt;Cloner&lt;/li&gt;
&lt;li&gt;Dynamic Environments&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;and some features that I&#39;d like to see added to Isaac Sim:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An API for OnShape Importer&lt;/li&gt;
&lt;li&gt;Easier method to add retro-reflective material to objects for lidars&lt;/li&gt;
&lt;li&gt;A fix for RTX Lidar max_angle not working&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you&#39;ve worked on any of the listed items and could point me to your work &lt;a href=&quot;https://ishan.sh/contact&quot;&gt;contact me&lt;/a&gt;&lt;/p&gt;
]]></content>
    </entry>
  
    <entry>
      <title>Isaac Sim Accelerated: Part 2</title>
      <link href="https://ishan.sh/posts/isaac-sim-acc-part-2/"/>
      <updated>2024-07-02T00:00:00.000Z</updated>
      <id>https://ishan.sh/posts/isaac-sim-acc-part-2/</id>
      <summary>Part 2 of the Isaac Sim Series. I cover importing a robot through URDF, setting up its joint properties via python, and provide snippets for adding lidar, camera, and imu sensors.</summary>
      <content type="html"><![CDATA[&lt;p&gt;Git Repository: &lt;a href=&quot;https://github.com/ishandotsh/isaac-sim-starter&quot;&gt;https://github.com/ishandotsh/isaac-sim-starter&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Recap&lt;/h2&gt;
&lt;p&gt;Make sure you&#39;ve set up the base script from &lt;a href=&quot;https://ishan.sh/posts/isaac-sim-acc-part-1&quot;&gt;Part 1&lt;/a&gt; and ran it.&lt;/p&gt;
&lt;h2&gt;Getting your robot in the correct format&lt;/h2&gt;
&lt;p&gt;Depending on your situation, one of these will be the way to get your robot description in USD:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Import existing URDF&lt;/li&gt;
&lt;li&gt;Rig a model inside Isaac Sim (&lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/advanced_tutorials/tutorial_advanced_rigging_robot.html&quot;&gt;Rigging Robots&lt;/a&gt; section of the documentation)&lt;/li&gt;
&lt;li&gt;Import a CAD model from OnShape&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Import URDF&lt;/h3&gt;
&lt;p&gt;💡 IMPORTANT: Any mesh paths in the URDF need to be replaced with full paths (or you can source the workspace containing the description before launching Isaac)&lt;/p&gt;
&lt;p&gt;Here’s how to import a URDF through python:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;importer&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;urdf &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; _urdf

status&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; robot_import_config &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;kit&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;commands&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;execute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;URDFCreateImportConfig&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
robot_import_config&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;merge_fixed_joints &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;False&lt;/span&gt;
robot_import_config&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;convex_decomp &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;True&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# Collision&lt;/span&gt;
robot_import_config&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;import_inertia_tensor &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;True&lt;/span&gt;
robot_import_config&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;fix_base &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;False&lt;/span&gt;
robot_import_config&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;distance_scale &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# &lt;/span&gt;
robot_import_config&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;default_drive_type &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; _urdf&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;UrdfJointTargetType&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;JOINT_DRIVE_NONE

robot_urdf_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/PATH/isaac-sim-starter/assets/turtlebot3_waffle_pi/urdf/turtlebot3_waffle_pi.urdf&quot;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# change this&lt;/span&gt;
status&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; robot_prim_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;kit&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;commands&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;execute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
     &lt;span class=&quot;token string&quot;&gt;&quot;URDFParseAndImportFile&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     urdf_path&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;robot_urdf_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     import_config&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;robot_import_config&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     get_articulation_root&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To import a urdf through the GUI, follow NVIDIA’s tutorial: &lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/ros_tutorials/tutorial_ros_turtlebot.html&quot;&gt;https://docs.omniverse.nvidia.com/isaacsim/latest/ros_tutorials/tutorial_ros_turtlebot.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;💡 URDF Importer Docs:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://docs.omniverse.nvidia.com/kit/docs/omniverse-urdf-importer/latest/source/extensions/omni.importer.urdf/docs/index.html&quot;&gt;https://docs.omniverse.nvidia.com/kit/docs/omniverse-urdf-importer/latest/source/extensions/omni.importer.urdf/docs/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The next step is to set the joint properties for the castor wheels and the drive wheels. The most important ones are joint friction, max velocity, damping, and stiffness. In addition, the drive wheel joints need to have the DriveAPI attached to them.&lt;/p&gt;
&lt;p&gt;This is the full code, breakdown is below it:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; typing &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; List

velocity_driven_joints &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;wheel_left_joint&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;wheel_right_joint&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
position_driven_joints &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
undriven_joints &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;get_robot_description&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Usd&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Usd&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Prim&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
     robot_description &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

     &lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;gather_paths&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;prim&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Usd&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; child_prim &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetAllChildren&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
               &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; child_prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetTypeName&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Mesh&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Shader&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Material&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Scope&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
               &lt;span class=&quot;token comment&quot;&gt;# print(child_prim.GetPath().pathString, &quot; -&gt; &quot;, child_prim.GetTypeName())&lt;/span&gt;
               robot_description&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;child_prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
               gather_paths&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;child_prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

     gather_paths&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; robot_description

robot_prim &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; stage&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimAtPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim_path&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetParent&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
robot_tree &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; get_robot_description&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Set velocity, position, or undriven joints&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; prim &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; robot_tree&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
     prim_type &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetTypeName&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     prim_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; prim_type &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;PhysicsRevoluteJoint&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;token comment&quot;&gt;# print(&quot;At &quot;, prim.GetPath().pathString, end=&quot; &quot;)&lt;/span&gt;
          prim_name &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; prim_path&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;pathString&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;split&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strip&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; prim_name &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; velocity_driven_joints&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;token comment&quot;&gt;# print(&quot;-&gt; Setting Velocity&quot;)&lt;/span&gt;
          drive &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; UsdPhysics&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;DriveAPI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;prim&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;angular&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
          drive&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetStiffnessAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
          drive&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetDampingAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;token keyword&quot;&gt;elif&lt;/span&gt; prim_name &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; position_driven_joints&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;token comment&quot;&gt;# print(&quot;-&gt; Setting Position&quot;)&lt;/span&gt;
          drive &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; UsdPhysics&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;DriveAPI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;prim&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;angular&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
          drive&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetStiffnessAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
          drive&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetDampingAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;token comment&quot;&gt;# print(&quot;-&gt; Setting Undriven&quot;)&lt;/span&gt;
          &lt;span class=&quot;token comment&quot;&gt;# print(&quot;Prop Names: &quot;)&lt;/span&gt;
          &lt;span class=&quot;token comment&quot;&gt;# print(prim.GetPropertyNames())&lt;/span&gt;
          prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;RemoveAPI&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;UsdPhysics&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;DriveAPI&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;angular&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
          prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetProperty&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;physxJoint:jointFriction&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.001&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
          prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetProperty&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;physxJoint:maxJointVelocity&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;4.0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Let me break it down for you&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/isaac-sim-acc-part-2/dance-skeleton.gif&quot; alt=&quot;break it down&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;get_robot_description&lt;/code&gt; method traverses the prim paths of the robot and returns a flat list of all prims. This is not strictly necessary, and a similar method is probably already implemented in the OpenUSD module but this was easier than reading the documentation for me. If you find it, let me know - I&#39;ll update this, and credit you.&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;get_robot_description&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Usd&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; List&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;Usd&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Prim&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
     robot_description &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

     &lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;gather_paths&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;prim&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Usd&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; child_prim &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetAllChildren&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
               &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; child_prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetTypeName&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Mesh&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Shader&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Material&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Scope&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
               &lt;span class=&quot;token comment&quot;&gt;# print(child_prim.GetPath().pathString, &quot; -&gt; &quot;, child_prim.GetTypeName())&lt;/span&gt;
               robot_description&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;child_prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
               gather_paths&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;child_prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

     gather_paths&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; robot_description

robot_prim &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; stage&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimAtPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim_path&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetParent&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
robot_tree &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; get_robot_description&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The joints lists take in the name of the joints defined in the URDF. Then we loop through the robot&#39;s prims and find any &lt;code&gt;PhysXRevoluteJoint&lt;/code&gt;s and apply the appropriate API and properties. Any joint tuning you may have done by hand in the GUI can be added here provided you can find out the property name (there&#39;s a method for that in the comments).&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/advanced_tutorials/tutorial_advanced_joint_tuning.html&quot;&gt;joint tuning guide&lt;/a&gt; is essential for this process. You can also look up the &lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/advanced_tutorials/tutorial_advanced_rigging_robot.html&quot;&gt;rigging robots section&lt;/a&gt; of the documentation.&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; typing &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; List

velocity_driven_joints &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;wheel_left_joint&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;wheel_right_joint&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
position_driven_joints &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
undriven_joints &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Set velocity, position, or undriven joints&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; prim &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; robot_tree&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
     prim_type &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetTypeName&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     prim_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; prim_type &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;PhysicsRevoluteJoint&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;token comment&quot;&gt;# print(&quot;At &quot;, prim.GetPath().pathString, end=&quot; &quot;)&lt;/span&gt;
          prim_name &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; prim_path&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;pathString&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;split&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strip&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; prim_name &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; velocity_driven_joints&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;# print(&quot;-&gt; Setting Velocity&quot;)&lt;/span&gt;
            drive &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; UsdPhysics&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;DriveAPI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;prim&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;angular&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            drive&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetStiffnessAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            drive&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetDampingAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;elif&lt;/span&gt; prim_name &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; position_driven_joints&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;# print(&quot;-&gt; Setting Position&quot;)&lt;/span&gt;
            drive &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; UsdPhysics&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;DriveAPI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;prim&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;angular&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            drive&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetStiffnessAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            drive&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetDampingAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;# print(&quot;-&gt; Setting Undriven&quot;)&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;# print(&quot;Prop Names: &quot;)&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;# print(prim.GetPropertyNames())&lt;/span&gt;
            prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;RemoveAPI&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;UsdPhysics&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;DriveAPI&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;angular&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetProperty&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;physxJoint:jointFriction&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.001&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetProperty&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;physxJoint:maxJointVelocity&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;4.0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Running the script till here:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/isaac-sim-acc-part-2/urdf-import.jpg&quot; alt=&quot;urdf-import&quot; /&gt;&lt;/p&gt;
&lt;p&gt;and the joint properties:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/isaac-sim-acc-part-2/joint-props.png&quot; alt=&quot;joint-props&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Attaching Sensors&lt;/h2&gt;
&lt;p&gt;This section covers attaching sensors to the robot. I’ll discuss publishing the data through ROS in the next post.&lt;/p&gt;
&lt;h3&gt;Lidars&lt;/h3&gt;
&lt;p&gt;We have 2 options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/features/sensors_simulation/ext_omni_isaac_range_sensor.html#isaac-sim-physx-lidar-example&quot;&gt;PhysX Lidar&lt;/a&gt; → no intensity data: 255 for hit, 0 for no hit&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/features/sensors_simulation/isaac_sim_sensors_rtx_based_lidar.html&quot;&gt;RTX Lidar&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;RTX Lidar support is way better than PhysX, however clipping the max_angle of RTX Lidars was broken at the time of writing this post. There are workarounds for that but hopefully NVIDIA will fix it soon.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;lidar_path&lt;/code&gt;: name of the lidar prim (can be anything)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;lidar_parent&lt;/code&gt;: prim name of the robot&#39;s lidar link&lt;/li&gt;
&lt;li&gt;&lt;code&gt;lidar_config&lt;/code&gt;: pre-configure JSON files. Read more in the &lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/features/sensors_simulation/isaac_sim_sensors_rtx_based_lidar.html#lidar-config-files&quot;&gt;documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;lidar_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;lidar&#39;&lt;/span&gt;
lidar_parent &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/base_scan&#39;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# RTX&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# $ISAAC_PATH/exts/omni.isaac.sensor/data/lidar_configs for a list of other configs&lt;/span&gt;
lidar_config &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Example_Rotary&quot;&lt;/span&gt;

_&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; sensor &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;kit&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;commands&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;execute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
     &lt;span class=&quot;token string&quot;&gt;&quot;IsaacSensorCreateRtxLidar&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     path&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;lidar_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     parent&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;lidar_parent&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     config&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;lidar_config&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     orientation&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;Gf&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Quatd&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1.0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# W, X, Y, Z&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# PhysX&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# _, _ = omni.kit.commands.execute(&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      &quot;RangeSensorCreateLidar&quot;,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      path=lidar_path,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      parent=lidar_parent,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      min_range=0.4,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      max_range=30.0,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      draw_points=False,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      draw_lines=True, # set to True to visualize&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      horizontal_fov=360.0,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      vertical_fov=30.0,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      horizontal_resolution=0.4,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      vertical_resolution=4.0,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      rotation_rate=30.0,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      high_lod=False,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      yaw_offset=0.0,&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#      enable_semantics=False&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# )&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Unfortunately I haven&#39;t played with sensor materials enough to write about them. If I do end up doing that I&#39;ll add it here. If you&#39;d like to collaborate with me on that, contact me.&lt;/p&gt;
&lt;h3&gt;IMU&lt;/h3&gt;
&lt;p&gt;💡 Documentation&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/features/sensors_simulation/isaac_sim_sensors_physics_based_imu.html&quot;&gt;https://docs.omniverse.nvidia.com/isaacsim/latest/features/sensors_simulation/isaac_sim_sensors_physics_based_imu.html&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;imu_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;imu&#39;&lt;/span&gt;
imu_parent &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/imu_link&#39;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; prim &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; stage&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;TraverseAll&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;HasAPI&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;PhysxSchema&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;PhysxSceneAPI&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        current_physics_prim &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; prim
physx_scene_api &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; PhysxSchema&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;PhysxSceneAPI&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;current_physics_prim&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
current_physics_frequency &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; physx_scene_api&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetTimeStepsPerSecondAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# default = 60&lt;/span&gt;
dt &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1.0&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;/&lt;/span&gt; current_physics_frequency 

imu_result&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; imu_prim &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;kit&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;commands&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;execute&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;token string&quot;&gt;&quot;IsaacSensorCreateImuSensor&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    path&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;imu_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    parent&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;imu_parent&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    sensor_period&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;dt&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    visualize&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    linear_acceleration_filter_size&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    angular_velocity_filter_size&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    orientation_filter_size&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Camera&lt;/h3&gt;
&lt;p&gt;Default camera:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;isaac&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;sensor &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; Camera

camera_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;robot_prim&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/camera_rgb_frame/camera&#39;&lt;/span&gt;

camera_prim &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Camera&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
     prim_path&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;camera_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     frequency&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     resolution&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There are easy ways to get the calibration parameters for the cameras. Check out the full documentation here: &lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/features/sensors_simulation/isaac_sim_sensors_camera.html#calibrated-camera-sensors&quot;&gt;https://docs.omniverse.nvidia.com/isaacsim/latest/features/sensors_simulation/isaac_sim_sensors_camera.html#calibrated-camera-sensors&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cameras seem to be the most loved sensor out of all. The documentation is really good so I’m not going to copy it here, but be sure to look up these files in the Isaac directory to learn more:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;./standalone_examples/api/omni.isaac.sensor/camera_ros.py&lt;/li&gt;
&lt;li&gt;./standalone_examples/api/omni.isaac.sensor/camera_opencv.py&lt;/li&gt;
&lt;li&gt;./standalone_examples/api/omni.isaac.sensor/camera_opencv_fisheye.py&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Wrap up&lt;/h2&gt;
&lt;p&gt;Run the script&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;./python.sh ./isaac-sim-starter/isaac.py&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should see the robot on a flat grid.&lt;/p&gt;
&lt;p&gt;Create a new viewport for the camera: Window -&amp;gt; Viewport -&amp;gt; Viewport 2 and select camera&lt;/p&gt;
&lt;p&gt;The next part will discuss how you can access the sensor data through ROS.&lt;/p&gt;
]]></content>
    </entry>
  
    <entry>
      <title>Isaac Sim Accelerated: Part 1</title>
      <link href="https://ishan.sh/posts/isaac-sim-acc-part-1/"/>
      <updated>2024-07-01T00:00:00.000Z</updated>
      <id>https://ishan.sh/posts/isaac-sim-acc-part-1/</id>
      <summary>A practical reference for developers already familiar with the basics of Isaac Sim, complete with code snippets and a barebones framework for developing more complex simulations. This post covers setting up the git repository and getting the base script running.</summary>
      <content type="html"><![CDATA[&lt;p&gt;Git Repository: &lt;a href=&quot;https://github.com/ishandotsh/isaac-sim-starter&quot;&gt;https://github.com/ishandotsh/isaac-sim-starter&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;What to expect from this series&lt;/h2&gt;
&lt;p&gt;This is not an introduction to Isaac Sim. This series should be taken as one way you could set up a simulation environment for your robot. It can also act as a cheatsheet to copy useful snippets that could be tedious to write by hand (actiongraphs…). The reason I’m writing this article is because I wanted a post like this but couldn’t find one.&lt;/p&gt;
&lt;p&gt;I recommend reading through the first 2 tutorials of the &lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/index.html&quot;&gt;Isaac Sim Documentation&lt;/a&gt; to get a bearing.&lt;/p&gt;
&lt;p&gt;P.S. I used ROS1 Noetic for this. I haven&#39;t used ROS2 yet so YMMV, but the basic principles of Isaac Sim will be the same.&lt;/p&gt;
&lt;h2&gt;Overarching Flow&lt;/h2&gt;
&lt;p&gt;The way I’ve worked it out is first you need to have your robot in a format that’s compatible with Isaac Sim. URDFs add a bit of complexity to the flow, but it is the most common robot description format. If you have the option, convert your asset to USD or USDA. You don’t need to go out of your way to learn about USDs because they’re a core part of the tool. Still, here’s a &lt;a href=&quot;https://developer.nvidia.com/usd#resources&quot;&gt;well curated list of resources&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After the robot’s loaded into an environment, you can add sensors to it. Adding sensors is very easy. The API is pretty clear and concise and I’ll get into it in the upcoming sections.&lt;/p&gt;
&lt;p&gt;Once the robot is actually ready, its time for it to do tasks. This bit is very case specific so I’ll lay out the foundations and you’ll have to work out the rest. I’ll be happy to add your use case to this post and credit you.&lt;/p&gt;
&lt;h2&gt;Setting up the standalone script&lt;/h2&gt;
&lt;h3&gt;Base Script&lt;/h3&gt;
&lt;p&gt;If you&#39;re following with the git repo set it up as follows:&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;cd&lt;/span&gt; ~/.local/share/ov/pkg/isaac_sim-2023.1.1 &lt;span class=&quot;token comment&quot;&gt;# might be different for you&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;git&lt;/span&gt; clone https://github.com/ishandotsh/isaac-sim-starter.git
&lt;span class=&quot;token builtin class-name&quot;&gt;cd&lt;/span&gt; isaac-sim-starter
./setup.sh
code &lt;span class=&quot;token builtin class-name&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# open in your editor&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In subsequent parts, I&#39;ll introduce several utility functions that make the base script cumbersome to read. Its best to create a separate file for those, so I&#39;d suggest following the structure of the repo, and placing it inside the Isaac Sim install directory.&lt;/p&gt;
&lt;p&gt;If instead you&#39;d like to work on the app from a different directory, copy the .vscode directory and modify the setup.sh script. This is purely for python intellisense purposes. Then in a new python file:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;isaac&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;kit &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; SimulationApp

app_config &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
     &lt;span class=&quot;token string&quot;&gt;&quot;width&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;1280&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     &lt;span class=&quot;token string&quot;&gt;&quot;height&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;720&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     &lt;span class=&quot;token string&quot;&gt;&quot;headless&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
     &lt;span class=&quot;token string&quot;&gt;&quot;renderer&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;RayTracedLighting&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# other config params:&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# https://docs.omniverse.nvidia.com/py/isaacsim/source/extensions/omni.isaac.kit/docs/index.html&lt;/span&gt;

app &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; SimulationApp&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;app_config&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Load an environment&lt;/h3&gt;
&lt;p&gt;This will only work if you&#39;ve set up the &lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_workstation.html&quot;&gt;Nucleus server&lt;/a&gt;. Make sure that&#39;s always running before executing the script or you&#39;ll wait around forever for the sim to load.&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;isaac&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;core&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;utils&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;nucleus &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; get_assets_root_path
&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;isaac&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;core&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;utils&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;stage &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; add_reference_to_stage

&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;isaac&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;core &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; World
world &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; World&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;stage_units_in_meters&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1.0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

assets_root_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; get_assets_root_path&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;spawn_environment&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;world_type&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;ground_plane&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
     &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; world_type &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;ground_plane&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          world&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;scene&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;add_default_ground_plane&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;token keyword&quot;&gt;elif&lt;/span&gt; world_type &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;warehouse&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          warehouse_asset_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; assets_root_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/Isaac/Environments/Simple_Warehouse/warehouse.usd&quot;&lt;/span&gt;
          warehouse_prim &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; add_reference_to_stage&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;usd_path&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;warehouse_asset_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; prim_path&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/World/Warehouse&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;token keyword&quot;&gt;elif&lt;/span&gt; world_type &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;warehouse_shelves&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          warehouse_asset_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; assets_root_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/Isaac/Environments/Simple_Warehouse/warehouse_multiple_shelves.usd&quot;&lt;/span&gt;
          warehouse_prim &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; add_reference_to_stage&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;usd_path&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;warehouse_asset_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; prim_path&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/World/Warehouse&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;token keyword&quot;&gt;elif&lt;/span&gt; world_type &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;warehouse_full&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          warehouse_asset_path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; assets_root_path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/Isaac/Environments/Simple_Warehouse/full_warehouse.usd&quot;&lt;/span&gt;
          warehouse_prim &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; add_reference_to_stage&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;usd_path&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;warehouse_asset_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; prim_path&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/World/Warehouse&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# ground_plane, warehouse, warehouse_shelves, warehouse_full&lt;/span&gt;
spawn_environment&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ground_plane&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Other environments:&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# https://docs.omniverse.nvidia.com/isaacsim/latest/features/environment_setup/assets/usd_assets_environments.html&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Physics and lighting&lt;/h3&gt;
&lt;p&gt;Try setting solver type to PGS if TGS is running slow. More information here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://nvidia-omniverse.github.io/PhysX/physx/5.3.1/docs/RigidBodyDynamics.html?highlight=tgs#temporal-gauss-seidel&quot;&gt;TGS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://forums.developer.nvidia.com/t/differences-between-pgs-ad-tgs-solvers/277935&quot;&gt;Difference between TGS and PGS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# https://openusd.org/release/api/index.html&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; pxr &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; Gf&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; PhysxSchema&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Sdf&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; UsdLux&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; UsdPhysics&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Usd&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; UsdGeom
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;kit&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;commands

stage &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;usd&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_context&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_stage&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Physics &lt;/span&gt;
scene &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; UsdPhysics&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Scene&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Define&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;stage&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Sdf&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Path&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/physicsScene&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
scene&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CreateGravityDirectionAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;Gf&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Vec3f&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1.0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
scene&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CreateGravityMagnitudeAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Set&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;9.81&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
PhysxSchema&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;PhysxSceneAPI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Apply&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;stage&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;GetPrimAtPath&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/physicsScene&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
physxSceneAPI &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; PhysxSchema&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;PhysxSceneAPI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;stage&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/physicsScene&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
physxSceneAPI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CreateEnableCCDAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
physxSceneAPI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CreateEnableStabilizationAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
physxSceneAPI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CreateEnableGPUDynamicsAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
physxSceneAPI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CreateBroadphaseTypeAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;MBP&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
physxSceneAPI&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CreateSolverTypeAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;TGS&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# or PGS&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Lighting&lt;/span&gt;
distantLight &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; UsdLux&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;DistantLight&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Define&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;stage&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Sdf&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Path&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/DistantLight&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
distantLight&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CreateIntensityAttr&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;500&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;End of base script&lt;/h3&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# This part will always be at the end, all code from &lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# the next steps should be above this bit&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; omni&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;isaac&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;core &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; SimulationContext
simulation_context &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; SimulationContext&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
simulation_context&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;play&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;while&lt;/span&gt; app&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;is_running&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        simulation_context&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;step&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;render&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;except&lt;/span&gt; KeyboardInterrupt&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;break&lt;/span&gt;

simulation_context&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;stop&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
app&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;close&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Run the base script&lt;/h3&gt;
&lt;pre class=&quot;language-bash&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;cd&lt;/span&gt; ~/.local/share/ov/pkg/isaac_sim-2023.1.1  &lt;span class=&quot;token comment&quot;&gt;# might be different for you&lt;/span&gt;
./python.sh ./isaac-sim-starter/isaac.py &lt;span class=&quot;token comment&quot;&gt;# or wherever you stored it&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This should launch Isaac Sim and stay open until you ctrl-c in the terminal.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/isaac-sim-acc-part-1/isaac-empty.jpg&quot; alt=&quot;break it down&quot; /&gt;&lt;/p&gt;
&lt;p&gt;💡 More information about standalone scripts: &lt;a href=&quot;https://docs.omniverse.nvidia.com/isaacsim/latest/introductory_tutorials/tutorial_intro_workflows.html#standalone-application&quot;&gt;https://docs.omniverse.nvidia.com/isaacsim/latest/introductory_tutorials/tutorial_intro_workflows.html#standalone-application&lt;/a&gt;&lt;/p&gt;
]]></content>
    </entry>
  
    <entry>
      <title>Toy Image Search Engine</title>
      <link href="https://ishan.sh/posts/toy-image-search-engine/"/>
      <updated>2021-12-22T00:00:00.000Z</updated>
      <id>https://ishan.sh/posts/toy-image-search-engine/</id>
      <summary>A quick and dirty project inspired by @TheAIEpiphany on Youtube, to teach myself the basics of the ResNet model, vector embeddings, and deploying a pytorch model.</summary>
      <content type="html"><![CDATA[&lt;h2&gt;A search engine to find images containing the same object&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/toy-image-search-engine/search_engine_hero.png&quot; alt=&quot;Search Engine Hero&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In this project I used a pretrained ResNet34 model to get a feature map of a set of images. Then for a selected image, I get its feature vector with the model, and select images from the dataset with the lowest Euclidean distance. In this blog I&#39;ll explain how you can build something similar and the steps I followed to build it myself.&lt;/p&gt;
&lt;h2&gt;Step 1: The Dataset&lt;/h2&gt;
&lt;p&gt;In general, the larger the database, the better your search engine. I experimented with two datasets: ImageNet and the Pascal VOC datasets. Ultimately it doesn&#39;t matter which dataset you choose but I went with randomly picking ~1000 images from the Pascal VOC dataset because Heroku&#39;s free tier for app deployment restricts the size. In the project folder, place the dataset in a folder called data. Here&#39;s a random sample of the data:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/toy-image-search-engine/random_images.png&quot; alt=&quot;Random sample images&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Step 2: Generating and storing hidden features&lt;/h2&gt;
&lt;p&gt;I used feature vectors from an intermediate layer of PyTorch&#39;s pretrained ResNet34 model as a way to distinguish images.&lt;/p&gt;
&lt;p&gt;Q. What are feature vectors?&lt;/p&gt;
&lt;p&gt;They are lists of numbers to represent the image. In this case, they are the activations of the model&#39;s &amp;quot;neurons&amp;quot; of a particular layer when the image is used as input.&lt;/p&gt;
&lt;p&gt;Q. Why not use the image itself as the feature vector?&lt;/p&gt;
&lt;p&gt;There are a few reasons for this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;this would place too large an emphasis on the color values of the pixels of the image. This might be a good metric if we wanted to find images with similar colors but we want images with a similar object/situation&lt;/li&gt;
&lt;li&gt;depending on the size of the image, the computation would be too heavy.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&#39;s get the basic part of the script out of the way. This will load the modules, set up the dataloader, and prepare the model to be used for inference:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# create_ftrs.py&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# imports:&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; torch
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; torchvision
&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; torchvision &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; datasets&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; transforms
&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; torchvision&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;models &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; resnet34
&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; torch&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;utils&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;data &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; DataLoader&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Dataset
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; os
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; numpy &lt;span class=&quot;token keyword&quot;&gt;as&lt;/span&gt; np

&lt;span class=&quot;token comment&quot;&gt;# pytorch transforms to prepare for pretrained model&lt;/span&gt;
trfms &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; transforms&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Compose&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;
    transforms&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Resize&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    transforms&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;CenterCrop&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;224&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    transforms&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ToTensor&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    
    &lt;span class=&quot;token comment&quot;&gt;# this line is required for pretrained models in pytorch&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;# find more details at https://pytorch.org/vision/stable/models.html&lt;/span&gt;
    transforms&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Normalize&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;mean&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.485&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.456&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.406&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; std&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.229&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.224&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.225&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# define pytorch dataset and dataloader&lt;/span&gt;
data_dir &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;data&#39;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# ImageFolder expects data in folders inside the root folder&lt;/span&gt;
dataset &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; datasets&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ImageFolder&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;data_dir&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; trfms&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 
&lt;span class=&quot;token comment&quot;&gt;# using a larger batch_size will speed everything up &lt;/span&gt;
dl &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; DataLoader&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;dataset&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; batch_size&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; shuffle&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 


&lt;span class=&quot;token comment&quot;&gt;# get pretrained model&lt;/span&gt;
model &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; resnet34&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;pretrained&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# send to GPU if you have it&lt;/span&gt;
device &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; torch&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;device&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;cuda&quot;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; torch&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;cuda&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;is_available&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;cpu&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
model&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;to&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;device&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# send eval mode on model since we&#39;re not training it&lt;/span&gt;
model&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;eval&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now to extract the features, we need to register a &amp;quot;hook&amp;quot; to the model. This hook is just a function attached to a layer of the model that will run when its activations are calculated. I attached this hook to the model&#39;s avgpool layer.&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# the feature vector gets saved to this dictionary&lt;/span&gt;
features &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;get_features&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;name&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token triple-quoted-string string&quot;&gt;&quot;&quot;&quot;
        returns the hook function itself
        the reason behind taking a name parameter is so if you&#39;re
        attaching multiple hooks, its easier to access them via a simple
        key lookup
    &quot;&quot;&quot;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;hook&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;model&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; output&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        features&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;name&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; output&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;detach&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; hook

&lt;span class=&quot;token comment&quot;&gt;# register the hook to the model&lt;/span&gt;
model&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;avgpool&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;register_forward_hook&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;get_features&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The final step now that everything is set up is to run the model in inference mode and send the batches to it.&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# The feature vectors of each batch get stored here&lt;/span&gt;
stored_ftrs &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;with&lt;/span&gt; torch&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;no_grad&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;# iterate through the dataloader&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; i&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;img&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; label&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;enumerate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;dl&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;# print every 10 batches:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;i &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;i&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        
        img &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; img&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;to&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;device&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        output &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; model&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;img&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        
        &lt;span class=&quot;token comment&quot;&gt;# append features[&#39;data&#39;] to stored_ftrs&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;# (remember the dictionary I created before)&lt;/span&gt;
        stored_ftrs&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;features&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;cpu&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;numpy&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# finally, save the feature vectors array to file&lt;/span&gt;
np&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;save&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;stored_ftrs.npy&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; stored_ftrs&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; allow_pickle&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Step 3: The actual search&lt;/h2&gt;
&lt;p&gt;The generated feature vector of each image in the dataset is just that - a vector. So we can apply the concept of euclidean distance or L2 norm to find images that are close to a specific image.&lt;/p&gt;
&lt;p&gt;Q. What is Euclidean distance / L2 norm?&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://machinelearningmastery.com/vector-norms-machine-learning/#:~:text=The%20L2%20norm%20calculates%20the,is%20a%20positive%20distance%20value.&quot;&gt;Jason Brownlee on machinelearningmastery.com can explain this better I can&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I defined some helper functions for this:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;compare&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;img&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token triple-quoted-string string&quot;&gt;&quot;&quot;&quot; 
        does the exact same for the chosen image as we did
        for each image in the dataset
    &quot;&quot;&quot;&lt;/span&gt;
    compare_ftrs &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;with&lt;/span&gt; torch&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;no_grad&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        img &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; trfms&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;img&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;# unsqueeze is important because the model expects a batch of images&lt;/span&gt;
        img &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; img&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;unsqueeze&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        output &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; model&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;img&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        compare_ftrs&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;features&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;data&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;cpu&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;numpy&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; compare_ftrs

&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;get_distances&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;compare_img_tensor&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;# returns the distance of chosen image from each image in the dataset&lt;/span&gt;
    distances &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; batch &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; stored_ftrs&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; img &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; batch&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;# L2 norm&lt;/span&gt;
            dist &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; np&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;linalg&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;norm&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;compare_img_tensor &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt; img&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            distances&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;dist&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; distances

&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;get_best_indices&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;distances&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; n&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token triple-quoted-string string&quot;&gt;&quot;&quot;&quot;
        Get the indices in the distances list of the n smallest 
        distances. 
    &quot;&quot;&quot;&lt;/span&gt;
    dist_sorted &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;sorted&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;distances&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    image_idxs &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; d &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; dist_sorted&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;n&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        ind &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; distances&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;index&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;d&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; ind &lt;span class=&quot;token keyword&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; image_idxs&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            image_idxs&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;ind&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; image_idxs

&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;get_best_matches&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;image_idxs&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token triple-quoted-string string&quot;&gt;&quot;&quot;&quot; 
        Returns the actual images from the dataset according to
        indices.
    &quot;&quot;&quot;&lt;/span&gt;
    results &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; image_idxs&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        results&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;i&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; check_dataset&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;samples&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;i&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; results&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To put it all together, I will take an image, and run it through the helper functions. At the end I will get 10 similar images:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;image &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Image&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;santa_cat.jpg&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
ftrs &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; compare&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;image&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
distances &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; get_distances&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;ftrs&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
best_indxs &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; get_best_indices&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;distances&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
matches &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; get_best_matches&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;best_indxs&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# display (works jupyter notebooks):&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; best_indxs&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    image &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Image&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;matches&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;i&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    display&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;image&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Lets see if it works:&lt;/p&gt;
&lt;p&gt;Input image:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/toy-image-search-engine/santa_cat.png&quot; alt=&quot;santa cat&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Search results:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://ishan.sh/assets/images/toy-image-search-engine/results.png&quot; alt=&quot;results&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looks like it works!&lt;/p&gt;
&lt;h2&gt;(optional) Step 4: Webapp&lt;/h2&gt;
&lt;p&gt;I used a popular framework called Streamlit to create a webapp for this simple search engine. Its pretty easy to do and you can check out the code on my &lt;a href=&quot;https://github.com/ishandotsh/resnet-search-engine&quot;&gt;Github&lt;/a&gt; or check out the live demo &lt;a href=&quot;https://resnet-search-engine.herokuapp.com/&quot;&gt;here&lt;/a&gt; (heroku free tier is dead)&lt;/p&gt;
&lt;p&gt;I had to make some changes to make it suitable for deployment but they should not be too difficult to understand.&lt;/p&gt;
&lt;h2&gt;That&#39;s it!&lt;/h2&gt;
&lt;p&gt;That concludes the project! Thanks for reading it! Let me know if I&#39;ve made any mistakes/missed anything/how I can make this better via my social links.&lt;/p&gt;
]]></content>
    </entry>
  
</feed>
