Skip to content

HTTP Request API

mpomarlan edited this page Apr 5, 2025 · 29 revisions

Page is a work in progress. Documents currently available commands via the HTTP post interface, together with code snippets to exemplify how to send these requests from python.

In general, a command is sent to a particular "child address" of abe sim via an HTTP POST request, and data -- both command arguments and response -- is represented as a json object. The "child address" for a command is made of the URL of the server, the string "abe-sim-command", and the command identifier itself. For example, if "http://muhai.com" were the server, a request to retrieve the current simulation state should be sent to "http://muhai.com/abe-sim-command/to-get-kitchen".

Retrieve simulation time

This command retrieves the time elapsed in the simulation world since its start. This is not the real time -- the simulation may run faster or slower than the real clock.

Input: a json object of the structure {}

Output: a json object of the structure {'status': <status; is ok if all went well>, 'response': {"time": <current simulation time>}}

`
import requests
import json

req = {}
r = requests.post("http://localhost:54321/abe-sim-command/to-get-time", data=bytes(json.dumps(req), "utf-8"))
simTime = json.loads(r.text)['response']['time']
print(simTime)
`

Cancel command

This command makes the agent abandon its current task. It will literally drop every item it holds, unless a smart cancel is requested in which case it will first position manipulated items at some appropriate location.

Input: a json object of the structure {'smart': <boolean; if true then smart cancel, else all manipulated items are immediately dropped>}

Output: a json object of the structure {'status': <status; is ok if all went well>, 'response': 'ok'}

`
import requests
import json

req = {'smart': True}
r = requests.post("http://localhost:54321/abe-sim-command/to-cancel", data=bytes(json.dumps(req), "utf-8"))
print(json.loads(r.text)['response'])
`

Update avatar

This command updates the human avatar in the simulation, if one is present.

Input: a json object of the structure {'avatarName': <string>, 'positionHead': <list of 3 numbers>, 'orientationHead': <list of four numbers>, 'positionLeft': <list of 3 numbers>, 'orientationLeft': <list of 4 numbers>, 'velocityLeft': <list of 3 numbers>, 'angularVelocityLeft': <list of 3 numbers>, 'positionRight': <list of 3 numbers>, 'orientationRight': <list of 4 numbers>, 'velocityRight': <list of 3 numbers>, 'angularVelocityRight': <list of 3 numbers>, 'graspLeft': <list of strings>, 'graspRight': <list of strings>, 'clopenLeft': <string>, 'clopenRight': <string>, 'objectsToMoveLeft': <list of strings>, 'objectsToMoveRight': <list of strings>, 'turnLeft': <list of pairs of strings>, 'turnRight': <list of pairs of strings>}

Output: a json object of the structure {'status': <status; is ok if all went well>, 'response': 'ok'}

The avatar name is a string that must refer to an object of Bea type existing in the simulation.

The position of the head is a 3D vector in the world frame, but only the x,y components of it will be used. The orientation of the head is a quaternion describing the rotation of the head in the world frame, but only the yaw component will be used.

Positions and orientations of the left/right hands are 3D vectors and quaternions in world frame. The velocities for the hands (both linear and angular) are 3D vectors in the world frame. It is safe to not specify any velocity however, as many VR sensors do not measure velocities.

The grasp lists for the left and right hand are the objects that the human avatar should grasp. Note that the grasp will only be effective if the avatar hand is close enough to the objects.

Clopen flags for the hands describe what, if any, clopening action is being done by the respective program. Possible values are 'open', 'close', and null.

Objects-to-move lists refer to what other objects (apart from the grasped ones) should move with the hands. Useful to move objects inside grasped objects.

Turn lists for the hands contain pairs of form (object name, link name) indicating which objects the hands should turn.

`
import requests
import json

req = {'avatarName': 'bea', 'positionHead': [0,0,0], 'orientationHead': [0,0,0,1], 'positionLeft': [0,0.2,0.8], 'orientationLeft': [0,0,0,1], 'positionRight': [0,0,0], 'orientationRight': [0,0,0,1], 'graspLeft': [], 'graspRight': ['bowl1'], 'objectsToMoveLeft': [], 'objectsToMoveRight': ['butterParticle1'], 'clopenLeft': 'open', 'clopenRight': None, 'turnLeft': [['oven1', 'temperatureSlider']], 'turnRight': []}
r = requests.post("http://localhost:54321/abe-sim-command/to-update-avatar", data=bytes(json.dumps(req), "utf-8"))
print(json.loads(r.text)['response'])
`

Retrieve world state

The command asks abe sim to bind the current world state to some variable name.

Input: a json object of the structure {'kitchen': <variable name X>}

Output: a json object of the structure {'status': <status; is ok if all went well>, 'response': {<variable name X>: <current world state>}}

`
import requests
import json

dws = {'kitchen': '?kitchen-state-1'}
r = requests.post("http://localhost:54321/abe-sim-command/to-get-kitchen", data=bytes(json.dumps(dws), "utf-8"))
worldState = json.loads(r.text)['response']
worldState.keys()
worldState['?kitchen-state-1'].keys()
`

Set world state

This command resets the simulation to some other state, i.e. a new collection of objects with their kinematic and custom state variables.

Input: a json object of the structure {'kitchenStateIn': <state description as would be retrieved from to-get-state>}

Output: a json object of the structure {'status': <status; is ok if all went well>, 'response': 'ok'}

`
import requests
import json

dws = {'kitchen': '?kitchen-state-1'}
r = requests.post("http://localhost:54321/abe-sim-command/to-get-kitchen", data=bytes(json.dumps(dws), "utf-8"))
worldState = json.loads(r.text)['response']['?kitchen-state-1']

req = {'kitchenStateIn': worldState}
r = requests.post("http://localhost:54321/abe-sim-command/to-set-kitchen", data=bytes(json.dumps(req), "utf-8"))
print(json.loads(r.text)['response'])
`

Get available location

This command asks abe sim to bind a particular variable name to a location of a given type (oven, pantry, fridge etc) in the scene. Optionally, first sets the world state and then queries for the location.

Input: a json object of structure {'availableLocation': <variable name X>, 'type': <location type, must be capitalized, e.g. Oven>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchen is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {<variable name X>: <available location id>}}

`
import requests
import json

go = {'availableLocation': '?available-oven', 'type': 'Oven', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-get-location", data=bytes(json.dumps(go), "utf-8"))
response = json.loads(r.text)
response
`

Go to pose

This command asks the abe sim robot to move to a particular position in the world state.

Input: a json object of the structure {'agent': <string>, 'position': <list of 2 numbers>, 'yaw': <number>, 'setWorldState': <boolean>, 'kitchenStateIn': <state description such as retrieved from to-get-kitchen>}

Output: a json object of the structure {'status': <status; is ok if all went well>, 'response': 'ok'}

`
import requests
import json

req = {'agent': 'abe', 'position': [0,0], 'yaw': 0}
r = requests.post("http://localhost:54321/abe-sim-command/to-go-to-pose", data=bytes(json.dumps(req), "utf-8"))
print(json.loads(r.text)['response'])
`

Set joint position

This command sets a joint on an object to a particular value.

Input: a json object of the structure {'object': <string>, 'joint': <string>, 'position': <number>, 'setWorldState': <boolean>, 'kitchenStateIn': <state description such as retrieved from to-get-kitchen>}

Output: a json object of the structure {'status': <status; is ok if all went well>, 'response': 'ok'}

`
import requests
import json

req = {'object': 'abe', 'joint': 'world_y_to_world_yaw', 'yaw': 0}
r = requests.post("http://localhost:54321/abe-sim-command/to-set-joint", data=bytes(json.dumps(req), "utf-8"))
print(json.loads(r.text)['response'])
`

Set custom variable

This command sets a custom variable of an object to a particular value.

Input: a json object of the structure {'object': <string>, 'varname': <string or list of strings>, 'varvalue': <json object>, 'setWorldState': <boolean>, 'kitchenStateIn': <state description such as retrieved from to-get-kitchen>}

Output: a json object of the structure {'status': <status; is ok if all went well>, 'response': 'ok'}

`
import requests
import json

req = {'object': 'abe', 'varname': 'dummy', 'varvalue': 0}
r = requests.post("http://localhost:54321/abe-sim-command/to-set-custom-variable", data=bytes(json.dumps(req), "utf-8"))
print(json.loads(r.text)['response'])
`

Set object pose

This command adjusts the pose of an object.

Input: a json object of the structure {'object': <string>, 'position': <list of 3 numbers>, 'orientation': <list of 4 numbers>, 'setWorldState': <boolean>, 'kitchenStateIn': <state description such as retrieved from to-get-kitchen>}

Output: a json object of the structure {'status': <status; is ok if all went well>, 'response': 'ok'}

`
import requests
import json

req = {'object': 'bowl1', 'position': [0,0,0], 'orientation': [0,0,0,1]}
r = requests.post("http://localhost:54321/abe-sim-command/to-set-object-pose", data=bytes(json.dumps(req), "utf-8"))
print(json.loads(r.text)['response'])
`

Get object constants

This command retrieves constants associated to an object: its mass, dispositions, clopenable and turnable links.

Input: a json object of the structure {'object': <string>, 'setWorldState': <boolean>, 'kitchenStateIn': <state description such as retrieved from to-get-kitchen>}

Output: a json object of the structure {'status': <status; is ok if all went well>, 'response': {'mass': <number>, 'dispositions': <list of strings>, 'clopenableLinks': <list of strings>, 'turnableLinks': <list of strings>}}

`
import requests
import json

req = {'object': 'bowl1'}
r = requests.post("http://localhost:54321/abe-sim-command/to-get-object-constants", data=bytes(json.dumps(req), "utf-8"))
print(json.loads(r.text)['response'])
`

To get state updates

Retrieves a summary of changes to kinematic states.

Input: json object of form {}

Output: json object of form {'status': <status; is ok if all went well>, 'response': {'updates': <json dictionary>, 'agentLoad': <number>, 'currentCommand': <string>, 'abeActions': <list of string>}}

The updates dictionary has object names as keys, and the value is a dictionary describing updates to that object. The keys in each update are 'filename' (for the URDF), 'mesh' (for the visual representation), 'customStateVariables', 'joints' (for joint positions), 'position' (for object base position), 'orientation' (for object base orientation).

`
import requests
import json

req = {}
r = requests.post("http://localhost:54321/abe-sim-command/to-get-state-updates", data=bytes(json.dumps(req), "utf-8"))
print(json.loads(r.text)['response'])
`

Fetch an object to the counter

This command asks abe sim to bring a particular object to the countertop -- the large table next to the sink.

Input: a json object of structure {'object': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'fetchedObject': <equals object id if fetching successful, otherwise null>, 'kitchenStateOut': <world state after fetch finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually fetch the item!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

start = json.loads(open('bake_start_scene.json').read())
dpo = {'object': 'bakingTray1', 'kitchenStateIn': start, 'setWorldState': True}
r = requests.post("http://localhost:54321/abe-sim-command/to-fetch", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
response
`

Fetch and portion from an object and have the portion on the counter

This command results in abe bringing an object (the targetContainer) to the counter, and then pouring a portion of the contents of containerWithIngredient. The portion is described by a quantity, which is a number giving the portion's mass in grams.

Input: a json object of structure {'targetContainer': <object id>, 'containerWithIngredient': <object id>, 'quantity': <integer: mass in grams>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'outputContainer': <equals targetContainer id if fetching/portioning successful, otherwise null>, 'kitchenStateOut': <world state after fetch finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually fetch the item!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'containerWithIngredient': 'sugarBag', 'targetContainer': 'mediumBowl1', 'quantity': 134, 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-portion", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Transfer contents from one movable container to another

This command results in abe bringing an object (the targetContainer) to the counter, and then pouring the contents of containerWithIngredients.

Input: a json object of structure {'targetContainer': <object id>, 'containerWithIngredients': <object id>, 'quantity': <integer: mass in grams>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'containerWithAllIngredients': <equals targetContainer id if transferring successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually transfer the contents!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'containerWithInputIngredients': 'mediumBowl1', 'targetContainer': 'mediumBowl3', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-transfer", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Bring to temperature

Instructs the robot to place an item at some appropriate location that would bring the object to a particular temperature (i.e., hot, cold, frozen, or room temperature). In detail, the decision of where to place the object is taken by the robot, based on the given temperature. Above 30 degrees C, in the oven; between 10 and 4, in the refrigerator; below 4, the freezer; otherwise, some storage location in the room.

Input: a json object of structure {'containerWithIngredients': <object id>, 'temperatureQuantity': <number>, 'temperatureUnit': <string>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'containerWithIngredients': <equals object id if successful, otherwise null>, 'kitchenStateOut': <world state after fetch finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually place the item!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

start = json.loads(open('bake_start_scene.json').read())
req = {'containerWithIngredients': 'bakingTray1', 'temperatureQuantity': 150, 'temperatureUnit': 'C', 'kitchenStateIn': start, 'setWorldState': True}
r = requests.post("http://localhost:54321/abe-sim-command/to-bring-to-temperature", data=bytes(json.dumps(req), "utf-8"))
response = json.loads(r.text)
response
`

Wait

Instructs the robot to wait for some amount of time. The simulation time is 'fast-forwarded' until after that time has elapsed. This does not speed up mechanical processes by the physics engine. Rather, it only speeds up the update of temperature variables for objects.

Input: a json object of structure {'timeToWait': <number>, 'timeUnit': <string>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'kitchenStateOut': <world state after fetch finishes>}}

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

start = json.loads(open('bake_start_scene.json').read())
req = {'timeToWait': 150, 'timeUnit': 's', 'kitchenStateIn': start, 'setWorldState': True}
r = requests.post("http://localhost:54321/abe-sim-command/to-wait", data=bytes(json.dumps(req), "utf-8"))
response = json.loads(r.text)
response
`

Mixing contents into some other substance

This command results in abe using a tool (mixingTool) to mix the contents of an object (the containerWithInputIngredients) such that some new substance is created.

Input: a json object of structure {'containerWithInputIngredients': <object id>, 'mixingTool': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'containerWithMixture': <equals containerWithIngredients id if mixing successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually mix the contents!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'containerWithInputIngredients': 'mediumBowl3', 'mixingTool': 'whisk', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-mix", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Beating contents of an object together until some target mixture is achieved

This command results in abe using a tool to mix the contents of an object (the containerWithIngredients) such that some new substance is created.

Input: a json object of structure {'containerWithIngredients': <object id>, 'tool': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'containerWithIngredientsBeaten': <equals containerWithInputIngredients id if beating successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

This is effectively a duplicate of to-mix, introduced mostly because both mixing and beating appear as names of similar steps in recipes.

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually beat the contents!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

req = {'containerWithIngredients': 'mediumBowl3', 'tool': 'whisk', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-beat", data=bytes(json.dumps(req), "utf-8"))
response = json.loads(r.text)
print(response)
`

Mingling, aka tossing, aka mixing without amalgamation

This command results in abe using a tool (minglingTool) to 'mingle' the contents of an object (the containerWithInputIngredients). In this case no new substance is created -- the items in the container are simply moved around for a while. A use case of this is when tossing salads.

Input: a json object of structure {'containerWithInputIngredients': <object id>, 'minglingTool': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'containerWithMixture': <equals containerWithIngredients id if mixing successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually mix the contents!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

req = {'containerWithInputIngredients': 'mediumBowl3', 'minglingTool': 'whisk', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-mingle", data=bytes(json.dumps(req), "utf-8"))
response = json.loads(r.text)
print(response)
`

Mashing ingredients

This command results in abe using a tool (mashingTool) to mash the contents of an object (the inputIngredient).

Input: a json object of structure {'inputIngredient': <object id>, 'mashingTool': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'mashedIngredient': <equals inputIngredient if mashing successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually mash the contents!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

req = {'containerWithInputIngredients': 'mediumBowl3', 'mashingTool': 'masher', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-mash", data=bytes(json.dumps(req), "utf-8"))
response = json.loads(r.text)
print(response)
`

Grinding ingredients

This command results in abe using a tool (mashingTool) to mash the contents of an object (the inputIngredient).

Input: a json object of structure {'containerWithIngredientsToBeGround': <object id>, 'grindingTool': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'containerWithGroundIngredients': <equals containerWithIngredientsToBeGround if grinding successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually grind the contents!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

req = {'containerWithIngredientsToBeGround': 'mediumBowl3', 'grindingTool': 'pestle', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-grind", data=bytes(json.dumps(req), "utf-8"))
response = json.loads(r.text)
print(response)
`

Flattening ingredients

This command results in abe using a tool (flatteningTool) to flatten several objects (the portion).

Input: a json object of structure {'portion': <list of object ids>, 'flatteningTool': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'containerWithFlattenedItems': <object id of container for portions if flatenning successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually flatten the portions!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

req = {'portion': ['doughClump1', 'doughClump2'], 'flatenningTool': 'roller', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-flatten", data=bytes(json.dumps(req), "utf-8"))
response = json.loads(r.text)
print(response)
`

Line a container (a baking tray) with some wrapping (a baking paper)

This command results in abe bringing an item (bakingPaper) such that it covers the bottom of the interior of a container (the bakingTray).

Input: a json object of structure {'bakingTray': <object id>, 'bakingPaper': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'linedBakingTray': <equals bakingTray id if lining successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually line the baking tray!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'bakingTray': 'bakingTray1', 'bakingPaper': 'bakingSheet1', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-line", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Mashing ingredients

This command results in abe using a tool (mashingTool) to mash the contents of an object (the inputIngredient).

Input: a json object of structure {'inputIngredient': <object id>, 'mashingTool': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'mashedIngredient': <equals inputIngredient if mashing successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually mash the contents!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

req = {'containerWithInputIngredients': 'mediumBowl3', 'mashingTool': 'masher', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-mash", data=bytes(json.dumps(req), "utf-8"))
response = json.loads(r.text)
print(response)
`

Grinding ingredients

This command results in abe using a tool (mashingTool) to mash the contents of an object (the inputIngredient).

Input: a json object of structure {'containerWithIngredientsToBeGround': <object id>, 'grindingTool': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'containerWithGroundIngredients': <equals containerWithIngredientsToBeGround if grinding successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually grind the contents!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

req = {'containerWithIngredientsToBeGround': 'mediumBowl3', 'grindingTool': 'pestle', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-grind", data=bytes(json.dumps(req), "utf-8"))
response = json.loads(r.text)
print(response)
`

Flattening ingredients

This command results in abe using a tool (flatteningTool) to flatten several objects (the portion).

Input: a json object of structure {'portion': <list of object ids>, 'flatteningTool': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'containerWithFlattenedItems': <object id of container for portions if flatenning successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually flatten the portions!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

req = {'portion': ['doughClump1', 'doughClump2'], 'flatenningTool': 'roller', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-flatten", data=bytes(json.dumps(req), "utf-8"))
response = json.loads(r.text)
print(response)
`

Covering a container

This command requests the robot to cover a container (object) with another item (cover).

Input: a json object of structure {'object': <object id>, 'cover': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'coveredObject': <object id of object if covering successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually cover the object!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

req = {'object': 'mediumBowl3', 'cover': 'mediumBowlLid1', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-cover", data=bytes(json.dumps(req), "utf-8"))
response = json.loads(r.text)
print(response)
`

Uncovering a container

This command requests the robot to uncover a container (object) and then place the cover at some appropriate location.

Input: a json object of structure {'object': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'uncoveredObject': <object id of object if uncovering successful, otherwise null>, 'cover': <object id of cover if successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually uncover the object!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

req = {'object': 'mediumBowl3', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-uncover", data=bytes(json.dumps(req), "utf-8"))
response = json.loads(r.text)
print(response)
`

Portioning and arranging clumps of a substance

This command requests the robot to take out portions of some portionable substance such as dough, and place the portions on some other container.

Input: a json object of structure {'containerWithDough': <object id>, 'destination': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'portions': <list of object ids of created portions if uncovering successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually portion and arrange the substance!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

req = {'object': 'mediumBowl3', 'destination': 'bakingTray1', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-portion-and-arrange", data=bytes(json.dumps(req), "utf-8"))
response = json.loads(r.text)
print(response)
`

Shaping a substance into clumps of a particular description

This command results in abe shaping a substance contained in an item (containerWithDough) such that several clumps are formed and placed in a destination container.

Input: a json object of structure {'containerWithDough': <object id>, 'destination': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'shapedPortions': <a list of object ids for the formed clumps if shaping successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually shape the clumps!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'containerWithDough': 'mediumBowl3', 'destination': 'bakingTray1', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-shape", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Baking the contents of a container

This command results in abe baking the contents of an item (thingToBake) using an appliance (oven) and then place the baked container on some destination (inputDestinationContainer).

Input: a json object of structure {'thingToBake': <object id>, 'oven': <object id>, 'inputDestinationContainer': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'thingBaked': <equals thingToBake if baking successful, otherwise null>, 'outputDestinationContainer': <equals inputDestinationContainer if baking successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually bake (although baking times will be much shorter than reality)!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'thingToBake': 'bakingTray1', 'oven': 'kitchenStove', 'inputDestinationContainer': 'counterTop', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-bake", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Boiling the contents of a container

This command results in the robot boiling the contents of an item (thingToBoil) using an appliance (stoveToBoilOn) at a given heatingMode (must be provided in the request but presently does not have an effect) for a particular time (expressed by the timeToBoilQuantity and timeToBoilUnit).

Input: a json object of structure {'thingToBoil': <object id>, 'stoveToBoilOn': <object id>, 'heatingMode': <string>, 'timeToBoilQuantity': <number>, 'timeToBoilUnit': <string>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'thingBoiled': <equals thingToBoil if boiling successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually take the item to the place of boiling! The boil time itself however will be fast-forwarded: the simulation time is updated by that interval but without waiting for it to elapse in real time.

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'thingToBoil': 'pot1', 'stoveToBoilOn': 'stove', 'heatingMode': 'simmer', 'timeToBoilQuantity': 30, 'timeToBoilUnit': 'min', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-boil", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Frying the contents of a container

This command results in the robot frying the contents of an item (thingToFry) using an appliance (stoveToFryOn) at a given heatingMode (must be provided in the request but presently does not have an effect) for a particular time (expressed by the timeToFryQuantity and timeToFryUnit).

Input: a json object of structure {'thingToFry': <object id>, 'stoveToFryOn': <object id>, 'heatingMode': <string>, 'timeToFryQuantity': <number>, 'timeToFryUnit': <string>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'thingFried': <equals thingToFry if frying successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually take the item to the place of frying! The fry time itself however will be fast-forwarded: the simulation time is updated by that interval but without waiting for it to elapse in real time.

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'thingToFry': 'pot1', 'stoveToFryOn': 'stove', 'heatingMode': 'low', 'timeToFryQuantity': 30, 'timeToFryUnit': 'min', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-fry", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Melting the contents of a container

This command results in the robot melting the contents of an item (containerWithInputIngredients) using an appliance (meltingTool) and then stores the container at some appropriate location.

Input: a json object of structure {'containerWithInputIngredients': <object id>, 'meltingTool': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'containerWithMeltedIngredients': <equals containerWithInputIngredients if melting successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually take the item to the place of melting! The melting time will however be much shorter than it would be in the real world.

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'containerWithInputIngredients': 'pot1', 'meltingTool': 'stove', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-melt", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Washing an item

This command results in the robot washing an object (thingToWash) at a given location (sink) and then storing it at a specified destination (inputDestinationContainer).

Input: a json object of structure {'thingToWash': <object id>, 'sink': <object id>, 'inputDestinationContainer': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'thingWashed': <equals thingToWash if washing successful, otherwise null>, 'outputDestinationContainer': <equals inputDestinationContainer if washing successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually take the item to the place of washing and then to the container!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'thingToWash': 'broccoli1', 'sink': 'sink', 'inputDestinationContainer': 'mediumBowl3', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-wash", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Sprinkling the contents of a container

This command results in abe sprinkling the contents of an item (object) with the contents of another (toppingContainer).

Input: a json object of structure {'object': <object id>, 'toppingContainer': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'sprinkledObject': <equals object if sprinkling successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually sprinkle!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'object': 'bakingTray1', 'toppingContainer': 'sugarShaker', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-sprinkle", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Flouring a container

This command results in abe flouring an item (containerToFlour) with the contents of another (ingredientToFlourWith).

Input: a json object of structure {'containerToFlour': <object id>, 'ingredientToFlourWith': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'flouredContainer': <equals containerToFlour if flouring successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually flour!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'containerToFlour': 'bakingTray1', 'ingredientToFlourWith': 'flourBag1', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-flour", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Greasing a container

This command results in abe greasing an item (containerToFlour) with the contents of another (ingredientToGreaseWith).

Input: a json object of structure {'containerToGrease': <object id>, 'ingredientToGreaseWith': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'greasedContainer': <equals containerToGrease if greasing successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually grease!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'containerToGrease': 'bakingTray1', 'ingredientToGreaseWith': 'flourBag1', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-flour", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Cutting an item

This command results in abe using a cuttingTool to cut an object into a cuttingPattern (currently, this pattern is ignored but should nevertheless be provided).

Input: a json object of structure {'object': <object id>, 'cuttingTool': <object id>, 'cuttingPattern': <string>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'cutObject': <equals object id if action successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually cut the object!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'object': 'broccoli1', 'cuttingTool': 'knife', 'cuttingPattern': 'dice', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-cut", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Peeling an item

This command results in abe using a peelingTool to cut an inputIngredient. The produced peels will be placed in a containerForPeels, and the peeled item into a containerForPeeledIngredient.

Input: a json object of structure {'inputIngredient': <object id>, 'peelingTool': <object id>, 'containerForPeels': <object id>, 'containerForPeeledIngredient': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'peeledIngredient': <equals containerForPeeledIngredient if action successful, otherwise null>, 'peelOfIngredient': <equals containerForPeels if successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually peel the object!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'object': 'onion1', 'peelingTool': 'knife', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-peel", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Seeding an item

This command results in abe using a seedingTool to take out the seeds of an inputIngredient. The produced seeds will be placed in a containerForSeeds, and the seeded item into a containerForSeededIngredient.

Input: a json object of structure {'inputIngredient': <object id>, 'seedingTool': <object id>, 'containerForSeeds': <object id>, 'containerForSeededIngredient': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'seededIngredient': <equals containerForSeededIngredient if action successful, otherwise null>, 'seedOfIngredient': <equals containerForSeeds if successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually remove the seeds the object!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'object': 'cutApple1', 'seedingTool': 'knife', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-seed", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Placing an item

This command results in abe placing an object at a given container. This is a generalization of to-fetch (which always brings the object to the kitchen counter).

Input: a json object of structure {'object': <object id>, 'container': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'placedObject': <equals object if action successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually place the object!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'object': 'cutApple1', 'container': 'bakingTray', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-place", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Transferring items

This command results in abe placing itemsToTransfer on a destination.

Input: a json object of structure {'itemsToTransfer': <list of object ids>, 'destination': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'transferredContainer': <equals destination if action successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually transferring the items!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'itemsToTransfer': ['apple1', 'apple2'], 'destination': 'bakingTray', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-transfer-items", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Refrigerating an item

This command results in abe placing a containerWithIngredients in a refrigerator.

Input: a json object of structure {'containerWithIngredients': <object id>, 'refrigerator': <object id>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'containerWithIngredientsAtTemperature': <equals containerWithIngredients if action successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually place the object!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'containerWithIngredients': 'mediumBowl3', 'refrigerator': 'refrigerator', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-refrigerate", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`

Preheating the oven

This command results in abe adjust the temperature setting (expressed by quantity and unit) of an oven.

Input: a json object of structure {'oven': <object id>, 'quantity': <number>, 'unit': <string>, 'kitchenStateIn': <kitchen state or null>, 'setWorldState': <boolean; should not be true if kitchenStateIn is null>}

Output: a json object of structure {'status': <status; is ok if all went well>, 'response': {'preheatedOven': <equals oven if action successful, otherwise null>, 'kitchenStateOut': <world state after action finishes>}}

Note, it will take a long time to get a response to this request -- as long as the robot needs to actually adjust the oven controls!

(Code snippet below assumes you run it in a python instance that was started at the abe_sim/src folder.)

`
import requests
import json

dpo = {'oven': 'oven', 'quantity': 150, 'unit': 'C', 'kitchenStateIn': None, 'setWorldState': False}
r = requests.post("http://localhost:54321/abe-sim-command/to-preheat-oven", data=bytes(json.dumps(dpo), "utf-8"))
response = json.loads(r.text)
print(response)
`