You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem to load replica dataset as backend_cfg in habitat.
I use the same way which load skokloster-castle.glb. Thus, I change the backend_cfg.scene.id from "skokloster-castle.glb" to t sorted_faces_apartment_0.bin. It did not work.
How use Replica within AI Habitat like load background of skokloster-castle.glb?
Below is my script.
backend_cfg = habitat_sim.SimulatorConfiguration()
backend_cfg.scene.id = (
"~sorted_faces/sorted_faces_apartment_0")
hfov = 2 * math.degrees(math.atan(width / (2 * cam_focalLength)))
vfov = 2 * math.degrees(math.atan(height / (2 * cam_focalLength)))
# First, let's create a stereo RGB agent
left_rgb_sensor = habitat_sim.SensorSpec()
# Give it the uuid of left_sensor, this will also be how we
# index the observations to retrieve the rendering from this sensor
left_rgb_sensor.uuid = "left_sensor"
left_rgb_sensor.resolution = [height, width]
left_rgb_sensor.parameters["hfov"] = str(hfov)
left_rgb_sensor.parameters["vfov"] = str(vfov)
# The left RGB sensor will be 1.5 meters off the ground
# and 0.25 meters to the left of the center of the agent
left_rgb_sensor.position = 1.5 * habitat_sim.geo.UP + (cam_baseline / 2) * habitat_sim.geo.LEFT
# Same deal with the right sensor
right_rgb_sensor = habitat_sim.SensorSpec()
right_rgb_sensor.uuid = "right_sensor"
right_rgb_sensor.resolution = [height, width]
right_rgb_sensor.parameters["hfov"] = str(hfov)
right_rgb_sensor.parameters["vfov"] = str(vfov)
# The right RGB sensor will be 1.5 meters off the ground
# and 0.25 meters to the right of the center of the agent
right_rgb_sensor.position = 1.5 * habitat_sim.geo.UP + (cam_baseline / 2) * habitat_sim.geo.RIGHT
# Now let's do the exact same thing but for a depth camera stereo pair!
left_depth_sensor = habitat_sim.SensorSpec()
left_depth_sensor.uuid = "left_sensor_depth"
left_depth_sensor.resolution = [height, width]
left_depth_sensor.parameters["hfov"] = str(hfov)
left_depth_sensor.parameters["vfov"] = str(vfov)
left_depth_sensor.position = 1.5 * habitat_sim.geo.UP + (cam_baseline / 2) * habitat_sim.geo.LEFT
# The only difference is that we set the sensor type to DEPTH
left_depth_sensor.sensor_type = habitat_sim.SensorType.DEPTH
right_depth_sensor = habitat_sim.SensorSpec()
right_depth_sensor.uuid = "right_sensor_depth"
right_depth_sensor.resolution = [height, width]
right_depth_sensor.parameters["hfov"] = str(hfov)
right_depth_sensor.parameters["vfov"] = str(vfov)
right_depth_sensor.position = 1.5 * habitat_sim.geo.UP + (cam_baseline / 2) * habitat_sim.geo.RIGHT
# The only difference is that we set the sensor type to DEPTH
right_depth_sensor.sensor_type = habitat_sim.SensorType.DEPTH
agent_config = habitat_sim.AgentConfiguration() # set configuration for agent (id = 0)
agent_config.sensor_specifications = [left_rgb_sensor, right_rgb_sensor, left_depth_sensor, right_depth_sensor]
sim = habitat_sim.simulator.Simulator(habitat_sim.Configuration(backend_cfg, [agent_config]))
# set agent position
inital_state_agent = place_agent(sim, agent_config)
# print("inital agent state: {0} ".format(inital_state_agent))
print("inital agent's sensor state: {0} ".format(inital_state_agent.sensor_states))
# set action
_render(sim)
The text was updated successfully, but these errors were encountered:
Hey @wwtx9, you need the sorted_faces.bin file for Replica, but you actually want to point the simulator to one of the .ply files from the ReplicaDataset download.
❓ Questions and Help
I have a problem to load replica dataset as backend_cfg in habitat.
I use the same way which load skokloster-castle.glb. Thus, I change the backend_cfg.scene.id from "skokloster-castle.glb" to t sorted_faces_apartment_0.bin. It did not work.
How use Replica within AI Habitat like load background of skokloster-castle.glb?
Below is my script.
The text was updated successfully, but these errors were encountered: