有没有api用于设置webots中特定机器人的初始位置和旋转

Is there any api for setting the initial position and rotation of a specific robot in webots

我正在用robotis之类的机器人编程op2.For一些原因,我想用代码设置机器人的初始位置和旋转而不是直接点击场景树来改变领域。我可以用任何 API 更改位置(例如 (0, 0.5, 0.1))吗?

谢谢

您应该创建一个监督机器人并使用 wb_supervisor_field_set_sf_vec3f() function to change the position of the robot. Similarly the rotation can be changed using wb_supervisor_field_set_sf_rotation(). An example of this is provided here