allenai / allenai/Holodeck

unable to move agent

Aberta
#87 2 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
571
Forks
66
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Hello, I am trying to get depth frame using `controller.last_event.depth_frame` and this needs me to first move agent to proper position and rotate the agent. However, I used the api `teleport` but it did not work, the agent stay in the original position. Btw, when I modify the scene json file, more specifically, modify 'agentposes.default.position', the agent successfully changed the position. I wonder what's happening here. Thanks! My codes are as follows:

args = parser.parse_args()

scene = compress_json.load(args.scene_path)
scene["objects"] = scene["floor_objects"] + scene["wall_objects"] + scene["small_objects"]

os.makedirs(args.save_dir, exist_ok=True)

controller = Controller(
commit_id=THOR_COMMIT_ID,
agentMode="default",
makeAgentsVisible=False,
visibilityDistance=2,
scene=scene,
renderDepthImage=True,
width=int(args.width),
height=int(args.height),
fieldOfView=90,
action_hook_runner=ProceduralAssetHookRunner(
asset_directory=args.objaverse_asset_dir,
asset_symlink=True,
verbose=True,
),
)

wall_height = max([point["y"] for point in scene["walls"][0]["polygon"]])

room = scene["rooms"][0]
# TODO: modify camera height
camera_height = wall_height - 0.2
print("camera height: ", camera_height)

room_vertices = [[point["x"], point["z"]] for point in room["floorPolygon"]]

room_center = np.mean(room_vertices, axis=0)
floor_center = np.array([room_center[0], 0, room_center[1]])
camera_center = np.array([room_center[0], camera_height, room_center[1]])
corners = np.array(
[[point["x"], point["y"], point["z"]] for point in room["floorPolygon"]]
)
farest_corner = corners[
np.argmax(np.linalg.norm(corners - camera_center, axis=1))
]

vector_1 = floor_center - camera_center
vector_2 = farest_corner - camera_center
x_angle = (
90
- np.arccos(
np.dot(vector_1, vector_2)
/ (np.linalg.norm(vector_1) * np.linalg.norm(vector_2))
)
* 180
/ np.pi
)

print(camera_center)

event = controller.step(
action="Teleport",
position=dict(
x=camera_center[0], y=camera_center[1], z=camera_center[2]
),
rotation=dict(x=0, y=0, z=0),
horizon=0,
standing=True
)

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.