+ All Categories
Home > Documents > STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser...

STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser...

Date post: 19-Dec-2015
Category:
View: 214 times
Download: 1 times
Share this document with a friend
Popular Tags:
52
STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) http:// wasp.cs.vu.nl/step
Transcript
Page 1: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

STEP: a scripting language for embodied agents

Zhisheng Huang, Anton Eliens, and Cees Visser

(Scripting Technology for Embodied Persona)

http://wasp.cs.vu.nl/step

Page 2: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Embodied Agent and 3D Web Agent• Embodied agents are autonomous

agents which have bodies by which the agents can perceive their world directly through sensors and act on the world directly through effectors.

• 3D Web agents are embodied agents whose experienced worlds are the Web, and whose 3D avatars can interact with each other or with users via Web browsers

Page 3: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

MotivationWhy Embodied Agents

• Sound, graphics, and knowledge could convey ideas and feelings faster than technical documents.[Bickmore(1998)]

• Multimodal human-computer interface, in particular, human-Web interface

Page 4: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

MotivationWhy Embodied Agents

• User interface is better if implemented with respect to what people would expect from the same kind of creature in the real world, regarding personality and emotion[Reeves(1996)]

• The use of an anthropomorphic agent may affect the way in which a user interacts with an application or interface[Koda(1996)]

Page 5: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

MotivationWhy Scripting Languages

• Embodied agent oriented. More convenience and efficiency for authoring.

• Reusability of scripts for different agents in different application contexts.

Page 6: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

MotivationWhy Scripting Language

• Scripting languages focus on communicative acts, like gesture and posture, facial expression, and speech.

• The specification of external-oriented communicative acts are separated from the specification of the internal states of embodied agents to reduce the complexity

Page 7: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Principles• Convenience: natural-language-like terms

turn(Agent, left_arm, front, slow)

turn(Agent, left_arm, rotation(1,0,0,1.57), 3)

• Compositional semantics: combining operators.

par([turn(Agent, left_arm, front, slow),

turn(Agent, right_arm, front, slow)]).

• Re-definability: for high-level specification of actions

run_then_kick(Agent)=seq([run(Agent),kick(Agent)]).

• Parametrization: for the adaptation of actions

Introduce variables in actions.

• Interaction: with a (virtual) environment

Page 8: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

STEP and Dynamic Logic• Distinction between an action and a state

• Semantically a state represents the properties at a particular moment, whereas an action consists of a set of state pairs, which represent a relation between two states.

Page 9: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Dynamic Logic

• [a] if the state is true, then after doing action a, the state is true.

• Pre-condition: and post-condition: • two sub languages: a language for action

specification, and a meta language for state specification

Page 10: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

STEP and its Meta Language

• STEP is a scripting language for action specification. In order to interact with virtual worlds/states, STEP needs a meta language, like DLP, Prolog, Java, etc.

Page 11: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Main Features of STEP

• X3D/VRML H-anim avatars based, the standard Web3D Technology.

• Dynamic logic based, for solid semantic foundation.

• Declarative semantics, for knowledge representation and reasoning, and for agent technology

Page 12: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Implementation

• STEP has been implemented by using Distributed Logic Programming Language (DLP)

• STEP (version 1.0) and its authoring tools are available from the STEP website:

http://wasp.cs.vu.nl/step

Page 13: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Why DLP

• Object-oriented parallel Prolog

• Web3D support

• TCP/IP support for network communication

• Java-based. All DLP programs are compiled into Java classes

• Efficiency for programming

• Reasonably good performance

Page 14: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

FACT : STEP Source Code (1.0)

Page 15: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

FACT: Web_oriented• Web deliverable animation. No need to

install any software or tool to run and test STEP scripts. No DLLs are needed to run STEP facial animation engine.

• Animation and presentation can be created on-the-fly, well suitable for web agents which need interaction with users in real time with reasonably good performance.

Page 16: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Functionalities

• Gesture and Posture (version 1.0)• Inverse Kinematics I(version 1.0)• XSTEP (version 1.0)• Text to Speech (version 1.1)• Facial Animation and Emotion

Expression (version 2.0)

Page 17: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Reference System of STEPDirection Reference for Humanoid

Page 18: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Combination of Directions

Page 19: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Body Referencebased on H-anim specification

Page 20: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Time Reference

•Duration: very_fast, fast, slow, very_slow, very_very_fast

•Time: time(3, second)

Page 21: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Action Operators

• turn(Agent, BodyPart, Direction, Duration).

• move(Agent, BodyPart, Direction, Duration).

• seq([Action1, …, Actionm])

• par([Action1, …,Actionm])

• repeat(Action, T).

Page 22: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Interaction Operators

scripting language versus meta language

• execution: do(State) where State is a formula in the meta language:

do(setSFVec3f(Agent,position,X,Y,Z))

• conditional: if_then_else(Condition, Action1, Action2)

• until: until(Action, UntilCondition)

Page 23: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Actions in Script LibrariesScript(action_name(Agent, OtherVariables), Action):-

Action = ComplexAction.

Prolog-like syntax

Page 24: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Example: Walk

Page 25: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Walk in STEP script(walk_pose(Agent), Action):- Action = seq([par([ turn(Agent,r_shoulder,back_down2,fast), turn(Agent,r_hip,front_down2,fast), turn(Agent,l_shoulder,front_down2,fast), turn(Agent,l_hip,back_down2,fast)]), par([turn(Agent,l_shoulder,back_down2,fast), turn(Agent,l_hip,front_down2,fast), turn(Agent,r_shoulder,front_down2,fast), turn(Agent,r_hip,back_down2,fast)])]).

Script(walk(Agent, N), Action):-Action = repeat(walk_pose(Agent),N).

Page 26: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Variants of walk

script(walk_forward_step0(Agent,StepLength),Action):- Action = par([walk_pose(Agent), move(Agent,increment(0.0,0.0,StepLength),fast)]).

Page 27: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Execution of scripting actionsIn DLP

Format: do_script(Script)

Example: do_script(walk(humanoid, 10))

Page 28: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

STEP Authoring Tools

Page 29: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Run

Page 30: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Run in STEPscript(start_run(Agent), Action) :-

Action = seq([par([turn(Agent, r_elbow, front, fast), turn(Agent, l_elbow, front, fast)]),

par([turn(Agent, l_hip, front_down2, fast),turn(Agent, r_hip, front_down2, fast),turn(Agent, l_knee, back_down, fast),turn(Agent, r_knee, back_down, fast)])

]),!.

script(run(Agent), Action) :- Action = seq([par([turn(Agent,r_shoulder,back_down2,fast),

turn(Agent,r_hip,front_down,fast),turn(Agent,l_shoulder,front_down2,fast),turn(Agent,l_hip,back_down2,fast)]),par([turn(Agent,l_shoulder,back_down2,fast),turn(Agent,l_hip,front_down,fast),turn(Agent,r_shoulder,front_down2,fast),turn(Agent,r_hip,back_down2,fast)])]),!.

Page 31: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Example: Taichi

Page 32: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

STEP script for Taichiscript(taichi(Agent,beginning_posture),Action):- Action =seq([ turn(Agent,l_hip,side1_down,fast), turn(Agent,r_hip,side1_down,fast), par([turn(Agent,l_shoulder,front,slow), turn(Agent,r_shoulder,front,slow)])]).

script(taichi(Agent,push_down_posture),Action) :- Action =seq([ par([turn(Agent,l_shoulder,front_down,slow), turn(Agent,r_shoulder,front_down,slow), turn(Agent,l_elbow,front_right2,slow), …...

Page 33: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Variables and ParametrizationAgent names and their corresponding parameters

are specified as variables in script libraries, by which the same scripting actions can be re-used for different embodied agents under different situations by different authors. It improves the reusability of scripting actions for the purpose of productivity.

Page 34: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Example: Interaction with virtual worlds

Page 35: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

STEP script: look-at-ballscript(turnToDirection(Object,SrcVector,DestVector),Action):- Action = seq([ do(vectorCrossProduct(SrcVector,DestVector,vector(X,Y,Z),R)), do(setRotation(Object,X,Y,Z,R))]).

script(look_at_position(Agent,X1,_Y1,Z1),Action):-

Action = seq([do(getPosition(Agent,X,_Y,Z)),

do(Xdif is X1-X),

do(Zdif is Z1-Z),

turnToDirection(Agent,vector(0.0,0.0,1.0),

vector(Xdif,0.0,Zdif))]).

Page 36: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Interaction Operators for Computation

High-level interaction operators can be used to access the computational capabilities of the meta language in order to find the computation solutions, which involve inverse kinematics.

Page 37: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Example: Touchan inverse kinematics problem

Page 38: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

STEP script: Touch

script(getABvalue(Agent,position(X0,Y0,Z0),Hand,A,B),Action):- Action = seq([getDvalue(Agent,position(X0,Y0,Z0),Hand, D), get_upperarm_length(Agent,L1), get_forearm_length(Agent,L2), do(D1 is L1 + L2), if_then_else(sign(D1-D)>sign(0.001-D), seq([do(cosine_law(L1,L2,D,A)), do(cosine_law(L1, D, L2, B))]), seq([do(A is 1.57*(1+sign(D-0.001))), do(B is 0.0)]))]).

Page 39: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

script(getVvalue(Agent,position(X0,Y0,Z0),Hand,V),Action):- Action = seq([get_shoulder_center(Agent,Hand, position(X2,Y2,Z2)), do(direction_vector(position(X2,Y2,Z2),position(X0,Y0,Z0),V))]).

script(touch(Agent, position(X0,Y0,Z0),l),Action):- Action = seq([getABvalue(Agent,position(X0,Y0,Z0),l,A,B), do(R1 is 3.14-A), getVvalue(Agent,position(X0,Y0,Z0),l,V), get_arm_vector(Agent,l,V0),

do(vector_cross_product(V0,V,vector(X3,Y3,Z3),C)), do(R2 is C-B),

par([turn(Agent,l_shoulder,rotation(X3,Y3,Z3,R2),fast), turn(Agent,l_elbow,rotation(X3,Y3,Z3,R1),fast), turn(Agent,l_wrist,rotation(X3,Y3,Z3,-0.5),fast)])]).

Page 40: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

script(touch_absolutePosition(Agent,position(X1,Y1,Z1),Hand),Action):-

Action = seq([do(getPosition(Agent,X,Y,Z)), do(getRotation(Agent, X2,Y2,Z2,R)),

do(X3 is X1-X), do(Y3 is Y1-Y),

do(Z3 is Z1-Z), do(R1 is -R),

do(position_rotation(position(X3,Y3,Z3), rotation(X2,Y2,Z2,R1),position(X4,Y4,Z4))),

touch(Agent,position(X4,Y4,Z4), Hand)]).

Page 41: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

STEP Architecture

Page 42: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

STEP Engine

Page 43: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

XSTEP: A Markup Language for Embodied Agent

• XSTEP is XML-based STEP.

• For XSTEP we have developed an XSLT style sheet, using Saxon package, that transforms an XSTEP specification into STEP, thus DLP.

Page 44: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

An Example in XSTEP<action name="walk(Agent)"><seq><par> <turn actor="Agent" part="r_shoulder"> <dir value="back_down2"/><speed value="fast"/></turn> <turn actor="Agent" part="r_hip"><dir value="front_down2"/> <speed value="fast"/></turn> <turn actor="Agent" part="l_shoulder"><speed value="fast"/> <dir value="front_down2"/></turn> <turn actor="Agent" part="l_hip"><dir value="back_down2"/> <speed value="fast"/></turn></par> <par>……</par></seq></action>

Page 45: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

XSTEP Editor

Page 46: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Installation of STEP on DLP

1. Download step1.0 Lite (which includes STEP engine, templates, authoring tools, and the avatar ‘yt’) and unzip it to the DLP directory dlp. Make sure that do not overwrite the existing files in your system when you use your own unzip tool.

2. STEP templates :

the application template ‘steptest.pl’

the script library template ‘stepscriptlib.pl’

the step setting template ‘stepsetting.pl’

Page 47: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Default Script Library Namestep_scriptlib

Problem: Due to the limit of the Java virtual machine, the size of each script library cannot be larger than 64KB after the compiling.

Solution: Split a large library into multiple ones.

Page 48: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Hierarchical Library Claims

:-object step_scriptlib : [ bcilib ].

script(ScriptAction, Action):-

step_myscriptlib <- script(ScriptAction,Action),

!.

:-end_object step_scriptlib.

Your own library object name

Page 49: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Humanoid Objects

• humanoid object: humanoid is defined based on a prototype

• non humanoid object: humanoid is not defined based on a prototype.

Page 50: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

stepsetting.pl:-object stepsetting.

humanoid_objects(humanoid1, false):-!.

% humanoid1 is not a humanoid object

humanoid_objects(humanoid2, true):-!.

% humanoid2 is a humanoid object

:-end_object stepsetting.

Page 51: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

STEP application template:-object my_step_application : [bcilib, step_kernel].

var url = './yt/yt.wrl'.

main:-

text_area(BrowserStream),

set_output(BrowserStream),

loadURL(url),

sleep(6000),

script_threads, /* initialize parallel processing*/

do_script(walk(humanoid)),

do_script(run(humanoid)).

:-end_object my_step_application.

Page 52: STEP: a scripting language for embodied agents Zhisheng Huang, Anton Eliens, and Cees Visser (Scripting Technology for Embodied Persona) .

Exercises•Define at least five postures/gestures in STEP from the following set: kick, beat, sit, kneeing, squat, crouch, crawl, climb, lie, sleep, fall, stretch, greeting, hello, bye-bye, ...


Recommended