next up previous
Next: RobotInfo Up: Simulator API Previous: Simulator API

RcclSimulationServer and RcclSimulationClient

The simulation server drives the simulation. It implements the RcclConnection interface, providing all the high-level robot control functionality specified by this interface. When a user program is run in simulation mode, the connection to RcclConnectionServer is replaced by a connection to RcclSimulationServer. This connection is established by RcclSimulationClient, a thin layer analogous to RcclConnectionClient. An instance of RcclSimulationClient is created for each robotic device needed by a user program.

A simulation is initiated by a call to the new useSimulation() method in ConfigManager. This creates a new RcclSimulationServer object. The server in turn instantiates the viewer, which opens a window and displays the ACME table with its various devices.

ACME user programs specify the devices they need by registering them with a Platform object. For each device, the Platform object creates a new instance of the appropriate RcclActuator subclass. It then calls the ConfigManager's Install() method on that instance. The ConfigManager initializes each device by calling RcclActuator's initialize() method. Normally, this method opens a connection to RCCL by creating a new RcclConnectionClient instance. In simulation mode, however, the RcclConnectionClient is replaced with a RcclSimulationClient.

Since both RcclConnectionClient and RcclSimulationClient implement the same Connection interface, the open() method of this interface can then be (and, in fact, is) called to complete device initialization. In simulation mode, the open() method calls a corresponding method in RcclSimulationServer. This creates a DeviceSimulation instance of the proper subclass (e.g., the Test Station device corresponds a TestStationSimulation instance). The following example code shows how a typical user program might initialize its devices:

Platform platform = new Platform (false, false);
ConfigManager configManager = platform.getConfigManager();

configManager.useSimulation (); // now in simulation mode
platform.Install (DeviceId.TEST_STATION);
platform.Install (DeviceId.CMS); // Puma robot
platform.Install (DeviceId.FMS); // Gantry device
platform.Install (DeviceId.LINEAR_STAGE);

next up previous
Next: RobotInfo Up: Simulator API Previous: Simulator API
Tim Wellhausen