Adding such timeouts is often an indication of a questionable system
architecture or deployment. If possible, I would recommend getting rid
of such sleeps and instead making the necessary condition for
continuing explicit, e.g. introduce a "ready event" or ready()
operation which you can check in you script.
Markus
The new operation os.execute(command) can be convenient in deployment or cleanup scripts and enables future workarounds for similar problems.
Introduces four new operations in the
os
serivce provided by OCL:int sleep(unsigned int seconds)
int usleep(unsigned int microseconds)
int nanosleep(unsigned int seconds, unsigned int nanoseconds)
int execute(const std::string& command)
Currently there is no way to sleep in Orocos scripting. And a common workaround for Lua is
which is even documented like that in the LuaCookbook. There is also an undocumented function
rtt.sleep(sec, nsec)
according to the related Orocos-users thread http://www.orocos.org/forum/orocos/orocos-users/sleep-ops-script, which is equivalent to the newnanosleep
operation.A general warning about sleep from http://www.orocos.org/forum/orocos/orocos-users/sleep-ops-script#comment-34824:
The new operation
os.execute(command)
can be convenient in deployment or cleanup scripts and enables future workarounds for similar problems.