Repository: stepjam/RLBench
Issue: Control Environment Light Conditions
Root cause: Documentation Deficiency

I'd like to have some additional control over the lighting & shadows in the scene for domain randomization. Has anyone found a way to do this? It doesn't seem like there's a direct way to adjust these in either RLBench or PyRep.

The closest that I've come is attempting to interact with the dummy that the default lights are child of:
```Python
from rlbench import DomainRandomizationEnvironment
from rlbench import RandomizeEvery
from rlbench import VisualRandomizationConfig
from rlbench import ArmActionMode
from rlbench import ObservationConfig
from rlbench.action_modes import ActionMode
from rlbench.tasks import ReachTarget
import numpy as np

from pyrep.objects.dummy import Dummy

def act(obs):
    return np.concatenate([obs.joint_positions, [1.0]], axis=-1)

obs_config = ObservationConfig()
rand_config = VisualRandomizationConfig(image_directory='../tests/unit/assets/textures')

action_mode = ActionMode(ArmActionMode.ABS_JOINT_POSITION)
env = DomainRandomizationEnvironment(action_mode,
                                     obs_config=obs_config,
                                     headless=False,
                                     randomize_every=RandomizeEvery.EPISODE,
                                     frequency=1,
                                     visual_randomization_config=rand_config,
                                     static_positions=True)
env.launch()
task = env.get_task(ReachTarget)

##########################################
# Code to interact with the lights Dummy #
##########################################

lights = Dummy('DefaultLights')
lights_type = lights.get_type()
lights_position = lights.get_position()
print(f'Dummy lights: {lights_type} at {lights_position}')
lights.set_position([-1, -1, -1])

##########################################

for i in range(3):  # Demos
    descriptions, obs = task.reset()    
    for i in range(40):  # Steps in each demo
        obs, reward, terminate = task.step(act(obs))
env.shutdown()
```

This does recognize the Dummy but the attempt to set the dummy at a new location is foiled by the light type...
```shell
Dummy lights: ObjectType.DUMMY at [0. 0. 0.]
/home/andrew/anaconda3/envs/py3/lib/python3.7/site-packages/pyrep/objects/object.py:669: UserWarning: Object (62, 'DefaultLightC') has ObjectType.LIGHT, which is not supported
  'which is not supported'.format(handle, name, type))
/home/andrew/anaconda3/envs/py3/lib/python3.7/site-packages/pyrep/objects/object.py:669: UserWarning: Object (63, 'DefaultLightD') has ObjectType.LIGHT, which is not supported
  'which is not supported'.format(handle, name, type))
/home/andrew/anaconda3/envs/py3/lib/python3.7/site-packages/pyrep/objects/object.py:669: UserWarning: Object (64, 'DefaultLightA') has ObjectType.LIGHT, which is not supported
  'which is not supported'.format(handle, name, type))
/home/andrew/anaconda3/envs/py3/lib/python3.7/site-packages/pyrep/objects/object.py:669: UserWarning: Object (65, 'DefaultLightB') has ObjectType.LIGHT, which is not supported
```
Can anyone suggest a work around for this? I'd really like to control the lights directly. 

Yes previously lights were not really supported in PyRep, but they are now. It is very simple:

```
from pyrep.objects.light import Light
l = Light(‘my_light’)
l.set_diffuse([1.0, 0, 0]) # Red light
```

Where ‘my_light’ is the light you want from RLBench.
You can use any of the light functions here: https://github.com/stepjam/PyRep/blob/master/pyrep/objects/light.py