This editor example shows how to interact with holodeck worlds while they are being built
in the Unreal Engine. Most people that use holodeck will not need this.
sensors = [Sensors.RGB_CAMERA]
agent_definitions = [
AgentDefinition("turtle0", agents.TurtleAgent, sensors),
AgentDefinition("turtle1", agents.TurtleAgent, sensors),
AgentDefinition("turtle2", agents.TurtleAgent, sensors),
AgentDefinition("turtle3", agents.TurtleAgent, sensors),
AgentDefinition("turtle4", agents.TurtleAgent, sensors)
]
env = HolodeckEnvironment(agent_definitions, start_world=False)
command = [0, 10]
for i in range(10):
env.reset()
_ = env.act("turtle0", command)
_ = env.act("turtle1", command)
_ = env.act("turtle2", command)
_ = env.act("turtle3", command)
_ = env.act("turtle4", command)
for _ in range(10000):
states = env.tick()
print(states["turtle0"][Sensors.REWARD])
// pixels = states["turtle0"][Sensors.RGB_CAMERA]
// cv2.namedWindow("Image")
// cv2.moveWindow("Image", 500, 500)
After Change
env.reset()
env.send_world_command("SetWeather", string_params=["rain"])
for _ in range(1000):
state, reward, terminal, _ = env.step(command)
def editor_multi_agent_example():
This editor example shows how to interact with holodeck worlds that have multiple agents.