This directory contains the Unity Simulator and Evolving Graph simulator API's. Remember that in order to run the Unity Simulator, you need to download and execute the appropiate unity executable. The Evolving Graph simulator does not require any unity executable.
VirtualHome simulation works through 2 components:
- Programs: A sequence of actions representing an activity. Each action is formed by one verb and up to 2 object arguments (e.g.
[PutBack] <glass> (1) <table> (1)
). - Environment: the environment where the programs will be executed. Each environment is represented as a graph, where correspond to objects with properties and
(e.g. CLOSED/ON)
and edges contain relationships between objects.
Following, we provide documentation of the Environment settings and Actions currently supported.
- Programs
- Preconditions
- Actions
- Supported in Unity Simulator
- Environment
- Relations
- Object Properties
- Object States
The programs allow executing activities in VirtualHome a program is composed by a sequence of instructions of the form [Action_name] <Object_name> (Object_id)
.
For example:
program = ['[Walk] <chair> (1)', '[Sit] <chair> (1)']
Programs can also have preconditions, describing how should the environment be in order to execute the program. Following we show documentation of the preconditions and actions supported.
List of preconditions that can be specified in the programs. The preconditions specify constrains in the environment where the program will be executed.
object
is_on:object
inon
state.object
is_off:object
inoff
state.object
plugged:object
inplugged_in
state.object
unplugged:object
inplugged_out
state.object
open:object
inopen
state.object
closed:object
inclosed
state.object
occupied:object
has too manyon
edges to sit or lie in it.object
free:object
has no objects attached withon
edges.character
sit:character
must have statesitting
and edgeon
between character and anobject
.character
lying:character
must have statelying
and edgeon
between character and anobject
.
object
incharacter
:character
is wearingobject
. Edgeon
betweenobject
andcharacter
.object1
inobject2
: Edgeon
betweenobject1
andobject2
.object1
insideobject2
: edgeinside
betweenobject1
andobject2
.object1
locationroom
: edgeinside
betweenobject1
androom
.object1
facingobject2
: edgeinside
betweenobject1
andobject2
object1
atreachobject
: edgeinside
betweenclose
andobject2
- script: action object1 object2
- Pre-condition:
- Post-condition:
- remove/add undirected edges:
- remove/add directed edges:
- state changes:
- script: find
object
- cases:
object
oncharacter
-> execute findobject
with properties BODY_PART -> execute findcharacter
is sitting or lying -> execute findcharacter
closeobject
-> execute find- other -> execute walk first, then find
- Pre-condition:
- exists edge
character
closeobject
or for each edgecharacter
closeobject2
exists edgeobject2
closeobject
# i.e., either character must be close toobject
orobject
must be close to every object the character is currenty close to
- exists edge
- Post-condition:
- add undirected edges:
character
closeobject
- remove directed edges:
character
facesobject
- add undirected edges:
- script: walk
object
- Pre-condition:
character
state is not sitting
- Post-condition:
- remove undirected edges:
character
insideany_node
,character
closeany_node
,character
facesany_node
- add undirected edges:
character
close to object_contain(object
) - add undirected edges:
character
close to object with properties BODY_PART - add undirected edges:
character
close to object in hands - add directed edges:
character
inside room_of(object
) - add undirected edges:
character
closeobject
- add undirected edges:
character
close all objects onobject
- remove undirected edges:
- script: Run
object
- Pre-condition:
character
state is not sitting
- Post-condition:
- remove undirected edges:
character
insideany_node
,character
closeany_node
,character
facesany_node
- add undirected edges:
character
close to object_contain(object
) - add undirected edges:
character
close to object with properties BODY_PART - add undirected edges:
character
close to object in hands - add directed edges:
character
inside room_of(object
) - add undirected edges:
character
closeobject
- add undirected edges:
character
close all objects onobject
- remove undirected edges:
- script: sit
object
- Pre-condition:
- exists edge
character
closeobject
character
state is not sittingobject
property is sittable- number of objects on
object
must be less than: 'couch': 4, 'bed': 4, 'chair': 1, 'loveseat': 2, 'sofa': 4, 'toilet': 1, 'pianobench': 2, 'bench': 2
- exists edge
- Post-condition:
- add directed edges:
character
onobject
- state changes:
character
sitting - add
- add directed edges:
- script: standup
- Pre-condition:
character
state is sitting
- Post-condition:
character
remove state sitting
- script: grab
object
- Pre-condition:
object
property is grabbable except water- exists edge
character
closeobject
- no edge
object
insideobject2
unlessobject2
is room orobject2
state is open // Cannot grab an object inside other one, unless it is open - no edge
character
holds_rhany_object
or no edgecharacter
holds_lhany_object
// character has at least one free hand
- Post-condition:
- remove directed and undirected edges:
object
any_relationany_node
- add directed edges:
character
holds_rhobject
orcharacter
holds_lhobject
- add undirected edges:
character
closeobject
- add undirected edges:
character
closeobject2
if there was edgeobject
onobject2
(orobject
insideobject2
) // do not know if this is necessary
- remove directed and undirected edges:
- script: open
object
- Pre-condition:
object
property is openable andobject
state is closed- exists edge
character
closeobject
- no edge
character
holds_rhany_object
or no edgecharacter
holds_lhany_object
// character has at least one free hand
- Post-condition:
- state changes:
object
state is open
- state changes:
- script: close
object
- Pre-condition:
object
property is openable andobject
state is open- exists edge
character
closeobject
- Post-condition:
- state changes:
object
state is closed
- state changes:
- script: putback
object1
object2
// means put object on - Pre-condition:
- exists edge
character
holds_lhobject1
orcharacter
holds_rhobject1
- exists edge
character
closeobject2
- exists edge
- Post-condition:
- remove directed edges:
character
holds_lrobject1
orcharacter
holds_lrobject2
- add undirected edges:
character
closeobject2
,object1
closeobject2
- add directed edges:
object1
onobject2
- remove directed edges:
- script: putback
object1
object2
// means put object on - Pre-condition:
- exists edge
character
holds_lhobject1
orcharacter
holds_rhobject1
- exists edge
character
closeobject2
- exists edge
- Post-condition:
- remove directed edges:
character
holds_lrobject1
orcharacter
holds_lrobject2
- add undirected edges:
character
closeobject2
,object1
closeobject2
- add directed edges:
object1
onobject2
- remove directed edges:
- script: putin
object1
object2
- Pre-condition:
- exists edge
character
holds_lhobject1
orcharacter
holds_rhobject1
- exists edge
character
closeobject2
object2
property is not openable orobject2
state is open // needs adjustment, now one can put something into any object (for openable we check open state); consider possibility of putting sugar in a cup
- exists edge
- Post-condition:
- remove directed edges:
character
holds_lrobject1
orcharacter
holds_lrobject2
- add undirected edges:
character
closeobject2
- add directed edges:
object1
insideobject2
- remove directed edges:
- script: putback
object1
object2
// means put object on - Pre-condition:
- exists edge
character
holds_lhobject1
orcharacter
holds_rhobject1
- exists edge
character
closeobject2
- exists edge
- Post-condition:
- remove directed edges:
character
holds_lrobject1
orcharacter
holds_lrobject2
- add undirected edges:
character
closeobject2
,object1
closeobject2
- add directed edges:
object1
onobject2
- remove directed edges:
- script: switchon
object
- Pre-condition:
object
property is has_switchobject
state is off- exists edge
character
closeobject
object
must not be plugged_out
- Post-condition:
- state changes:
object
state is on
- state changes:
- script: switchoff
object
- Pre-condition:
object
property is has_switchobject
state is on- exists edge
character
closeobject
- Post-condition:
- state changes:
object
state is off
- state changes:
- script: drink
object
- Pre-condition:
object
property is drinkable or recipient- exists edge
character
holds_rhobject
orcharacter
holds_lhobject
- script: TurnTo
object
- Pre-condition:
- exists edge
character
closeobject
- exists edge
- Post-condition:
- remove directed edges:
character
faces anyobject - add directed edges:
character
facesobject
- remove directed edges:
- script: LookAt
object
- Pre-condition:
- exists edge
character
facingobject
- exists edge
- script: Wipe
object
- Pre-condition:
character
closeobject
- exists edge
character
holds_rhobject
orcharacter
holds_lhobject
- Post-condition:
- state changes:
object
state is clean
- state changes:
- script: PutOn
object
- Pre-condition:
- exists edge
character
holds_rhobject
orcharacter
holds_lhobject
object
preperty is clothes
- exists edge
- Post-condition:
- add directed edges:
object
oncharacter
- remove directed edges:
character
holds_rhobject
orcharacter
holds_lhobject
- add directed edges:
- script: PutOff
object
- Pre-condition:
- exists edge
object
oncharacter
object
preperty is clothes
- exists edge
- Post-condition:
- remove directed edges:
object
oncharacter
- remove directed edges:
- script: Greet
object
- Pre-condition:
object
property is person
- script: Drop
object
- Pre-condition:
- exists edge
character
holds_rhobject
orcharacter
holds_lhobject
- exists edge
- Post-condition:
- remove direction edges:
character
holds_rhobject
orcharacter
holds_lhobject
- add directed edges:
object
inside room_of(character
)
- remove direction edges:
- script: read
object
- Pre-condition:
object
property is readable- exists edge
character
holds_rhobject
orcharacter
holds_lhobject
- script: touch
object
- Pre-condition:
- exist edge
character
closeobject
- no edge
object
insideobject2
unlessobject2
is room orobject2
state is open // Cannot touch an object inside other one, unless it is open
- exist edge
- script: lie
object
- Pre-condition:
- exists edge
character
closeobject
character
state is not lyingobject
property is lieable- number of objects on
object
must be less than: 'couch': 2, 'bathtub': 2, 'bed': 3, 'loveseat': 2, 'sofa': 2, 'bench': 1
- exists edge
- Post-condition:
- add directed edges:
character
onobject
- state changes:
character
lying
- add directed edges:
- script: pour
object1
object2
- Pre-condition:
- exist edge
character
closeobject2
- exist edge
character
holds_rhobject1
orcharacter
holds_lhobject1
object1
property is pourable or drinkableobject2
property is recipient
- exist edge
- Post-condition:
- add directed edges:
object1
insideobject2
- add directed edges:
- script: type
object
- Pre-condition:
- exist edge
character
closeobject
object
property is has_switch
- exist edge
- script: watch
object
- Pre-condition:
- room of
character
is room ofobject
object
is not inside a closed object- only television, computer, laptop is allowed to be watched
character
faceobject
if character sitting
- room of
- script: push/pull/move
object
- Pre-condition:
object
property is movable (exception: push button)- exists edge
character
closeobject
- no edge
object
insideobject2
unlessobject2
is room orobject2
state is open // Cannot move an object inside other one, unless it is open - no edge
character
holds_rhany_object
or no edgecharacter
holds_lhany_object
// character has at least one free hand
- script: wash
object
- Pre-condition:
- exist edge
character
closeobject
- exist edge
- Post-condition:
object
state not dirtyobject
state clean
- script: squeeze
object
- Pre-condition:
object
property is clothes- no edge
character
holds_rhany_object
or no edgecharacter
holds_lhany_object
- exist edge
character
closeobject
-
script: plugin
object
-
Pre-condition:
object
property is has_plugobject
state is plugged_out- exists edge
character
closeobject
- no edge
character
holds_rhany_object
or no edgecharacter
holds_lhany_object
// character has at least one free hand
-
Post-condition:
- state changes:
object
state is plugged_in
- state changes:
- script: plugout
object
- Pre-condition:
object
property is has_plugobject
state is plugged_in- exists edge
character
closeobject
- no edge
character
holds_rhany_object
or no edgecharacter
holds_lhany_object
// character has at least one free hand
- Post-condition:
- state changes:
object
state is plugged_out
- state changes:
- script: cut
object
- Pre-condition:
object
property is eatableobject
property is cuttable- no edge
character
holds_rhany_object
or no edgecharacter
holds_lhany_object
- exist edge
character
closeobject
- exist edge
chatectore
holds_rhany_object
with 'knife' in name or no edgecharacter
holds_lhany_object
with 'knife' in name
- script: eat
object
- Pre-condition:
object
property is eatable- exist edge
character
closeobject
- script: sleep
- Pre-condition:
character
is lying or sitting
- script: wakeup
- Pre-condition:
character
is lying or sitting
Here is the list with Executors currently supported in the Unity Simulator. The rest are only supported in Graph Evolve simulator.
Action Executor | Supported Unity |
---|---|
FindExecutor | ✅ |
WalkExecutor | ✅ |
RunExecutor | ✅ |
SitExecutor | ✅ |
StandUpExecutor | ✅ |
GrabExecutor | ✅ |
OpenExecutor | ✅ |
CloseExecutor | ✅ |
PutBackExecutor | ✅ |
PutExecutor | ✅ |
PutInExecutor | ✅ |
SwitchOnExecutor | ✅ |
SwitchOffExecutor | ✅ |
DrinkExecutor | ✅ |
TurnToExecutor | ✅ |
LookAtExecutor | ✅ |
WipeExecutor | |
PutOnExecutor | |
PutOffExecutor | |
GreetExecutor | |
DropExecutor | |
ReadExecutor | |
TouchExecutor | ✅ |
LieExecutor | |
PourExecutor | |
TypeExecutor | |
WatchExecutor | |
MoveExecutor | |
WashExecutor | |
SqueezeExecutor | |
PlugInExecutor | |
PlugOutExecutor | |
CutExecutor | |
EatExecutor | |
SleepExecutor | |
WakeUpExecutor |
VirtualHome is composed of 7 scenes where activities can be executed. Each scene is encoded in a .json
file containing a node for every object and edges between them representing relationships. Each environment can be updated by modifying the corresponding .json
file.
The files representing each apartment can be found in example_graphs as TestScene{apt_id}_graph.json
. Each graph has a Trimmed version, which is used for the Evolving Graph simulator.
You can check in the demo examples on how to read and update graphs.
Scene 1 | Scene 2 | Scene 3 | Scene 4 | Scene 5 | Scene 6 | Scene 7 |
---|---|---|---|---|---|---|
You can check here the list of supported node states, edge relations and object properties in the graphs representing the environment.
Note that this documentation holds for both Unity Simulator and Evolving Graph.
Possible relations (edge labels) are:
- on
- inside
- between used for door object, if door is between kitchen and livingroom, we have edges
door
betweenlivingroom
anddoor
betweenkitchen
- close edge
object1
closeobject2
denotes that the distance between center ofobject1
(object2
) to the bounding box ofobject2
(object1
) is < 1.5 units (~meters) - facing there is an edge
object1
facingobject2
ifobject2
is lookable, is visible fromobject1
, and the distance between the centers is < 5 units (~meters). Ifobject1
is a sofa or a chair it should also be turned towardsobject2
- holds_rh edge
character
holds_rhobject
is used to indicate that character holds an object in its right hand - holds_lh analogue of holds_rh for left hand
- surfaces
- grabbable
- sittable
- lieable
- hangable
- drinkable
- eatable
- recipient
- cuttable
- pourable
- can_open
- has_switch
- readable
- lookable
- containers
- clothes
- person
- body_part
- cover_object
- has_plug
- has_paper
- movable
- cream
- closed
- open
- on
- off
- sitting
- dirty
- clean
- lying
- plugged_in
- plugged_out