從頭開始學 Isaac Sim 02 -- 加上輪子 === 接續上篇文章,建立好一個立方體,並附加物體條件後,接著要建立輪胎。學習讓機器人具備有功能性的輪子,為未來進行動態運動的模擬做準備。 ### 1 Preparing the Chassis 我們要透過 cube 來建立機器人的主底盤(main chassis),首先要確認它位於世界原點 `(0, 0, 0)`。 並且調整立方體的大小為 `2,1,0.5`。 <div style="display:flex; align-items:center; justify-content:center;"> <img src="https://hackmd.io/_uploads/rkHgRQ2Fxe.png" width="100%"> </div> ### 2 Creating the Robot Xform and Adding the Chassis 在「Stage」面板中按一下滑鼠右鍵,然後選取 Create > Xform ,以建立 xform 。這將作為我們機器人的父項。 接著點擊兩下命名為 SimpleRobot,用滑鼠把 Cube 拖拉到 SimpleRobot 底下作為他的子項。 <p align="center"> <img src="https://hackmd.io/_uploads/ryUY1E2Fxl.png" width="100%"> </p> 接著把將 SimpleRobot 沿 Z 方向向上抬高 1。 <p align="center"> <img src="https://hackmd.io/_uploads/SkxhW4hYgx.png" width="100%"> </p> ### 3 Child-Parent Relationships 所以在這個例子中,SimpleRobot 是一個容器。它在 stage 上創建了一種父子關係,這種父子關係就像是家長搬家小孩也會跟著搬家、移動,但是孩子自己也可以進行不同的移動。 > 子物件會繼承父物件的位移、旋轉、縮放等屬性。 > 父物件是個容器,提供結構與組織方式,方便你把相關東西歸在一起。 ### 4 Creating and Positioning the Wheels 在 Stage ,在 SimpleRobot 按下右鍵然後選取 Create > Mesh > Cylinder 。 在右側面板下方的 transform,讓其在 x 軸旋轉 90 度,並把其縮放到 `0.75,0.75,0.25`。 接著調整座標系到 `0.5,0.75,0` ,這會讓輪子鄉對於世界座標和機器人本體定位。 到面板中點擊 Cylinder 命名為 Front_Left_Wheel,接著按下右鍵複製或是使用 Ctrl+D 來複製。 依序更改其他輪子的定位,並為每一棵輪子添加物理性質。選擇 Add, 按下 Rigid Body with Collision Preset. <p style="display:flex; align-items:center; justify-content:center;"> <img src="https://hackmd.io/_uploads/ByynKV2Kel.png" width="50%"> </p> 可以透過點擊輪子確認有無加入 Rigid Body with Collision Preset,有綠框線表示有加入。 <p style="display:flex; align-items:center; justify-content:center;gap:20px"> <img src="https://hackmd.io/_uploads/B1PiiV2txl.png" width="50%"> <img src="https://hackmd.io/_uploads/SJt9jNhFle.png" width="50%"> </p> 接著就可以按下 Play 觀察物體如何受到物體條件影響。 --- 希望我的內容對你有所幫助,想看到更多內容歡迎追蹤我的 IG、Threads 等平台。 Threads:[@minimalist_shine](https://www.threads.com/@minimalist_shine) IG:[@minimalist_shine](https://www.instagram.com/minimalist_shine/)