cad2019bg4

  • Home
    • Site Map
    • reveal
    • blog
  • Member
  • Week
    • week10 - 14
      • week10
      • SolidWorks
      • NX
      • Creo Parametric
      • SDRC
      • week12
      • week13
    • week15 - 18
      • week17協同任務
      • DEF-USE Mechanism
      • DEF-USE 機制
  • M.A.L
  • NOTE
    • website
      • Batch Command
week15 - 18 << Previous Next >> DEF-USE Mechanism

week17協同任務

Building a clean model tutorial

40723201          吳沛汶

40723204          邱倚瀅

The second important step is to export the original data with a limited precision: most CAD applications let you specify the level of details of exported meshes. It might also be important to export the objects in several steps, when the drawing consists of large and small objects; this is to avoid having large objects too precisely defined (too many triangles) and small objects too roughly defined (too few triangles): simply export large objects first (by adjusting the desired precision settings), then small objects (by adjusting up precision settings).

第二個重要步驟是以有限的精度導出原始數據:大多數CAD應用程式都允許指定導出的網格的細節級別。當工程圖由大小項目組成時,分幾步導出也很重要。這是為了避免大項目定義太精確(三角形太多)和小項目定義太粗糙(三角形太少):首先簡單地導出大項目(通過調整所需的精度設置),然後導出小項目(通過調整精度設置) 。

 CoppeliaSim supports currently following CAD data formats: OBJ, STL, DXF, 3DS (Windows only), and Collada. URDF is also supported, but not mentionned here since it is not a pure mesh-based file format.

CoppeliaSim目前支援以下CAD格式:OBJ,STL,DXF,3DS(僅Windows)和Collada。另外還支援URDF,但此處未提及,因為它不是純網格的文件格式

Now suppose that we have applied all possible simplifications as described in previous section. We might still end-up with a too heavy mesh after import:

現在,假設我們已按照上一節中所述應用了所有可能的簡化。導入後,我們可能最終仍然會留下一個過重的網格:

 You can notice that the whole robot was imported as a single mesh. We will see later how to divide it appropriately. Notice also the wrong orientation of the imported mesh: best is to keep the orientation as it is, until the whole model was built, since, if at a later stage we want to import other items that are related to that same robot, they will automatically have the correct position/orientation relative to the original mesh.

這裡會注意到整個機器人是作為單個網格導入的。稍後將看到如何對此機器人進行適當劃分。要注意導入的網格的方向是否錯誤:最好保持其方向不變,直到建完整個模型為止,因為如果在後面的階段中要導入與此機器人相關的其他項目,它們將自動具有相對於原始網格的正確位置/方向。

 At this stage, we have several functions at our disposal, to simplify the mesh:

在此階段,可以使用多種功能來簡化網格:

Automatic mesh division:allows to generate a new shape for all elements that are not linked together via a common edge. This does not always work for the selected mesh, but is always worth a try, since working on mesh elements gives us more control than if we had to work on all elements at the same time. The function can be accessed with [Menu bar --> Edit --> Grouping/Merging --> Divide selected shapes]. Sometimes, a mesh will be divided more than expected. In that case, simply merge elements that logically belong together (i.e. that will have the same visual attributes and that are part of the same link) back into one single shape ([Menu bar --> Edit -> Grouping/Merging --> Merge selected shapes]).

自動網格劃分:允許為未通過公共邊鏈接在一起的所有元素生成新形狀。這並不總是適用於選定的網格,但是總是值得一試的,因為與必須同時處理所有元素相比,處理網格元素可以為我們提供更多的控制權。可以通過[菜單欄->編輯->分組/合併->分割所選形狀]訪問該功能。有時,網格劃分會超出預期。在這種情況下,只需將邏輯上屬於一起的元素(即,具有相同的視覺屬性並且屬於同一鏈接的一部分)合併回一個單一形狀([菜單欄->編輯->分組/合併->合併選定的形狀])。

 Extract the convex hull:allows to simplify the mesh by transforming it into a convex hull. The function can be accessed with [Menu bar --> Edit --> Morph selection into convex shapes].

提取凸包:通過將其轉換為凸包來簡化網格。可以通過[菜單欄->編輯->將選擇變形為凸形]來訪問該功能

 Decimate the mesh:allows to reduce the number of triangles contained in the mesh. The function can be accessed with [Menu bar --> Edit --> Decimate selected shape...].

抽取網格:減少網格中包含的三角形數量。可以通過[菜單欄->編輯->縮小所選形狀...]訪問該功能。

 Remove the inside of the mesh:allows to simplify the mesh by removing its inside. This function is based on vision sensors and might give more or less satisfying results depending on the selected settings. The function can be accessed with [Menu bar --> Edit --> Extract inside of selected shape].

刪除網格的內部:允許通過刪除其內部來簡化網格。此功能基於視覺傳感器,根據所選設置可能會或多或少地令人滿意。可以通過[菜單欄->編輯->提取選定形狀的內部]訪問該功能。

There is no predefined order in which above functions can/should be applied (except for the first item in the list, which should always be tried first), it heavily depends on the geometry of the mesh we are trying to simplify. Following image illustrates above functions applied to the imported mesh (let's suppose the first item in the list didn't work for us):

此處沒有可以應用上述功能的預定義順序(列表中的第一項除外,應始終首先嘗試該項),它在很大程度上取決於我們要簡化的網格的幾何形狀。下圖說明了應用於導入的網格的上述功能(假設列表中的第一項對我們不起作用):

 Notice how the convex hull doesn't help us at this stage. We decide to use the mesh decimation function first, and run the function twice in order to divide the number of triangles by a total of 50. Once that is done, we extract the inside of the simplified shape and discard it. We end-up with a mesh containing a total of 2'660 triangles (the original imported mesh contained more than 136'000 triangles!). The number of triangles/vertices a shape contains can be seen in the shape geometry dialog. 2'660 triangles are extremely few triangles for a whole robot model, and the visual appearance might suffer a little bit from it.

請注意,凸包在現階段如何對我們沒有幫助。我們決定首先使用網格抽取功能,然後運行兩次該功能,以將三角形的數量總共除以50。完成後,我們提取簡化形狀的內部並將其丟棄。我們最終得到的網格總共包含2'660個三角形(原始導入的網格包含了136'000個三角形!)。形狀包含的三角形/頂點的數量可以在形狀幾何對話框中看到。對於整個機器人模型,2'660三角形是極少的三角形,因此視覺外觀可能會因此受到影響。

 

40723213          杜玗宸

翻譯Building a clean model tutorial

At this stage we can start to divide the robot into separate links (remember, we

currently have only a single shape for the whole robot). You can do this in two different ways:

在這一階段,我們可以開始將機器人劃分為單獨的鏈接(請記住,

目前整個機器人只有一個形狀)。 您可以通過兩種不同的方式執行此操作:

  • Automatic mesh division:this function, which was already described in previous section, will inspect the shape and generate a new shape for all elements that are not linked together via a common edge. This does not always work, but is always worth a try. The function can be accessed with [Menu bar --> Edit --> Grouping/merging --> Divide selected shapes].
  • 自動網格劃分:上一小節已經描述了此功能,它將檢查形狀並為未通過公共邊鏈接在一起的所有元素生成新形狀。 這並不總是有效,但總是值得嘗試的。 可以通過[菜單欄->編輯->分組/合併->分割所選形狀]訪問該功能。
  • Manual mesh division:via the the triangle edit mode, you can manually select the triangles than logically belong together, then click Extract shape. This will generate a new shape in the scene. Delete the selected triangles after that operation.
  • 手動網格劃分:通過三角形編輯模式,您可以手動選擇邏輯上不屬於邏輯的三角形,然後單擊“提取形狀”。 這將在場景中生成新形狀。 完成該操作後,刪除選定的三角形。

In the case of our mesh, method 1 worked fine:

對於我們的網格,方法1可以正常工作:

[Divided mesh]

Now, we could further refine/simplify individual shapes. Sometimes also, a shape might look better if its convex hull is used instead. Othertimes, you will have to use several of above's described techniques iteratively, in order to obtain the desired result. Take for instance following mesh:

現在,我們可以進一步細化/簡化單個形狀。 有時,如果改用凸包,形狀可能會看起來更好。 有時,您將不得不反複使用上述幾種技術,以獲得所需的結果。 以以下網格為例:

[Imported mesh]

The problem with above's shape is that we cannot simplify it nicely, because of the holes it contains. So we have to go the more complicated way via the shape edit mode, where we can extract individual elements that logically belong to the same convex sub-entity. This process can take several iterations: we first extract 3 approximate convex elements. For now, we ignore the triangles that are part of the two holes. While editing a shape in the shape edit mode, it can be convenient to switch the visibility layers, in order to see what is covered by other scene items.

上面形狀的問題是,由於其中包含孔,我們無法很好地簡化它。 因此,我們必須通過形狀編輯模式進行更複雜的處理,在該模式下,我們可以提取邏輯上屬於同一凸形子實體的單個元素。 此過程可能需要進行多次迭代:我們首先提取3個近似凸元素。 現在,我們忽略作為兩個孔的一部分的三角形。 在形狀編輯模式下編輯形狀時,可以方便地切換可見性圖層,以查看其他場景項所覆蓋的內容。

[Step 1]

We end up with a toal of three shapes, but two of them will need further improvement. Now we can erase the triangles that are part of the holes. Finally, we extract the convex hull individually for the 3 shapes, then merge them back together with [Menu bar --> Edit --> Grouping/Merging --> merge selected shapes]:

我們最終得到三個形狀的總和,但是其中兩個將需要進一步改進。 現在我們可以擦除作為孔的一部分的三角形。 最後,我們分別提取3種形狀的凸包,然後將其與[菜單欄->編輯->分組/合併->合併所選形狀]合併在一起:

 

[Step 2]

In CoppeliaSim, we can enable/disable edge display for each shape. We can also specify an angle that will be taken into account for the edge display. A similar parameter is the shading angle, that dictates how facetted the shape will display. Those parameters, and a few others such as the shape color, can be adjusted in the shape properties. Remember that shapes come in various flavours. In this tutorial we have only dealt with simple shapes up to now: a simple shape has a single set of visual attributes (i.e. one color, one shading angle, etc.). If you merge two shapes, then the result will be a simple shape. You can also group shapes, in which case, each shape will retain its visual attributes.

In next step, we can merge elements that logically belong together (if they are part of the same rigid element, and if they have the same visual attributes). Then we change the visual attributes of the various elements. The easiest ist to adjust a few shapes that have different colors and visual attributes, and if we name the color with a specific string, we can later easily programmatically change that color, also if the shape is part of a compound shape. Then, we select all the shapes that have the same visual attributes, then control-select the shape that was already adjusted, then click Apply to selection, once for the Colors, once for the other properties, in the shape properties: this transfers all visual attributes to the selected shapes (including the color name if you provided one). 

在CoppeliaSim中,我們可以啟用/禁用每種形狀的邊緣顯示。我們還可以指定邊緣顯示時要考慮的角度。相似的參數是陰影角,它指示形狀將在多方面顯示。這些參數以及其他一些參數(例如形狀顏色)可以在形狀屬性中進行調整。請記住,形狀有多種風味。到目前為止,在本教程中,我們僅處理簡單的形狀:簡單的形狀具有一組視覺屬性(即一種顏色,一個陰影角度等)。如果合併兩個形狀,則結果將是一個簡單的形狀。您還可以對形狀進行分組,在這種情況下,每個形狀將保留其視覺屬性。

在下一步中,我們可以合併邏輯上屬於一起的元素(如果它們屬於同一剛性元素,並且具有相同的視覺屬性)。然後,我們更改各種元素的視覺屬性。調整具有不同顏色和視覺屬性的幾種形狀的最簡便方法,如果我們使用特定的字符串來命名顏色,則以後可以輕鬆地以編程方式更改該顏色,即使該形狀是複合形狀的一部分。然後,我們選擇所有具有相同視覺屬性的形狀,然後控制選擇已調整的形狀,然後單擊“應用於選擇”,一次是“顏色”,一次是其他屬性,在形狀屬性中:這將轉移所有所選形狀的視覺屬性(如果提供的話,還包括顏色名稱)。

40723215          杜彥霆

40723218          林志豪

We end up with 17 individual shapes:

我們最終得到17個單獨的形狀

                                                                   [Adjusted visual attributes]

[調整後的視覺屬性]

               

Now we can group the shapes that are part of the same link with [Menu bar --> Edit --> Grouping/merging -> Group selected shapes]. We end up with 7 shapes: the base of the robot (or base of the robot's hierarchy tree), and 6 mobile links. It is also important to correctly name your objects: you we do this with a double-click on the object name in the scene hierarchy. The base should always be the robot or model name, and the other objects should always contain the base object name, like: robot (base), robot_link1, robot_proximitySensor, etc. By defaut, shapes will be assigned to visibility layer 1, but can be changed in the object common properties. By default, only visibility layers 1-8 are activated for the scene. We now have following (the model ResizableFloor_5_25 was temporarily made invisible in the model properties dialog):

現在,我們可以使用[菜單欄->編輯->分組/合併->分組所選形狀]對屬於同一鏈接的形狀進行分組。 我們最終得到7個形狀:機器人的基礎(或機器人的層次結構樹的基礎)和6個移動鏈接。 正確命名對像也很重要:您可以通過雙擊場景層次結構中的對象名稱來做到這一點。 基礎應始終是機械手或模型名稱,其他對象應始終包含基礎對象名稱,例如:robot(基礎),robot_link1,robot_proximitySensor等。通過默認,形狀將分配給可見性層1,但可以 在對象通用屬性中進行更改。 默認情況下,僅激活場景的可見性層1-8。 現在,我們有了以下內容(模型ResizableFloor_5_25模型在模型屬性對話框中暫時不可見):

[Individual elements compositn the robot]

[構成機器人的各個要素]

When a shape is created or modified, CoppeliaSim will automatically set its reference frame position and orientation. A shape's reference frame will always be positioned at the shape's geometric center. The frame orientation will be selected so that the shape's bounding box remains as small as possible. This does not always look nice, but we can always reorient a shape's reference frame at any time. We now reorient the reference frames of all our created shapes with [Menu bar --> Edit --> Reorient bounding box --> with reference frame of world]. You have more options to reorient a reference frame in the shape geometry dialog.

創建或修改形狀時,CoppeliaSim將自動設置其參考框架的位置和方向。 形狀的參考框架將始終位於形狀的幾何中心。 將選擇框架方向,以便形狀的邊界框保持盡可能小。 這並不總是看起來不錯,但是我們隨時可以隨時調整形狀的參考框架的方向。 現在,我們可以使用[菜單欄->編輯->重定向邊界框->使用世界參考框架]重新調整所有已創建形狀的參考框架。 您有更多選項可以在形狀幾何對話框中重新定向參考框架。

Building the joints
Now we will take care of the joints/motors. Most of the time, we know the exact position and orientation of each of the joints. In that case, we simply add the joints with [Menu bar --> Add --> Joints --> ...], then we can change their position and orientation with the position dialog and orientation dialog. In other situations, we only have the Denavit-Hartenberg (i.e. D-H) parameters. In that case, we can build our joints via the tool model located in Models/tools/Denavit-Hartenberg joint creator.ttm, in the model browser. Othertimes, we have no information about the joint locations and orientations. Then, we need to extract them from the imported mesh. Let's suppose this is our case. Instead of working on the modified, more approximate mesh, we open a new scene, and import the original CAD data again. Most of the time, we can extract meshes or primitive shapes from the original mesh. The first step is to subdivide the original mesh. If that does not work, we do it via the triangle edit mode. Let's suppose that we could divide the original mesh. We now have smaller objects that we can inspect. We are looking for revolute shapes, that could be used as reference to create joints at their locations, with the same orientation. First, remove all objects that are not needed. It is sometimes also useful to work across several opened scenes, for easier visualization/manipulation. In our case, we focus first on the base of the robot: it contains a cylinder that has the correct position for the first joint. In the triangle edit mode, we have:

建立關節
現在,我們將照顧關節/馬達。大多數時候,我們知道每個關節的確切位置和方向。在這種情況下,我們只需使用[菜單欄->添加->關節-> ...]添加關節,然後可以使用位置對話框和方向對話框更改它們的位置和方向。在其他情況下,我們只有Denavit-Hartenberg(即D-H)參數。在這種情況下,我們可以通過模型瀏覽器中位於Models / tools / Denavit-Hartenberg聯合creator.ttm中的工具模型來構建關節。有時,我們沒有關於關節位置和方向的信息。然後,我們需要從導入的網格中提取它們。讓我們假設這是我們的情況。無需處理修改過的,更近似的網格,而是打開一個新場景,然後再次導入原始CAD數據。大多數時候,我們可以從原始網格中提取網格或基本形狀。第一步是細分原始網格。如果那不起作用,我們將通過三角形編輯模式進行操作。假設我們可以劃分原始網格。現在,我們可以檢查較小的對象。我們正在尋找旋轉形狀,可以用作在其位置以相同方向創建關節的參考。首先,刪除所有不需要的對象。有時在多個打開的場景中工作也很有用,以便於可視化/操作。在我們的案例中,我們首先關注機器人的基座:它包含一個圓柱體,該圓柱體的第一個關節的位置正確。在三角形編輯模式下,我們有:

[Robot base: normal and triangle edit mode visualization]

[機器人基礎:法線和三角形編輯模式可視化]

40723219          林承治

Building a clean model tutorial內容 

https://s40723219.github.io/cad2019/content/Building%20a%20clean%20model%20tutorial.html

Webots User Guide內容

https://s40723219.github.io/cad2019/content/Webots%20User%20Guide.html

40723237          黃俊翔

  • respondable or non-respondable: a respondable shape will cause a collision reaction with other respondable shapes. They (and/or) their collider, will be influenced in their movement if they are dynamic. On the other hand, non-respondable shapes will not compute a collision response if they collide with other shapes.

 

  • 可回應或不可回應:回應形狀會導致與其他可回應形狀發生碰撞反應。它們(和/或)碰撞器,如果他們是動態的,就會影響它們的運動。另一方面,如果不可回應的形狀與其他形狀碰撞,則它們不會計算碰撞回應。

Above two points are illustrated here. Respondable shapes should be as simple as possible, in order to allow for a fast and stable simulation. A physics engine will be able to simulate following 5 types of shapes with various degrees of speed and stability:

 

上圖所示。回應形狀應盡可能簡單,以便快速、穩定地模擬。物理引擎將能夠類比以下 5 種具有不同速度和穩定性的形狀:

  • Pure shapes:a pure shape will be stable and handled very efficiently by the physics engine. The draw-back is that pure shapes are limited in geometry: mostly cuboids, cylinders and spheres. If possible, use those for items that are in contact with other items for a longer time (e.g. the feet of a humanoid robot, the base of a serial manipulator, the fingers of a gripper, etc.). Pure shapes can be created with [Menu bar --> Add --> Primitive shape].

 

  • 純形狀:純形狀將穩定,物理引擎處理效率很高。回拉是純形狀在幾何中是有限的:主要是立方體、圓柱體和球體。如果可能,將這些物品用於與其他物品接觸更長時間的物品(例如類人機器人的腳、串列操縱器的底座、夾持器的手指等)。可以使用 [功能表列 -- > 添加 -gt; 原始形狀]創建純形狀。

 

  • Pure compound shapes:a pure compound shape is a grouping of several pure shapes. It performs almost as well as pure shapes and shares similar properties. Pure compound shapes can be generated by grouping several pure shapes [Menu bar --> Edit --> Grouping/Merging --> Group selected shapes].

 

  • 純複合形狀:純複合形狀是幾個純形狀的組合。它的性能幾乎與純形狀相同,並且具有相似的屬性。純複合形狀可以通過分組多個純形狀生成 [功能表條 -- > 編輯 --> 分組/合併 -- > 組選定形狀]。

 

  • Convex shapes: a convex shape will be a little bit less stable and take a little bit more computation time when handled by the physics engine. It allows for a more general geometry (only requirement: it need to be convex) than pure shapes. If possible, use convex shapes for items that are sporadically in contact with other items (e.g. the various links of a robot). Convex shapes can be generated with [Menu bar --> Add --> Convex hull of selection] or with [Menu bar --> Edit --> Morph selection into convex shapes].

 

  • 凸形形狀:當物理引擎處理時,凸形狀會稍微不穩定一點,並且需要多一點的計算時間。它允許更一般的幾何形狀(僅要求:它需要凸)而不是純形狀。如果可能,對偶爾與其他專案接觸的專案(例如機器人的各種連結)使用凸形形狀。可以使用 [功能表列 -- > 添加 --gt; 選擇的凸包]或使用 [功能表列 -- > 編輯 --> 將選擇轉換為凸形形狀]生成凸形形狀。

 

  • Compound convex shapes, or convex decomposed shapes: a convex decomposed shape is a grouping of several convex shapes. It performs almost as well as convex shapes and shares similar properties. Convex decomposed shapes can be generated by grouping several convex shapes [Menu bar --> Edit --> Grouping/Merging --> Group selected shapes], with [Menu bar --> Add --> Convex decomposition of selection...], or with [Menu bar --> Edit --> Morph selection into its convex decomposition...].

 

  • 複合凸形或凸分解形狀:凸分解形狀是多個凸形形狀的分組。它的性能幾乎與凸形狀一樣好,並且具有類似的屬性。可以通過對多個凸形形狀進行分組[功能表條 --> 編輯 -- > 分組/合併 -- > 組選定形狀]生成,使用 [功能表列 -- > 添加 --> 選擇的凸分解...],或者使用 [功能表列 -- > 編輯 -- > 變形選擇到其凸分解中...]。

 

  • Random shapes: a random shape is a shape that is not convex nor pure. It generally has poor performance (calculation speed and stability). Avoid using random shapes as much as possible.

 

  • 隨機形狀:隨機形狀是不凸或純的形狀。它的性能通常較差(計算速度和穩定性)。儘量避免使用隨機形狀。

 

So the order of preference would be: pure shapes, pure compound shapes, convex shapes, compound convex shapes, and finally random shapes. Make sure to also read this page. In case of the robot we want to build, we will make the base of the robot as a pure cylinder, and the other links as convex or convex decomposed shapes.

 

因此,偏好的順序是:純形狀、純複合形狀、凸形、複合凸形狀,最後是隨機形狀。請務必也閱讀此頁面。在我們想要構建的機器人的情況下,我們將機器人的底座作為一個純圓柱體,其他連結作為凸或凸分解的形狀。

 

We could use the dynamically enabled shapes also as the visible parts of the robot, but that would probably not look good enough. So instead, we will build for each visible shape we have created in the first part of the tutorial a dynamically enabled counterpart, which we will keep hidden: the hidden part will represent the dynamic model and be exclusively used by the physics engine, while the visible part will be used for visualization, but also for minimum distance calculations, proximity sensor detections, etc.

 

我們可以將動態啟用的形狀用作機器人的可見部分,但可能看起來不夠好。因此,我們將為在本教程的第一部分中創建的每個可見形狀構建一個動態啟用的對應形狀,我們將隱藏該形狀:隱藏部分將表示動態模型,並由物理引擎獨佔使用,而可見部分將用於視覺化,但也用於最小距離計算、接近感應器檢測等。

We select object robot, copy-and-paste it into a new scene (in order to keep the original model intact) and start the triangle edit mode. If object robot was a compound shape, we would first have had to ungroup it ([Menu bar --> Edit --> Grouping/Merging --> Ungroup selected shapes]) then merge the individual shapes ([Menu bar --> Edit --> Grouping/Merging --> Merge selected shapes]) before being able to start the triangle edit mode. Now we select the few triangles that represent the power cable, and erase them. Then we select all triangles in that shape, and click Extract cylinder. We can now leave the edit mode and we have our base object represented as a pure cylinder:

 

我們選擇物件機器人,複製並粘貼到一個新的場景(為了保持原始模型不變),並開始三角形編輯模式。如果物件機器人是複合形狀,我們首先必須取消群組它([功能表列 -- > 編輯 --> 分組/合併 -- > 取消組選定形狀]),然後合併單個形狀([功能表列 -- > 編輯 --> 分組/合併 -- > 合併所選形狀]),然後才能啟動三角形編輯模式。現在,我們選擇表示電源線的幾個三角形,並擦除它們。然後,我們選擇該形狀中的所有三角形,然後按一下"提取圓柱體"。我們現在可以離開編輯模式,並將基本物件表示為純圓柱體:

We rename the new shape (with a double-click on its name in the scene hierarchy) as robot_dyn, assign it to visibility layer 9, then copy it to the original scene. The rest of the links will be modelled as convex shapes, or compound convex shapes. We now select the first mobile link (i.e. object robot_link1) and generate a convex shape from it with [Menu bar --> Add --> Convex hull of selection].

我們將新形狀(在場景層次結構中按兩下其名稱)重命名為robot_dyn,將其分配給可見度層 9,然後將其複製到原始場景。其餘連結將建模為凸形或複合凸形。現在,我們選擇第一個手機連結(即物件robot_link1),並生成一個凸形形狀,從它與 [功能表列 -- > 添加 -> 凸面選擇包]。

40723242          趙子德

40723243          劉子源

Model definition
型號定義

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].
通過選擇robot_link_dyn6,然後控制選擇robot_joint6,然後選擇[菜單欄->編輯->創建最後一個選定的對象,將最後一個動態機器人鏈接(robot_link_dyn6)附加到其相應的關節(robot_joint6)

We could also have done this step by simply dragging object robot_link_dyn6 onto robot_link6 in the scene hierarchy.
我們還可以通過簡單地將對象robot_link_dyn6拖到場景層次結構中的robot_link6上來完成此步驟。

We go on by now attaching robot_joint6 to robot_link_dyn5, and so on, until arrived at the base of the robot.
現在,我們將robot_joint6附加到robot_link_dyn5上,依此類推,直到到達機器人的底部。

We now have following scene hierarchy:
現在,我們具有以下場景層次結構:

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.
因此,我們將robot重命名為robot_visibleBase,並將robot_dyn重命名為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.
現在我們選擇層次結構樹的基礎(即對像機械手),並在對象公共屬性中啟用``對像是模型基礎''。我們還使對象/模型可以轉移或接受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 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:
這也是一個有用的選項,可以將大型傳感器或其他項目也排除在模型邊界框之外。我們現在有以下情況:

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.
這使我們可以像對待單個對像一樣操作模型。我們仍然可以通過按住Shift鍵並單擊場景或在場景層次中選擇對象來選擇機器人中的可見對象。

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).
現在,我們將機器人置於正確的默認位置/方向。首先,我們將當前場景保存為參考(例如,如果稍後需要在當前機器人上導入方向相同的CAD數據)。

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.
然後,我們選擇模型並適當修改其位置/方向。將模型(即其基礎對象)定位在X = 0和Y = 0處被認為是一種好習慣。

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.
將模型(即其基礎對象)定位在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.
現在,我們可以根據需要調整關節。在我們的案例中,我們希望為每個控制器都提供一個簡單的PID控制器。

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.
然後,單擊啟用控制環,然後選擇位置控制(PID)。現在,我們再次運行仿真:機器人應保持其位置。

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.
現在,將僅顯示物理引擎考慮的項目,並且該顯示使用顏色編碼。

40723245          蔡育灃

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.

始終執行此操作非常重要,尤其是在動態模型無法按預期運行時,為了快速調試模型,尤其如此。同樣,在仿真過程中請始終查看場景層次:動態啟用的對象應在其名稱的右側顯示一個球形圖標。


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節點或附加組件來控制/訪問/接口模型。
現在,確保已恢復在機械手和抓爪安裝過程中所做的更改,我們折疊了機械手模型的層次樹,選擇了模型的基礎,然後使用[菜單欄->文件->將模型另存為...]。如果我們將其保存在模型文件夾中,則模型將在模型瀏覽器中可用。

Webots User Guide

40723201          吳沛汶

40723204          邱倚瀅

Modifying the Floor

修改地板 

The default RectangleArena PROTO defines a simple floor pinned on the static environment, i.e. without Physics node, and surrounded by walls. Other pre-built floors are available in the Webots objects library. We will now delete the RectangleArena node and add a simple floor that we will manually surround with walls later in this tutorial.

默認的RectangleArena PROTO定義了一個固定在靜態環境上的簡單地板,即沒有Physics節點並且被牆壁包圍。 Webots對像庫中提供了其他預建樓層。現在,我們將刪除RectangleArena節點,並添加一個簡單的地板,在本教程的後面部分將用牆手動將其包圍。

Hands-on 2: To remove the RectangleArena, select it either in the 3D view or in the scene tree view with a left click and press the Delete key on your keyboard. Alternatively, you can right click on it in the 3D view and select Delete in the context menu (you can also use the context menu directly in the scene tree view). Select the TexturedBackroundLight node and click on the Add button. In the open dialog box, and choose PROTO nodes (Webots Projects) / objects / floors / Floor (Solid)

動手操作2:要刪除RectangleArena,請在3D視圖或場景樹視圖中單擊鼠標左鍵將其選中,然後按鍵盤上的Delete鍵。或者,可以在3D視圖中右鍵單擊它,然後在上下文菜單中選擇“刪除”(也可以直接在場景樹視圖中使用上下文菜單)。選擇TexturedBackroundLight節點,然後單擊“添加”按鈕。在打開的對話框中,然後選擇PROTO節點(Webots項目)/對象/ Floors / Floor(實心)

 The newly added Floor PROTO has a default size of 10mx10m, but it is possible to adjust its size, its position and texture by changing the corresponding fields.

新添加的Floor PROTO的默認大小為10mx10m,但是可以通過更改相應的字段來調整其大小,位置和紋理。

Hands-on 3: In the scene tree view select and expand the Floor. Modify the size field and set it to {1, 1} to resize it to 1mx1m.

動手#3:在場景樹視圖中,選擇並展開“地板”。修改大小字段並將其設置為{1,1}以將其大小調整為1m x 1m。

 The Solid Node

實體節點

This subsection introduces the most important base node in Webots: the Solid node, from which many other nodes derive.

本小節介紹了Webots中最重要的基礎節點:Solid節點,許多其他節點都來自Solid節點。

40723213          杜玗宸

翻譯Webots User Guide

A Solid node represents a rigid body, that is a body in which deformation can be neglected. The distance between any two given points of a rigid body remains constant in time regardless of external forces exerted on it. For example a table, a robot finger phalanx or a wheel are rigid bodies. Soft bodies and articulated objects are not rigid bodies. For example, a rope, a tire, a sponge or an articulated robot arm are not rigid bodies. However, an articulated entity can be broken into several rigid bodies.

The physics engine of Webots is designed for simulating rigid bodies only. An important step, when designing a simulation, is to break up the various entities into separate rigid bodies.

To define a rigid body, you will have to create a Solid node. Inside this node you will set up different sub-nodes corresponding to the characteristics of the rigid body. The following figure depicts a rigid body and its sub-nodes. The graphical representation of the Solid node is defined by the Shape nodes populating its children list. The collision bounds are defined in its boundingObject field. The graphical representation and the collision shape are often but not necessarily identical. Finally, the physics field defines if the object belongs to the dynamical or to the static environment. All these sub-nodes are optional, but the physics field needs the boundingObject to be defined.

The simplest model of a rigid body in Webots having a graphical representation, a physical bounding object and being in the dynamical environment.

The Geometry box (in this figure) stands for any kind of geometrical primitive. In fact, it can be substituted by a Sphere, a Box, a Cylinder, etc.

實體節點表示剛體,即可以忽略變形的剛體。剛體上任意兩個給定點之間的距離在時間上保持恆定,而不管施加在其上的外力如何。例如,桌子,機械手指骨或輪子是剛體。軟體和關節物體不是剛體。例如,繩索,輪胎,海綿或關節式機械臂不是剛性體。但是,可以將一個鉸接的實體分解為幾個剛體。

Webots的物理引擎僅設計用於模擬剛體。設計仿真時,重要的一步是將各個實體分解為單獨的剛體。

要定義剛體,您將必須創建一個實體節點。在此節點內,您將根據剛體的特性設置不同的子節點。下圖描繪了剛體及其子節點。實體節點的圖形表示由填充其子級列表的Shape節點定義。碰撞範圍在其boundingObject字段中定義。圖形表示和碰撞形狀通常但不一定相同。最後,物理字段定義對像是屬於動態環境還是屬於靜態環境。所有這些子節點都是可選的,但物理場需要定義boundingObject。

Webots中剛體的最簡單模型,具有圖形表示,物理邊界對象並且處於動態環境中。

幾何框(在此圖中)代表任何類型的幾何圖元。 實際上,它可以用球體,盒子,圓柱體等代替。

40723215          杜彥霆

40723218          林志豪

A Solid node represents a rigid body, that is a body in which deformation can be neglected. The distance between any two given points of a rigid body remains constant in time regardless of external forces exerted on it. For example a table, a robot finger phalanx or a wheel are rigid bodies. Soft bodies and articulated objects are not rigid bodies. For example, a rope, a tire, a sponge or an articulated robot arm are not rigid bodies. However, an articulated entity can be broken into several rigid bodies.

The physics engine of Webots is designed for simulating rigid bodies only. An important step, when designing a simulation, is to break up the various entities into separate rigid bodies.

To define a rigid body, you will have to create a Solid node. Inside this node you will set up different sub-nodes corresponding to the characteristics of the rigid body. The following figure depicts a rigid body and its sub-nodes. The graphical representation of the Solid node is defined by the Shape nodes populating its children list. The collision bounds are defined in its boundingObject field. The graphical representation and the collision shape are often but not necessarily identical. Finally, the physics field defines if the object belongs to the dynamical or to the static environment. All these sub-nodes are optional, but the physics field needs the boundingObject to be defined.

實體節點表示剛體,即可以忽略變形的剛體。剛體上任意兩個給定點之間的距離在時間上保持恆定,而不管施加在其上的外力如何。例如,桌子,機械手指骨或輪子是剛體。軟體和關節物體不是剛體。例如,繩索,輪胎,海綿或關節式機械臂不是剛性體。但是,可以將一個鉸接的實體分解為幾個剛體。

Webots的物理引擎僅設計用於模擬剛體。設計仿真時,重要的一步是將各個實體分解為單獨的剛體。

要定義剛體,您將必須創建一個實體節點。在此節點內,您將根據剛體的特性設置不同的子節點。下圖描繪了剛體及其子節點。實體節點的圖形表示由填充其子級列表的Shape節點定義。碰撞範圍在其boundingObject字段中定義。圖形表示和碰撞形狀通常但不一定相同。最後,物理字段定義對像是屬於動態環境還是屬於靜態環境。所有這些子節點都是可選的,但物理場需要定義boundingObject。

The simplest model of a rigid body in Webots having a graphical representation, a physical bounding object and being in the dynamical environment.

Webots中剛體的最簡單模型,具有圖形表示,物理邊界對象並且處於動態環境中。

The Geometry box (in this figure) stands for any kind of geometrical primitive. In fact, it can be substituted by a Sphere, a Box, a Cylinder, etc.

幾何框(在此圖中)代表任何類型的幾何圖元。 實際上,它可以用球體,盒子,圓柱體等代替。

40723219          林承治

40723237          黃俊翔


week15 - 18 << Previous Next >> DEF-USE Mechanism

Copyright © All rights reserved | This template is made with by Colorlib