Week13 <<
Previous Next >> Week15〜Week17
Week14
Webots tutorial 3
1.開啟Webots Tutorial 2的檔案,並另存為appearance.wbt。
2.修改牆壁的外觀,在第一面牆的Appearance中的baseColor改成藍色.metalness改0.roughness改為0.5(若use-der機制有完成設定,其餘3面也會更著變動)。
3.將球體新增紋路,在Appearance的baseColorMap中新增ImageTexture。
4.在ImageTexture的url新增WEBOTS_HOME / projects / default / worlds / textures / red_brick_wall.jpg 路徑下的圖片。
5.可使用View / Wireframe Rendering菜單項以線框模式查看仿真和恢復純渲染模式:View / Plain Rendering。
6.查看坐標系:View / Optional Rendering / Show Coordinates System (Ctrl + F1)。
7.查看距離傳感器的光線:View / Optional Rendering / Show DistanceSensor Rays (Ctrl + F10)。
Webots tutorial 4
1.開啟Webots Tutorial 3的檔案,並另存為collision_avoidance.wbt。
2.新增一個控制程式碼檔案,並命名為e-puck_avoid_collision。
3.進行自動迴避程式碼加入。
4.複製程式碼並貼上,存儲後執行,能看到機器自動迴避。
Webots tutorial 5
1.開啟Webots Tutorial 4的檔案,並另存為compound_solid.wbt。
2.新增啞鈴,先新增Solid,並def為dumbbell。
3.在physics中新增Physics,接著在children中新增Group,並在Group中的children新增Shape兩個Transform。
4.在Shape中的geometry新增cylinder,並將height改為0.1及radius改為0.01。
5.接著在Transform中的children新增Shape,並在底下的geometry新增Sphere,然後將底下的radius改為0.03。
6.將Transform底下的translation Y軸改為0.05。
7.依相同方式完成另一個Transform,並將translation Y軸改為-0.05。
8.接著使用def-use機制將Group def GO,並將boundimgObject新增use GO。
9.接著調整啞鈴的物理性質,將phusics中的mass改為2及density改為-1.centerOfMass Y軸改為0.01。
10.調整啞鈴位置,將rotation中的數值改為(1,0,0,1.5708),且translation Y軸改為0.03。
11.接著設定啞鈴的物理屬性,將Worldlnfo中的contactProperties新增ContactProperties,並將底下的coulombFriction改為0。
12.接著將material1和material2改為dumbbell。
13.設定完測試,即完成。
Webots tutorial 6
1.開啟Webots Tutorial 5的檔案,將箱子.機器.球.啞鈴刪除後,另存為4_wheels_robot.wbt。
2.新增Robot,並將底下的physics加入Physics。
3.在Robot下的children中新增Shape,並def BODY。
4.將Robot下的boundingObject中新增use BODY。
5.接著將Shape下的geometry新增Box,並將尺寸定為(0.1,0.05,0.2)。
6.接著將Shape下的appearance新增PBRAppearance,並將顏色改為紅色.metalness改為0。
7.在Robot下的children中新增Hingejoint(複製三個),並在底下的jointParameter中新增HingeJointParameter。
8.接著在Hingejoint中的device新增RotationalMotor,並且在Hingejoint中的endPoint新增Soild。
9.將Soild def WHEEL1,並在底下的children新增Shape,且def WHEEL。
10.在endPoint底下的physics加入Physics,並def WHEEL_PH。
11.接著在Shape下的geometry中新增Cylinder,並在Shape下的appearance新增PBRAppearance。
12.將appearance中的顏色改為綠色.metalness改為0。
13.接著調整軸心位置,將geometry中的radius改為0.04.height改為0.02。
14.將Hingejoint下的boundingObject新增use WHEEL,並將endPoint下的name改為wheel1。
15.調整輪胎位置,將translation中的數值調為(0.06,0,0.05),並將rotation的數值調為(0,0,1,1.5708)。
16.接著將HingeJointParameter下的anchor中的數值調為(0.06,0,0.05)。
17.將RotationalMotor中的name改為wheel1。
18.接著將其餘三個輪胎的數值改動.名稱改動,並用use-der機制完成。
19.新增感測器,在Robot下的children中新增DistanceSensor,並在DistanceSensor下的children新增Shape。
20.接著在Shape下的geometry新增Box.appearance新增PBRAppearance,並將appearance下的metalness改為0.顏色改為藍色。
21.接著更改大小,將geometry中的size數值改為(0.01,0.01,0.01)。
22.接著更改感測器位置,將DistanceSensor下的translation中的數值改為(0.03,0,0.1),並且將rotation中的數值改為(0,1,0,0.3)。
23.接著複製感測器,將其translation中的數值改為(-0.03,0,0.1).rotation中的數值改為(0,1,0,-1.8)。
24.將感測器的name改為ds_left及ds_right,並將調整Robot高度為(0,0.05,0),完成設定後存儲。
25.接著加入程式碼,選擇Python,並命名為4_wheels_collision_avoidance。
26.複製程式碼貼上並存儲,並且將conteoller選用4_wheels_collision_avoidance。
27.接著開始模擬,運作正常及完成。
Week13 <<
Previous Next >> Week15〜Week17