When a DeviceSimulation instance is created, it obtains the initial state of each device from RobotInfo. Each initial state is defined by the ``parkAngles'' specified in the relevant .jls file. A simulation starts with the devices in their ``parked'' states. For example, the parked state for the Puma robot is given by:
# (NJ floats) parkAngles the park angles for the robot 0.0 90.0 -180.0 180.0 90.0 90.0
We assume that joint values in user programs will be in the same coordinates as those in the .jls files, i.e. that they are not relative to the parked states. The viewer takes initial states to be , but what it displays are the parked states. We therefore calibrate by subtracting the parked values when the viewer processes a motion.
Device states may be obtained at any time from the ACME DeviceState subclasses, as they would in the course of an experiment on the real hardware. The difference is that in simulation mode, the DeviceState subclasses get the data from the simulation server instead of the RcclConnectionServer. The server gets the state data from a DeviceSimulation instance.