控制Webots模拟步骤 [英] Controlling Webots simulation step

查看:217
本文介绍了控制Webots模拟步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能以编程方式计算Webots模拟步骤,即,每当一个模块完成其计划时,Webots便应根据模块的输出计算下一个模拟步骤.

Is it possible to calculate the Webots simulation step programatically, i.e. each time one module finishes its planing than the Webots should calculate the next simulation step dependent upon the output of the module.

我已经检查了Supervisor模式,但是除了设置模拟模式外,它似乎对模拟运行没有任何控制.

I have checked the Supervisor mode but it does not seems to have some control over the simulation run apart from setting the simulation mode.

如何执行一个模拟步骤(在Webots环境中为ctrl + 1)".在计划完成另一个ROS节点后从脚本中删除?

How to "execute one simulation step (ctrl + 1 in the Webots environment)" from the script after the planning completion of one other ROS node?

推荐答案

在Supervisor控制器中,您还可以访问所有Robot API.因此,可以获取全局离散时间步长常量(由 WorldInfo.basicTimeStep字段)使用 wb_robot_get_basic_time_step()函数,并获得以秒为单位的模拟时间使用 wb_robot_get_time()函数.

In a Supervisor controller, you can also access to all the Robot API. Therefore, it's possible to get the global discrete time step constant (defined by the WorldInfo.basicTimeStep field) using the wb_robot_get_basic_time_step() function, and to get the simulated time in seconds using the wb_robot_get_time() function.

模拟基本时间步长是一个常数,在模拟过程中不能修改.当控制器(包括主管)调用 wb_robot_step(int持续时间)函数时,仿真将继续进行,并且在持续时间"之后,将把手交还给控制器.在此期间,一个(如果"duration"严格大于"WorldInfo.basicTimeStep",则为一个或多个) 可以应用模拟步骤.

The simulation basic time step is a constant which cannot be modified during the simulation. The simulation goes ahead when controllers (including supervisors) call the wb_robot_step(int duration) function, and the hand will be given back to the controller after this "duration". During this period, one (or more if "duration" is strictly bigger than "WorldInfo.basicTimeStep") simulation steps can be applied.

这篇关于控制Webots模拟步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆