Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mulit-Agent 2 image window #239

Open
jiafei1224 opened this issue Jun 25, 2019 · 6 comments
Open

Mulit-Agent 2 image window #239

jiafei1224 opened this issue Jun 25, 2019 · 6 comments

Comments

@jiafei1224
Copy link

Can check with you if when running the multi-agent, is it suppose to have two separate pop up window with two different POV? Cause i have only one POV but still able to control both agent.

@jiafei1224
Copy link
Author

There is like a overlay of POV, how to i separate it into two different window?

@jiafei1224
Copy link
Author

And when i run my mulit-agent, it says my multi-agent has AttributeError: 'MultiAgentEvent' object has no attribute 'frame'

@ekolve
Copy link

ekolve commented Jul 2, 2019

For displaying the each view in a multi-agent environment, the easiest way would probably be use opencv to display the window as follows

import cv2
multi_agent_event = controller.step(action=dict(action='RotateRight'))

for i,e in enumerate(multi_agent_event.events):
    cv2.imshow('agent%s' % i, e.cv2img)

There doesn't appear to be a trivial way to display a window per agent using Unity.

I am not clear what you mean by overlay of the POV. If it is the instance segmentation mask, you could display it separately using opencv.

To get access to the frame parameter, you must index in to the agent you want to see the frame for:

multi_agent_event = controller.step(action=dict(action='RotateRight'))
multi_agent_event.events[0].frame # frame for agent 1
multi_agent_event.events[1].frame # frame for agent 2 (if one exists)


@grahamannett
Copy link

grahamannett commented Jul 9, 2019

Im messing around with this and trying to understand the framework and trying to understand some stuff but wanted to do what @jiafei1224 is doing. It seems like it should be feasible to have multiple controllers that work on the same "server" ? Im confused about a few terms and they dont seem documented really, what is a "controller" supposed to be and what is the "server" supposed to be doing?

Was hoping something like

shared_server = server.Server(shared_request_queue, shared_response_queue, host, port=port)
main_controller = ai2thor.controller.Controller(quality='Very Low')
event = main_controller.start_shared_server(shared_server)

second_controller = ai2thor.controller.Controller(quality='Very Low')
second_controller.attach_shared_server(shared_server)

Is it even possible to see the same scene with multiple controllers or is a controller supposed an isolated unity process? I guess can the agents be gotten from server for a controller?

@mattdeitke
Copy link
Contributor

#343 (comment)
Seems related, but the best approach would be to create some sort of local dashboard that renders all views. We will likely get around to support this at some point.

@Frost-99
Copy link

Frost-99 commented Sep 9, 2020

Hi,
Is there a way to switch between different agent's view when there are multiple agents? I created two agents and the Unity window displays agent1's view by default and whenever agent0 takes action the Unity window quickly flashes to agent0's view and then flashes back to agent1's view again. Is there a way to switch the default view to agent0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants