ArmarX VirtualTime

ArmarX provides the concept of a virtual time which allows components and statecharts to synchronize to time sources other than wall-time/system time. Time sources are defined via the TimeServerInterface wich is implemented by the ArmarXTimeServer application and the simulator from the ArmarXSimulation package. Time itself is represented as IceUtil::Time instances. The "Clock" gui plugin can be used to start, stop, speed up, or slow down the time offered by a TimeServer.

For example, the "Plotter" gui plugin uses virtual time to show all measurements in Simulator time and to pause when the simulation is stopped.

In order to use a TimeServer, one simply has to set the property

ArmarX.UseTimeServer = true

in the $HOME/.armarx.default.cfg or the global.cfg of a scenario. Setting UseTimeServer=false will provide each caller of the ArmarX VirtualTime commands with the system time.

To make your components and statecharts VirtualTime compatible, you have to use the following functions

armarx::PeriodicTask uses system time by default, but can be changed to use TimeServer time by setting the forceSystemTime constructor parameter to false.

Timeouts in statecharts registered with StateUtility::setTimeoutEvent(...) will automatically use TimeServer time when UseTimeServer=true.