【webots】Build a robot from scratch

1. Change the webots language to Chinese

2. Build a new world

 Then follow the prompts to next step → select the path to store the file → check Add a rectangle arena → complete the creation

3. Create an object (cylinder, cube, etc.)

Rename shape to body and set bouncingObject to body

4. Create a hinge

Create a new hinge in the body, and then open the newly added HingeJoint node. There are three properties in it. The first one is for the main node, the second Device is used to add a Motor, and the third terminal node is the node where the wheel is to be added.

Add nodes as follows

Add wheels to the terminal node, the process is as follows

The remaining steps are the same as above. After completion, change the translation and rotation attributes of the Solid node and place the wheel at the specified position.

Then change the name of the newly added Shape node. This is prepared to add boundary attributes to the endPoint node. After adding the boundingObject, add the physical attributes and also change the name of the physics attribute.

Next, perform the key operation of the hinge and copy the translation value in the endpoint to the anchor as a fixed anchor point.

Then modify the axis (rotation axis) and test whether it is correct by adjusting the position.

Then you can directly copy hingejoint and modify the value to get another wheel.

5. Use motor

The rotationalmotor in the device in the picture below is a rotating motor. Modify its name to facilitate subsequent calls.

6. Various sensors

You can add a sensor to the robot after adding a solid body, and fix the sensor on the added solid body.

Guess you like

Origin blog.csdn.net/m0_73747975/article/details/134387934