wiki:Environments

Embodiments

Embodiments provide an interface for the control of specific parts of a virtual human or robot. They are defined by the control primitives they offer to, e.g. an Engine in AsapRealizer. For example, a !FACSFaceEmbodiment provides Ekman's FACS as control primitives to steer a face. Multiple implementations may exist for the same embodiment interface; for example a FaceEmbodiment? that sends its control primitive values over middleware to a render engine might have the same interface as one that directly animates a face. Using the VirtualHumanLoader, Engines expecting certain embodiment interfaces are bound to the specific implementations of these embodiments.

Environments

Typically, Embodiments reside in Environments. For example, the HmiRenderBodyEmbodiment? resides in a HmiRenderEnvironment? in which it is rendered and a JComponentEmbodiment resides in its parent JComponent.

Constructing Environments

Environments are typically constructed manually by the main program. For example:

WorldObjectEnvironment we = new WorldObjectEnvironment();
MixedAnimationEnvironment mae = new MixedAnimationEnvironment();
AsapEnvironment ee = new AsapEnvironment();
AudioEnvironment aue = new AudioEnvironment("LJWGL_JOAL"); 

Constructing Embodiments

If an embodiment resides in an environment, its construction involves either:

  1. Adding it to the environment(s)
  2. Obtaining it from the environment(s)

Either way, the construction of an Embodiment that is to resides in one or more Environments requires those Environments.

In addition to that, the construction of an Embodiment might require other Embodiment. For example, the OdePhysicalEmbodiment requires an MixedSkeletonEmbodiment on which it can steer physical joints.

Using the VirtualHumanLoader to construct Embodiments

Typical initialization:

OdePhysicsEnvironment ope = new OdePhysicsEnvironment();
WorldObjectEnvironment we = new WorldObjectEnvironment();
MixedAnimationEnvironment mae = new MixedAnimationEnvironment();
AsapEnvironment ee = new AsapEnvironment();
AudioEnvironment aue = new AudioEnvironment("LJWGL_JOAL");

ArrayList<Environment> environments = new ArrayList<Environment>();
environments.add(ope);
environments.add(we);
environments.add(mae);
environments.add(ee);
environments.add(aue);  
ee.init(environments, ope.getPhysicsClock());
ee.loadVirtualHuman("armandia", "", "asaparmandia.xml", "AsapRealizer demo"); 

Here, asaparmandia.xml is the VirtualHumanLoader xml that constructs an AsapRealizer consisting of the Engines and Embodiments defined in it.