week10-14 <<
Previous Next >> About
week15-18
week15
review 期中考之後的進度,以下是影片(開cc字幕)
week16
測驗,以下是影片(開cc字幕)
week17
以上是影片 (開cc字幕)
Now we are ready to define our model.
We start by building the model herarchy: we attach the last dynamic robot link (robot_link_dyn6) to its corresponding joint (robot_joint6) by selecting robot_link_dyn6, then control-selecting robot_joint6, then [Menu bar --> Edit --> Make last selected object parent]. We could also have done this step by simply dragging object robot_link_dyn6 onto robot_link6 in the scene hierarchy. We go on by now attaching robot_joint6 to robot_link_dyn5, and so on, until arrived at the base of the robot. We now have following scene hierarchy:
現在我們準備定義模型了。
我們從建立模型層次結構開始:通過選擇robot_link_dyn6,然後控制選擇robot_joint6,然後選擇[菜單欄->編輯->創建最後一個選定的對象,將最後一個動態機器人鏈接(robot_link_dyn6)附加到其相應的關節(robot_joint6)。 父母]。 我們還可以通過簡單地將對象robot_link_dyn6拖到場景層次結構中的robot_link6上來完成此步驟。 現在,我們將robot_joint6附加到robot_link_dyn5上,依此類推,直到到達機器人的底部。 現在,我們具有以下場景層次結構:
*photo
It is nice and more logical to have a simple name for the model base, since the model base will also represent the model itself. So we rename robot to robot_visibleBase, and robot_dyn to robot. Now we select the base of the hierarchy tree (i.e. object robot) and in the object common properties we enable Object is model base. We also enable Object/model can transfer or accept DNA. A model bounding box appeared, encompassing the whole robot. The bounding box however appears to be too large: this is because the bounding box also encompasses the invisible items, such as the joints. We now exclude the joints from the model bounding box by enabling the Don't show as inside model selection item for all joints. We could do the same procedure for all invisible items in our model. This is also a useful option in order to also exclude large sensors or other items from the model bounding box. We now have following situation:
為模型庫起一個簡單的名字是很好而且更合乎邏輯的,因為模型庫也將代表模型本身。 因此,我們將robot重命名為robot_visibleBase,並將robot_dyn重命名為robot。 現在我們選擇層次結構樹的基礎(即對像機械手),並在對象公共屬性中啟用``對像是模型基礎''。 我們還使對象/模型可以轉移或接受DNA。 出現了一個模型包圍盒,包圍了整個機器人。 但是,邊界框似乎太大:這是因為邊界框還包含不可見的項,例如關節。 現在,通過對所有關節啟用“不顯示為內部模型”選擇項,將關節從模型邊界框中排除。 我們可以對模型中的所有不可見項執行相同的過程。 這也是一個有用的選項,可以將大型傳感器或其他項目也排除在模型邊界框之外。 我們現在有以下情況:

We now protect our model from accidental modification. We select all visible objects in the robot, then enable Select base of model instead: if we now click a visible link in the scene, the base of the robot will be selected instead. This allows us to manipulate the model as if it was a single object. We can still select visible objects in the robot via control-shift-clicking in the scene, or by selecting the object in the scene hierarchy. We now put the robot into a correct default position/orientation. First, we save current scene as a reference (e.g. if at a later stage we need to import CAD data that have the same orientation at the curent robot). Then we select the model and modify its position/orientation appropriately. It is considered good practice to position the model (i.e. its base object) at X=0 and Y=0.
現在,我們保護模型免受意外修改。 我們選擇機器人中的所有可見對象,然後啟用“選擇模型的基礎”:如果現在單擊場景中的可見鏈接,則會改為選擇機器人的基礎。 這使我們可以像對待單個對像一樣操作模型。 我們仍然可以通過按住Shift鍵並單擊場景或在場景層次中選擇對象來選擇機器人中的可見對象。 現在,我們將機器人置於正確的默認位置/方向。 首先,我們將當前場景保存為參考(例如,如果稍後需要在當前機器人上導入方向相同的CAD數據)。 然後,我們選擇模型並適當修改其位置/方向。 將模型(即其基礎對象)定位在X = 0和Y = 0處被認為是一種好習慣。

We now run the simulation: the robot will collapse, since the joints are not controlled by default. When we added the joints in the previous stage, we created joints in force/torque mode, but their motor or controller was disabled (by default). We can now adjust our joints to our requirements. In our case, we want a simple PID controller for each one of them. In the joint dynamic properties, we click Motor enabled and adjust the maximum torque. We then click Control loop enabled and select Position control (PID). We now run the simulation again: the robot should hold its position. Try to switch the current physics engine to see if the behaviour is consistent across all supported physics engines. You can do this via the appropriate toolbar button, or in the general dynamics properties.
During simulation, we now verify the scene dynamic content via the Dynamic content visualization & verification toolbar button. Now, only items that are taken into account by the physics engine will be display, and the display is color-coded. It is very important to always do this, and specially when your dynamic model doesn't behave as expected, in order to quickly debug the model. Similarly, always look at the scene hierarchy during simulation: dynamically enabled objects should display a ball-bounding icon on the right-hand side of their name.
現在我們運行模擬:由於默認情況下關節不受控制,因此機器人將崩潰。 在上一階段添加關節時,我們以力/扭矩模式創建了關節,但其電動機或控制器已禁用(默認情況下)。 現在,我們可以根據需要調整關節。 在我們的案例中,我們希望為每個控制器都提供一個簡單的PID控制器。 在關節動態屬性中,單擊“啟用電機”並調整最大扭矩。 然後,單擊啟用控制環,然後選擇位置控制(PID)。 現在,我們再次運行仿真:機器人應保持其位置。 嘗試切換當前的物理引擎,以查看行為在所有受支持的物理引擎之間是否一致。 您可以通過相應的工具欄按鈕或在常規動力學屬性中執行此操作。
在仿真過程中,我們現在通過“動態內容可視化和驗證”工具欄按鈕來驗證場景動態內容。 現在,將僅顯示物理引擎考慮的項目,並且該顯示使用顏色編碼。 始終執行此操作非常重要,尤其是在動態模型無法按預期運行時,為了快速調試模型,尤其如此。 同樣,在仿真過程中請始終查看場景層次:動態啟用的對象應在其名稱的右側顯示一個球形圖標。

Finally, we need to prepare the robot so that we can easily attach a gripper to it, or easily attach the robot to a mobile platform (for instance). Two dynamically enabled shapes can be rigidly attached to each other in two different ways:
by grouping them: select the shapes, then [Menu bar --> Edit --> Grouping/Merging --> Group selected shapes].
by attaching them via a force/torque sensor: a force torque sensor can also act as a rigid link between two separate dynamically enabled shapes.
In our case, only option 2 is of interest. We create a force/torque sensor with [Menu bar --> Add --> Force sensor], then move it to the tip of the robot, then attach it to object robot_link_dyn6. We change its size and visual appearance appropriately (a red force/torque sensor is often perceived as an optional attachment point, check the various robot models available). We also change its name to robot_attachment:
最後,我們需要準備機器人,以便我們可以輕鬆地將抓取器連接到它,或輕鬆地將機器人連接到移動平台(例如)。 可以通過兩種不同的方式將兩個動態啟用的形狀嚴格地彼此附加:
通過對它們進行分組:選擇形狀,然後選擇[菜單欄->編輯->分組/合併->對選定形狀進行分組]。
通過通過力/扭矩傳感器進行連接:力扭矩傳感器還可以充當兩個單獨的動態啟用形狀之間的剛性鏈接。
在我們的情況下,只有選項2是有意義的。 我們使用[菜單欄->添加->力傳感器]創建一個力/扭矩傳感器,然後將其移動到機器人的尖端,然後將其附加到對象robot_link_dyn6。 我們會適當地更改其尺寸和外觀(紅色力/扭矩傳感器通常被視為可選的連接點,請檢查可用的各種機器人型號)。 我們還將其名稱更改為robot_attachment:

Now we drag a gripper model into the scene, keep it selected, then control-click the attachment force sensor, then click the Assembling/disassembling toolbar button. The gripper goes into place:
現在,我們將抓手模型拖到場景中,使其保持選中狀態,然後按住Control鍵單擊並單擊附著力傳感器,然後單擊“裝配/拆卸”工具欄按鈕。 夾持器到位:

The gripper knew how to attach itself because it was appropriately configured during its model definition. We now also need to properly configure the robot model, so that it will know how to attach itself to a mobile base for instance. We select the robot model, then click Assembling in the object common properties. Set an empty string for 'Parent' match values, then click Set matrix. This will memorize the current base object's local transformation matrix, and use it to position/orient itself relative to the mobile robot's attachment point. To verify that we did things right, we drag the model Models/robots/mobile/KUKA Omnirob.ttm into the scene. Then we select our robot model, then control-click one of the attachment points on the mobile platform, then click the Assembling/disassembling toolbar button. Our robot should correctly place itself on top of the mobile robot:
抓具知道如何附加自身,因為它在模型定義期間進行了適當的配置。 現在,我們還需要正確配置機器人模型,以便它將知道如何將自己附加到移動基座上。 我們選擇機器人模型,然後在對象公共屬性中單擊“組裝”。 為“父項”匹配值設置一個空字符串,然後單擊“設置矩陣”。 這將記住當前基礎對象的局部轉換矩陣,並使用它相對於移動機器人的附著點定位/定向。 為了驗證我們做的正確,我們將模型Models / robots / mobile / KUKA Omnirob.ttm拖到場景中。 然後,我們選擇機器人模型,然後在移動平台上按住Control鍵並單擊其中一個附接點,然後單擊“組裝/拆卸”工具欄按鈕。 我們的機器人應該正確地將自己放置在移動機器人的頂部:

Now we could add additional items to our robot, such as sensors for instance. At some point we might also want to attach embedded scripts to our model, in order to control its behaviour or configure it for various purposes. In that case, make sure to understand how object handles are accessed from embedded scripts. We can also control/access/interface our model from a plugin, from a remote API client, from a ROS node, from a BlueZero node, or from an add-on.
Now we make sure we have reverted the changes done during robot and gripper attachment, we collapse the hierarchy tree of our robot model, select the base of our model, then save it with [Menu bar --> File --> Save model as...]. If we saved it in the model folder, then the model will be available in the model brower.
現在,我們可以向機器人添加其他項目,例如傳感器。 在某些時候,我們可能還希望將嵌入式腳本附加到我們的模型中,以便控制其行為或出於各種目的對其進行配置。 在這種情況下,請確保了解如何從嵌入式腳本訪問對象句柄。 我們還可以通過插件,遠程API客戶端,ROS節點,BlueZero節點或附加組件來控制/訪問/接口模型。
現在,確保已恢復在機械手和抓爪安裝過程中所做的更改,我們折疊了機械手模型的層次樹,選擇了模型的基礎,然後使用[菜單欄->文件->將模型另存為 ...]。 如果我們將其保存在模型文件夾中,則模型將在模型瀏覽器中可用。
week18
測驗,以下是影片(開cc字幕)
week10-14 <<
Previous Next >> About