Making periodically execute RT component synchronized with simulation time

In this section we describe how to make a periodically executing RT component to run synchronizing with the simulation time.This sample is placed at (OpenHRP installed directory)/share/OpenHRP-3.1/sample/example/simulationEC.

Configuring execution context

OpenHRP contains an execution context to implement periodical execution on an RT component that run synchronizing with the simulation time. This execution context is placed at following location.
(On Windows, substitute "libhrpRTM.so" with "libhrpRTM.dll")

(OpenHRP installed directory)/lib/libhrpRTM.so

Changing rtc.conf settings

Add following 3 lines to the configuration file used by RT component. Line1 declares that it uses execution context for simulation. And line2 specifies tha path to "libhrpRTM.so".

exec_cxt.periodic.type: SimulationEC
manager.modules.load_path: (OpenHRP installed directory)/lib
manager.modules.preload: SimulationEC.so

Execution of the sample

  1. Start GrxUI and Create a Simulation item and a World State item .
  2. Start SampleSimulationECComp.
  3. Activate a SampleSimulationECComp0 on RT System Editor.
  4. Start Simulation.
  5. It is periodically displayed as "onExecute" on the window of SampleSimulationECComp.

Warning

  • When generating this execution context for simulation, registration process for GrxUI is also performed. Therefore please beware to start the RT component that uses execution context, after GrxUI.
  • RT component's process starts when it comes to the right time of periodical execution, and the simulation process goes to the wait state until the RT component finish its processing. Which means despite how long it takes to finish the RT component's process, it is just one moment in simulation world. Therefore, beware to set the execution-cycle-time of the RT component, longer than the RT component's process time.