ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Mac] Webot - Tutorial 2: Modification of the Environment
    webot 2020. 3. 20. 06:41

    The Solid Node

    Solid node는 Webot에서 가장 중요한 노드입니다. 여기서 많은 다른 노드들이 파생됩니다. 

    Solid node는 강체, 즉 변형을 무시할 수있는 바디를 나타냅니다.

    강체의 주어진 두 지점 사이의 거리는 그에 가해지는 외부 힘에 관계없이 시간이 일정하게 유지됩니다. 예를 들어 테이블, 로봇 핑거 지골 또는 휠은 강체입니다. 연체 및 관절 형 물체는 강체가 아닙니다. 예를 들어, 로프, 타이어, 스펀지 또는 관절 형 로봇 암은 강체가 아닙니다. 그러나 관절 식 개체는 여러 강체로 나눌 수 있습니다.

    Webots의 Physics는 강체만 시뮬레이션하도록 설계되었습니다. 

    시뮬레이션을 설계 할 때 중요한 단계는 다양한 엔티티를 별도의 강체로 분할하는 것입니다.

     

    강체를 정의하려면 솔리드 노드를 작성해야합니다. 

    이 노드 안에는 강체의 특성에 따라 다른 하위 노드를 설정합니다. 다음 그림은 강체와 하위 노드를 보여줍니다. 

    솔리드 노드의 그래픽 표현은 해당 자식 목록을 채우는 모양 노드에 의해 정의됩니다. 

    충돌 경계는 boundingObject 필드에 정의됩니다. 그래픽 표현과 충돌 모양은 종종 동일하지만 반드시 동일하지는 않습니다. 

    물리 필드는 객체가 동적 환경 또는 정적 환경에 속하는지를 정의합니다. 이러한 모든 하위 노드는 선택 사항이지만 물리 필드에는 boundingObject를 정의해야합니다.

     

    Create a Ball

    Hands-on #4: In the scene tree view, select the last node and press the Add button. In the dialog, open the Bases nodes section and select the Solid node. In the scene tree view, expand the Solid node and select its children field. Add a Shape node to it by using the Add button. Select the appearance field of the Shape node and use the Add button to add a PBRAppearance node.

    1. Add a Sphere node as the geometry field of the newly created Shape node.

    2. Expand the PBRAppearance node and change its metalness field to 0 and its roughness field to 1.

    3. Add another Sphere node to the boundingObject field of the Solid.

    4. Finally add a Physics node to the physics field of the Solid.

    (A Physics node allows to specify the physical properties (density, mass, friction coefficient, etc.) of the solid object that contains it. When a Physics node is added to a solid object, this indicates that the dynamics (forces, gravity, friction, inertia, etc.) of the object must be simulated, otherwise only the kinematics is simulated.)

     

    (물리 노드는 이를 포함하는 솔리드 오브젝트의 물리적 특성 (밀도, 질량, 마찰 계수 등)을 지정할 수 있습니다. 물리 노드가 솔리드 오브젝트에 추가 될 때 이는 역학 (힘, 중력, 물체의 마찰, 관성 등)을 시뮬레이션해야합니다. 그렇지 않으면 운동학만 시뮬레이션됩니다.

     

        5. By modifying the translation field of the Solid node, place the ball in front of the robot (at {0, 0.2, -0.2} for example)

        6. Save the simulation.

        7. The result is depicted in this figure.

     

    Geometries

    공을 정의하기 위해 Sphere 노드를 그래픽 표현 (자식)과 물리적 경계 (boundingObject)의 두 가지 컨텍스트로 사용했습니다.

    Sphere 노드와 같은 모든 Geometry 노드는 그래픽 컨텍스트에서 사용할 수 있습니다. 그러나 실제 컨텍스트에서는 서브세트 만 사용할 수 있습니다. 노드 차트 다이어그램은 각 컨텍스트에서 지원되는 노드를 나타냅니다. 이제 Sphere의 크기를 줄이고 이를 나타내는 데 사용되는 삼각형 수를 늘려 그래픽 품질을 향상시킬 것입니다.

     

    DEF-USE Mechanism

    DEF-USE 메커니즘을 사용하면 한 곳에서 노드를 정의하고 장면 트리의 다른 곳에서 해당 정의를 재사용 할 수 있습니다. 

    월드 파일에서 동일한 노드의 중복을 피하는 데 유용합니다. 또한 사용자가 여러 개체를 동시에 수정할 수도 있습니다. 작동 방식은 다음과 같습니다. 먼저 노드에 DEF 문자열이 표시됩니다. 그런 다음 USE 키워드를 사용하여이 노드의 사본을 다른 곳에서 재사용 할 수 있습니다. DEF 노드의 필드 만 편집 할 수 있으며 USE 필드는 DEF 노드에서 상속되며 변경할 수 없습니다. 이 메커니즘은 월드 파일의 노드 순서에 따라 다릅니다. DEF 노드는 해당 USE 노드보다 먼저 정의해야합니다.

    공을 정의하기 위해 이전에 사용한 두 개의 Sphere 정의는 중복됩니다. 

    DEF-USE 메커니즘을 사용하여이 두 Sphere를 한 개로 병합합니다.

     

    Hands-on #6: Select the first Sphere node (the child of the Shape) in the scene tree view. The field editor of the scene tree view allows you to enter the DEF string.

    1. Enter BALL_GEOMETRY in this field.

    2. Select the boundingObject field (containing the second Sphere node), and empty it by right clicking the field in the scene tree and choosing the Delete entry in the context menu that pops up.

    3. Then, select the boundingObject field and click on the Add button, and select the USE / BALL_GEOMETRY in the dialog box.

    4. The result is shown in this figure

     

    Efficiency

    강체 시뮬레이션은 계산 비용이 많이 듭니다. 

    경계 객체 수를 최소화하고 객체 간 제약을 최소화하고 (다음 자습서의 제약에 대한 자세한 정보) WorldInfo.basicTimeStep 필드를 최대화하여 시뮬레이션 속도를 높일 수 있습니다. 각 시뮬레이션에서 시뮬레이션 속도와 사실감 사이의 균형을 찾아야합니다. (어려운 것 ;;)

    애드센스 -

    'webot' 카테고리의 다른 글

    [Mac] Webot - Tutorial 4: More about Controllers  (0) 2020.03.20
Designed by Tistory.