ai2thor
ai2thor copied to clipboard
How to get top-down map without the agent in the scene?
When we use the AddThirdPartyCamera
action to get the top-down map, there is the agent in the scene. How can we get the top-down map without the agent in the scene?
And, when we use action AddThirdPartyCamera
, we cannot set the y of camera too high, cause that if the y is over the size of the bounds, the camera can only capture the ceiling. So how can we set the parameter of the action AddThirdPartyCamera
, we can get the whole complete top-down map of the proper size?
How can we get the top-down map without the agent in the scene?
Try passing in makeAgentsVisible=False
upon Controller initialization or reset (e.g.,:
from ai2thor.controller import Controller
controller = Controller(makeAgentsVisible=False)
Note that this will hide the agents in all of the camera views.
we cannot set the y of camera too high, cause that if the y is over the size of the bounds
When you create / update a third party camera, try passing in farClippingPlane=50
, or some larger number. This represents the maximum meters from the camera that pixels may render in the frame.
When you create / update a third party camera, try passing in
farClippingPlane=50
, or some larger number. This represents the maximum meters from the camera that pixels may render in the frame.
For this, I mean althrough I set farClippingPlane=50
, when I set y
to 2.7, the camera only shows the ceiling covering the scene, when I set y
to 2.5, the camera can get the image o f the scene, but sometimes it cannot obtain the image of the whole scene because the y
is not high enough. However if the y
is set high enough, the camera can only get the ceiling covering the scene, and it has nothing to do with the value of farClippingPlane
.
Oh, I see. Try also passing in rotation=dict(x=90, y=0, z=0). This will tilt the camera down.
Also, you may find the GetMapViewCameraProperties action useful: https://github.com/allenai/ai2thor/pull/814 :)
Oh, I see. Try also passing in rotation=dict(x=90, y=0, z=0). This will tilt the camera down.
Also, you may find the GetMapViewCameraProperties action useful: #814 :)
In scenes in i-thor, there exist the ceiling, and use this function, the ceiling cover the while scene, I use the following code:
controller = Controller(
scene = "FloorPlan221",
gridSize = 0.25,
renderDepthImage = True,
renderInstanceSegmentation = True,
makeAgentsVisible = False
)
event = controller.step(action = "GetMapViewCameraProperties", raise_for_failure = True)
pose = copy.deepcopy(event.metadata["actionReturn"])
bounds = event.metadata["sceneBounds"]["size"]
max_bound = max(bounds["x"], bounds["z"])
pose["fieldOfView"] = 50
pose["position"]["y"] += 1.1 * max_bound
pose["orthographic"] = False
pose["farClippingPlane"] = 50
pose["rotation"] = dict(x = 90, y = 0, z = 0)
del pose["orthographicSize"]
event = controller.step(
action= "AddThirdPartyCamera",
**pose,
skyboxColor = "white",
raise_for_failure = True,
)
top_down_frame = event.third_party_camera_frames[-1]
plt.imsave("ai_top.png", top_down_frame)
and I get the following result:
The celling cover the scene. How can we solve this problem?
Oh, I see. Try also passing in rotation=dict(x=90, y=0, z=0). This will tilt the camera down.
Also, you may find the GetMapViewCameraProperties action useful: #814 :)
Also, we cant to know how to draw the 3d scene images like this?