SmartBody : Configuring Reaching, Grabbing,Touching and Pointing

SmartBody characters have the ability to interact with objects in the environment by using a set of example-based motions for reaching, and a set of hand poses for grabbing and touching.

In the first image above, the blue spheres represent a set of reaching examples, while the green dots represent interpolated examples synthesized from the original examples. The character can reach, grab or touch anywhere in that space. In the second image on the right, the character uses a set of reaching examples while in a sitting posture, which allows the character to grab any object on the table and place it anywhere else.

BML is used to instruct the character to reach, grab or touch an object or point in the world. For more details on how to instruct characters to do this, see the description of commands for Reach, Grab, Touch, Point.

Setting Up Reaching/Grabbing/Touching

A reaching setup requires:

  • A set of reaching motions for each idle pose (standing vs sitting vs running)
  • A set of hand configurations for reaching, grasping and releasing, pointing
  • A shape configured for a pawn that is the target of the reaching/grabbing/touching.

For each character, do the following:

Get the Reach Manager:

reachManager = scene.getReachManager()

Create a reaching set for a particular character:

reach = reachManager.createReach(characterName)

then add the motions for that particular reach:

reach.addMotion(hand, motion)

where 'hand' is "left" or "right" describing which hand is performing the motion, and 'motion' is the motion object that can be obtained from the scene as follows:

motion1 = scene.getMotion(motionName)

The handedness will be used by SmartBody when determining which side of the body to use based on proximity. Next, configure the hands for three separate modes: (1) reaching, (2) grasping, and (3) releasing as follows:

reach.setReachHandMotion(hand, reachingMotion)

where 'hand' is "left" or "right" and 'reachingMotion' is a pose describing the hand during a reach. Grasping and releasing need to be configured as:

reach.setGrabHandMotion(hand, grabbingMotion)
reach.setReleaseHandMotion(hand, releasingMotion)

In addition, a pointing hand pose needs to be configured:

reach.setPointHandMotion(hand, pointingMotion)

When all the motions have been added, run the following to build up the pseudo-examples:

character = scene.getCharacter(characterName)
reach.build(character)

To interact with a pawn, that pawn must first have a collision geometry associated with it, which can be created by setting the 'collisionShape' attribute on the pawn:

mypawn = scene.getPawn(pawnName)
mypawn.setStringAttribute("collisionShape", type)

where 'type' is one of: 'null', 'sphere', 'box', or 'capsule. The relative size of the collision shape can be adjusted by setting the 'collisionShapeScale' attribute:

mypawn.setVec3Attribute("collisionShapeScale", size1, size2, size3)

where 'size1', 'size2' and 'size3' are up to three dimensions of size: for a sphere, 'size1' is the radius. For a box, all three sizes are used to specify the x/y/z dimensions, and for a capsule, 'size1' is the length and 'size2' is the radius.

 

'

Attachments:

reachexampledoctor.png (image/png)
ReachCube.bmp (image/bmp)