首页 > 其他分享 >Webots tutorial 2

Webots tutorial 2

时间:2023-02-03 13:23:51浏览次数:64  
标签:Solid Shape Base Hands Webots nodes children tutorial

第三章 Webots官方Tutorial 2


目录


一、Tutorial 2: Modification of the Environment

目的是创建一个与环境交互的球。学会刚体的建立、物理参数设置和 DEF-USE机制的使用。

参考链接:https://cyberbotics.com/doc/guide/tutorial-2-modification-of-the-environment?tab-os=windows&tab-language=python

二、一个新仿真

2.1 Hands-on #1

教程1另存一个新项目obstacles.wbt

三、修改地板Floor

3.1 Hands-on #2

del 删除旧地板,+添加新地板:
PROTO nodes (Webots Projects) / objects / floors / Floor (Solid)

3.2 Hands-on #3

size设置为1x1

四、Solid (刚体)结点

  • Solid: 刚体
    • physics:物理特性
    • boundingObject: 碰撞边界
    • children: 子节点
      • Shape: 形状结点
        • geometry:几何形状(可以与碰撞边界boundingObject不同)

五、创建一个球

5.1 Hands-on #4

添加刚体:+/Base nodes/Solid
添加子节点children:选中Solid的子节点children,+/Base nodes/Shape,选中appearance/+/Base nodes/PBRAppearance
其他设置:
1.children/Shape/geometry/Shape/+/Base nodes/Sphere.
2.children/Shape/ appearance PBRAppearance/metalness 置 0 且 roughness 置 1.
3.Solid/boundingObject/+/Base nodes/Sphere.
4.Solid/physics/+/Base nodes/Physics.
5.设置合适的坐标translation
6.保存.

六、几何形状

6.1 Hands-on #5

我们现在将通过增加用于表示球体的三角形的数量来减小球体的大小并提高其图形质量。

对每个Sphere 结点设置半径radius 为 0.05 且分割数 subdivision 为 2.

七、DEF-USE机制

7.1 Hands-on #6

选择第一个球的Sphere结点(children/Shape/geometry Sphere):
1.DEF设置为 BALL_GEOMETRY.
2.选择boundingObject,删除.
3.再选择boundingObject,+/USE / BALL_GEOMETRY(Sphere).

此时球体几何形状geometry和碰撞边界boundingObject同时共享参数。

7.2 Hands-on #7

使用DEF-USE机制的Shape结点再创建一个球。

关键步骤
1.+/Base nodes/Solid
2.Solid/children/+/Base nodes/Shape
3.Solid/children/geometry NULL /+/USE / BALL_GEOMETRY(Sphere)

八、添加墙

8.1 Hands-on #8

与建立ball同理,按照Solid的组成结构图创建nodes。
最终效果图:


总结

本教程为基于刚体solid创建简单的环境。
熟悉了“Solid”、“Physics”、“Shape”、“Sphere”和“Box”节点。
推荐使用允许减少场景树节点冗余的DEF-USE机制

标签:Solid,Shape,Base,Hands,Webots,nodes,children,tutorial
From: https://www.cnblogs.com/YIKeLB/p/17085191.html

相关文章

  • Webots tutorial 3
    第四章Webots官方Tutorial3目录第四章Webots官方Tutorial3一、Tutorial3:Appearance二、灯光三、修改墙的外观3.1Hands-on#2四、给球添加一个现有外观4.1Hands-......
  • Webots tutorial 1
    第二章Webots官方Tutorial1目录第二章Webots官方Tutorial1前言一、Tutorial1:YourFirstSimulationinWebots二、创建一个新世界2.1Hands-on#22.2Hands-on#3......
  • Webots下载安装 + Pycharm联调
    第一章Webots安装目录第一章Webots安装前言一、Webots是什么?二、WebotsR2022b安装1.下载2.安装3.Pycharm作为IDE3.1设置环境变量3.2Webots设置总结前言本系列......
  • Firefly Amazon UK PC control installation tutorial
    FireflyAmazonUKPCcontrolinstallationtutorial1.TurnoffthePCfirewallandanti-virussoftware,itisbesttouninstalltheanti-virussoftware2.Downl......
  • Firefly Amazon PC control installation tutorial
    FireflyAmazonPCcontrolinstallationtutorial1.TurnoffthePCfirewallandanti-virussoftware,itisbesttouninstalltheanti-virussoftware2.Download......
  • Firefly Amazon US PC control installation tutorial
    FireflyAmazonUSPCcontrolinstallationtutorial1.TurnoffthePCfirewallandanti-virussoftware,itisbesttouninstalltheanti-virussoftware2.Downl......
  • Quartz.Net 官方教程 Tutorial 3/3
    Schedule相关属性设置扩展属性方式varhost=Host.CreateDefaultBuilder().ConfigureServices(services=>{services.AddQuartz(opt=>......
  • Abstraction, intuition, and the “monad tutorial fallacy”
    WhileworkingonanarticlefortheMonad.Reader,I’vehadtheopportunitytothinkabouthowpeoplelearnandgainintuitionforabstraction,andtheimplica......
  • cURL Tutorial
    created:2023/1/23 cURLbasicusage curl<url>          DownloadingFileswithcURL       ......
  • Coursera & free video Tutorials All In One
    Coursera&freevideoTutorialsAllInOne免费视频教程https://www.coursera.org/专业证书认证免费旁听https://www.coursera.org/in-progresshttps://ww......