Randomizes all the materials in the scene. Each object may only randomize to sensible materials from a similar material type. For instance, an

Apple
's materials won't change to an
Orange
's materials, and a
Chair
's material won't change to a
Plant
's material. Empirically, the rooms generated from material randomization look incredibly realistic in most cases. Upon calling reset, materials change back to their original values.

controller.step(
    action="RandomizeMaterials",
    useTrainMaterials=None,
    useValMaterials=None,
    useTestMaterials=None,
    inRoomTypes=None
)
Test it live on the demo

Randomize Materials Parameters

Specifies if the randomization should include materials found in training rooms. Training rooms consist of all of the following:

  • Kitchens: FloorPlan[1:20]\text{FloorPlan}[1:20]
  • Living Rooms: FloorPlan[201:220]\text{FloorPlan}[201:220]
  • Bedrooms: FloorPlan[301:320]\text{FloorPlan}[301:320]
  • Bathrooms: FloorPlan[401:420]\text{FloorPlan}[401:420]
  • RoboTHOR Train: FloorPlan_Trainβˆ—_βˆ—\text{FloorPlan}\_\text{Train}*\_*

If the agent is in one of the above scenes and

None
is passed in, then
useTrainMaterials
will default to
True
. Otherwise, it will default to
False
.

An exception is thrown if you are in a train scene, and you pass in

useTrainMaterials
as
False
. We do this because it guarantees every object can randomize to at least one material.

Specifies if the randomization should include materials found in validation rooms. Validation rooms consist of all of the following:

  • Kitchens: FloorPlan[21:25]\text{FloorPlan}[21:25]
  • Living Rooms: FloorPlan[221:225]\text{FloorPlan}[221:225]
  • Bedrooms: FloorPlan[321:325]\text{FloorPlan}[321:325]
  • Bathrooms: FloorPlan[421:425]\text{FloorPlan}[421:425]
  • RoboTHOR Val: FloorPlan_Valβˆ—_βˆ—\text{FloorPlan}\_\text{Val}*\_*

If the agent is in one of the above scenes and

None
is passed in, then
useValMaterials
will default to
True
. Otherwise, it will default to
False
.

An exception is thrown if you are in a validation scene, and you pass in

useValMaterials
as
False
. We do this because it guarantees every object can randomize to at least one material.

Specifies if the randomization should include materials found in testing rooms. Testing rooms consist of all of the following:

  • Kitchens: FloorPlan[26:30]\text{FloorPlan}[26:30]
  • Living Rooms: FloorPlan[226:230]\text{FloorPlan}[226:230]
  • Bedrooms: FloorPlan[326:330]\text{FloorPlan}[326:330]
  • Bathrooms: FloorPlan[426:430]\text{FloorPlan}[426:430]

If the agent is in one of the above scenes and

None
is passed in, then
useTestMaterials
will default to
True
. Otherwise, it will default to
False
.

An exception is thrown if you are in a testing scene, and you pass in

useTestMaterials
as
False
. We do this because it guarantees every object can randomize to at least one material.

Specifies which room types the randomizable materials may come from.

Valid room types include

Kitchen
,
LivingRoom
,
Bedroom
,
Bathroom
, and
RoboTHOR
. Casing is ignored. An exception is thrown if an unknown room type is passed in.

If

None
is passed in, then all room types will be included.

An exception is thrown if the current room type is not included in

inRoomTypes
and
None
is not passed in. We do this because it guarantees every object can randomize to at least one material.

controller.step(
    action="RandomizeLighting",
    brightness=(0.5, 1.5),
    randomizeColor=True,
    hue=(0, 1),
    saturation=(0.5, 1),
    synchronized=False
)
Test it live on the demo

Randomize Lighting Parameters

Sets the bounds with which a light's intensity may be multiplied by. Higher values are brighter. Both values must be greater than 00. The order of the values does not matter.

Specifies if the color should be randomized. If set to

False
, only each lights intensity may change.

Sets the (min⁑,max⁑)(\min, \max) domain of possible hue values for each light, which affects its color. Valid values are ranges between [0:1][0:1], where:

  • 00 maps to a hue of 00 degrees (i.e., red).
  • 0.50.5 maps to a hue of 180180 degrees (i.e., green).
  • 11 maps to a hue of 360360 degrees (i.e., red).

Sets the (min⁑,max⁑)(\min, \max) domain of possible saturation values for each light. Valid values are ranges between [0:1][0:1], where 00 corresponds to grayscale and 11 corresponds to full saturation.

Specifies if all lights in the room should be randomized with the same values (i.e., intensity and color). When

False
, each lighting object gets its own independent randomized intensity and randomized color.

InitialRandomSpawn
attempts to randomize the position of
Pickupable
objects, placing them in any valid receptacle they could be placed in within the scene. Objects are not guaranteed to move from their default position, as sometimes there is not enough free space in the scene for an object to move.

Warning

After calling initial random spawn, each object will have its objectId recomputed (in the form of "objectType|x|y|z"). Thus, objects that move will have their objectId's changed. This is necessary to prevent collisions between objectId's, since initial random spawn may be used to duplicate existing objects in the scene.

controller.step(
    action="InitialRandomSpawn",
    randomSeed=0,
    forceVisible=False,
    numPlacementAttempts=5,
    placeStationary=True,
    numDuplicatesOfType = [
        {
            "objectType": "Statue"
             "count": 20
        },
        {
            "objectType": "Bowl"
            "count": 20,
        }
    ],
    excludedReceptacles=["CounterTop", "DiningTable"],
    excludedObjectIds=["Apple|1|1|2"]
)

Initial Random Spawn Parameters

Used to seed the randomization for duplicatable scene states. Because this seed depends on the current state of the scene, remember to reset the scene with controller.reset() before running InitialRandomSpawn(), otherwise the seeded randomization will not be accurate.

When enabled, the scene will attempt to randomize all moveable objects outside of receptacles in plain view. Use this if you want to avoid objects spawning out of view inside closed drawers, cabinets, etc.

How many times each object in the scene attempts to randomly spawn. Setting this value higher will lead to fewer spawn failures at the cost of performance.

Determines if spawned objects will be settled completely static and unmoving, or if non-determenistic physics resolve their final position. Setting this to False will allow physics to resolve final positions, which can be used to spawn an object on a sloped receptacle but have it end up rolling off.

Used to specify how many objects of a certain type will attempt to be duplicated somewhere in the scene. It does not guarantee this number of duplicated objects, only the number of attempted spawned objects, so this is the max it will be. This will only create copies of objects already in the scene, so if you request an object which is not in the scene upon reset, it will not work.

A list of receptacle object types to exclude from valid receptacles that can be randomly chosen as a spawn location. An example use case is excluding all CounterTop receptacles to allow for a scene configuration that has more free space on CounterTops in case you need free space for interaction. Note that this will not guarantee all listed receptacles as being completely clear of objects, as any objects that failed to reposition will remain in their default position, which might have been on the excluded receptacle type. Check the Actionable Properties section of the Objects documentation for a full list of Receptacle objects.

Used to prevent certain objects from changing in position.

Remark

This is often nice for rearrangement related tasks.

controller.step(action="RandomizeColors")
Test it live on the demo

Randomize Colors Description

Randomizes the color of each object in the scene. Compared to

RandomizeMaterials
,
RandomizeColors
looks much less realistic, but does enable a huge potential for visual variance.

Each color is uniformly sampled with a hue between [0:1][0:1], a saturation in [0.5:1][0.5:1], and a value in [0.5:1][0.5:1].