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

[0.2.3][Hydra Migration] Made agents to be of type Dict[str, AgentConfig] and added migration readme #1007

Merged
merged 14 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/pages/habitat-lab-demo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ the config object.
config = habitat.get_config(config_paths="benchmark/nav/pointnav/pointnav_mp3d.yaml")
with read_write(config):
config.habitat.dataset.split = "val"
config.habitat.simulator.agent_0.sim_sensors.update(
config.habitat.simulator.agents.agent_0.sim_sensors.update(
{"semantic_sensor": HabitatSimSemanticSensorConfig(height=256, width=256)}
)
config.habitat.simulator.turn_angle = 30
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/view-transform-warp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ validate that transformation comparing projected and original views.
config = habitat.get_config(config_paths="benchmark/nav/pointnav/pointnav_habitat_test.yaml")
with read_write(config):
config.habitat.dataset.split = "val"
config.habitat.simulator.agent_0.sim_sensors.depth_sensor.normalize_depth = False
config.habitat.simulator.agents.agent_0.sim_sensors.depth_sensor.normalize_depth = False

# Intrinsic parameters, assuming width matches height. Requires a simple refactor otherwise
W = config.habitat.simulator.agent_0.sim_sensors.depth_sensor.width
H = config.habitat.simulator.agent_0.sim_sensors.depth_sensor.height
W = config.habitat.simulator.agents.agent_0.sim_sensors.depth_sensor.width
H = config.habitat.simulator.agents.agent_0.sim_sensors.depth_sensor.height

assert(W == H)
hfov = float(config.habitat.simulator.agent_0.sim_sensors.depth_sensor.hfov) * np.pi / 180.
hfov = float(config.habitat.simulator.agents.agent_0.sim_sensors.depth_sensor.hfov) * np.pi / 180.


env = habitat.Env(config=config)
Expand Down
2 changes: 1 addition & 1 deletion examples/interactive_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ def has_pygame():

if not args.same_task:
sim_config.debug_render = True
sim_config.agent_0.sim_sensors.update(
sim_config.agents.agent_0.sim_sensors.update(
{
"third_rgb_sensor": ThirdRGBSensorConfig(
height=args.play_cam_res, width=args.play_cam_res
Expand Down
29 changes: 15 additions & 14 deletions examples/tutorials/colabs/Habitat2_Quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
" # Added settings to make rendering higher resolution for better visualization\n",
" with habitat.config.read_write(config):\n",
" config.habitat.simulator.concur_render = False\n",
" config.habitat.simulator.agent_0.sim_sensors.update(\n",
" config.habitat.simulator.agents.agent_0.sim_sensors.update(\n",
" {\"third_rgb_sensor\": ThirdRGBSensorConfig(height=512, width=512)}\n",
" )\n",
" return config\n",
Expand Down Expand Up @@ -413,7 +413,7 @@
"\n",
"defaults:\n",
" - /habitat: habitat_config_base\n",
" - /agent@habitat.simulator.agent_0: agent_base\n",
" - /agent@habitat.simulator.agents.agent_0: agent_base\n",
" - /habitat/simulator/sim_sensors:\n",
" - head_rgb_sensor\n",
" - /habitat/task: task_config_base\n",
Expand Down Expand Up @@ -486,18 +486,19 @@
" action_space_config: v0\n",
" concur_render: False\n",
" auto_sleep: False\n",
" agent_0:\n",
" height: 1.5\n",
" is_set_start_state: False\n",
" radius: 0.1\n",
" sim_sensors:\n",
" head_rgb_sensor:\n",
" height: 128\n",
" width: 128\n",
" start_position: [0, 0, 0]\n",
" start_rotation: [0, 0, 0, 1]\n",
" robot_urdf: ./data/robots/hab_fetch/robots/hab_fetch.urdf\n",
" robot_type: \"FetchRobot\"\n",
" agents:\n",
" agent_0:\n",
" height: 1.5\n",
" is_set_start_state: False\n",
" radius: 0.1\n",
" sim_sensors:\n",
" head_rgb_sensor:\n",
" height: 128\n",
" width: 128\n",
" start_position: [0, 0, 0]\n",
" start_rotation: [0, 0, 0, 1]\n",
" robot_urdf: ./data/robots/hab_fetch/robots/hab_fetch.urdf\n",
" robot_type: \"FetchRobot\"\n",
"\n",
" # Agent setup\n",
" # ARM_REST: [0.6, 0.0, 0.9]\n",
Expand Down
29 changes: 15 additions & 14 deletions examples/tutorials/nb_python/Habitat2_Quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def insert_render_options(config):
# Added settings to make rendering higher resolution for better visualization
with habitat.config.read_write(config):
config.habitat.simulator.concur_render = False
config.habitat.simulator.agent_0.sim_sensors.update(
config.habitat.simulator.agents.agent_0.sim_sensors.update(
{"third_rgb_sensor": ThirdRGBSensorConfig(height=512, width=512)}
)
return config
Expand Down Expand Up @@ -362,7 +362,7 @@ class NavPickSuccessMeasurementConfig(MeasurementConfig):

defaults:
- /habitat: habitat_config_base
- /agent@habitat.simulator.agent_0: agent_base
- /agent@habitat.simulator.agents.agent_0: agent_base
- /habitat/simulator/sim_sensors:
- head_rgb_sensor
- /habitat/task: task_config_base
Expand Down Expand Up @@ -435,18 +435,19 @@ class NavPickSuccessMeasurementConfig(MeasurementConfig):
action_space_config: v0
concur_render: False
auto_sleep: False
agent_0:
height: 1.5
is_set_start_state: False
radius: 0.1
sim_sensors:
head_rgb_sensor:
height: 128
width: 128
start_position: [0, 0, 0]
start_rotation: [0, 0, 0, 1]
robot_urdf: ./data/robots/hab_fetch/robots/hab_fetch.urdf
robot_type: "FetchRobot"
agents:
agent_0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
agent_0:
main_agent:

height: 1.5
is_set_start_state: False
radius: 0.1
sim_sensors:
head_rgb_sensor:
height: 128
width: 128
start_position: [0, 0, 0]
start_rotation: [0, 0, 0, 1]
robot_urdf: ./data/robots/hab_fetch/robots/hab_fetch.urdf
robot_type: "FetchRobot"

# Agent setup
# ARM_REST: [0.6, 0.0, 0.9]
Expand Down
5 changes: 4 additions & 1 deletion habitat-baselines/habitat_baselines/agents/slam_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ def ResizePIL2(np_img, size=256):


def make_good_config_for_orbslam2(config):
config.habitat.simulator.agent_0.sensors = ["rgb_sensor", "depth_sensor"]
config.habitat.simulator.agents.agent_0.sensors = [
"rgb_sensor",
"depth_sensor",
]
config.habitat.simulator.rgb_sensor.width = 256
config.habitat.simulator.rgb_sensor.height = 256
config.habitat.simulator.depth_sensor.width = 256
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _generate_fn(scene):
)
with habitat.config.read_write(cfg):
cfg.habitat.simulator.scene = scene
cfg.habitat.simulator.agent_0.sensors = []
cfg.habitat.simulator.agents.agent_0.sensors = []

sim = habitat.sims.make_sim("Sim-v0", config=cfg.habitat.simulator)

Expand Down
23 changes: 12 additions & 11 deletions habitat-lab/habitat/config/benchmark/nav/eqa_mp3d.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ habitat:
max_episode_steps: 500

simulator:
agent_0:
sim_sensors:
rgb_sensor:
width: 256
height: 256
depth_sensor:
width: 256
height: 256
semantic_sensor:
width: 256
height: 256
agents:
agent_0:
sim_sensors:
rgb_sensor:
width: 256
height: 256
depth_sensor:
width: 256
height: 256
semantic_sensor:
width: 256
height: 256
habitat_sim_v0:
gpu_device_id: 0
11 changes: 6 additions & 5 deletions habitat-lab/habitat/config/benchmark/nav/eqa_rgbonly_mp3d.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ habitat:
max_episode_steps: 500

simulator:
agent_0:
sim_sensors:
rgb_sensor:
width: 256
height: 256
agents:
agent_0:
sim_sensors:
rgb_sensor:
width: 256
height: 256
habitat_sim_v0:
gpu_device_id: 0
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ habitat:
environment:
max_episode_steps: 1000
simulator:
agent_0:
sim_sensors:
rgb_sensor:
width: 256
height: 256
depth_sensor:
width: 256
height: 256
agents:
agent_0:
sim_sensors:
rgb_sensor:
width: 256
height: 256
depth_sensor:
width: 256
height: 256
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@ habitat:
turn_angle: 30
tilt_angle: 30
action_space_config: v1
agent_0:
sim_sensors:
rgb_sensor:
width: 640
height: 480
hfov: 79
position: [0, 0.88, 0]
depth_sensor:
width: 640
height: 480
hfov: 79
min_depth: 0.5
max_depth: 5.0
position: [0, 0.88, 0]
height: 0.88
radius: 0.18
agents:
agent_0:
sim_sensors:
rgb_sensor:
width: 640
height: 480
hfov: 79
position: [0, 0.88, 0]
depth_sensor:
width: 640
height: 480
hfov: 79
min_depth: 0.5
max_depth: 5.0
position: [0, 0.88, 0]
height: 0.88
radius: 0.18
habitat_sim_v0:
gpu_device_id: 0
allow_sliding: False
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,23 @@
turn_angle: 30
tilt_angle: 30
action_space_config: "v1"
agent_0:
sim_sensors:
rgb_sensor:
width: 640
height: 480
hfov: 79
position: [0, 0.88, 0]
depth_sensor:
width: 640
height: 480
hfov: 79
min_depth: 0.5
max_depth: 5.0
position: [0, 0.88, 0]
height: 0.88
radius: 0.18
agents:
agent_0:
sim_sensors:
rgb_sensor:
width: 640
height: 480
hfov: 79
position: [0, 0.88, 0]
depth_sensor:
width: 640
height: 480
hfov: 79
min_depth: 0.5
max_depth: 5.0
position: [0, 0.88, 0]
height: 0.88
radius: 0.18
habitat_sim_v0:
gpu_device_id: 0
allow_sliding: False
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

habitat:
simulator:
agent_0:
sim_sensors:
semantic_sensor:
width: 640
height: 480
hfov: 79
position: [0, 0.88, 0]
agents:
agent_0:
sim_sensors:
semantic_sensor:
width: 640
height: 480
hfov: 79
position: [0, 0.88, 0]
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,23 @@
turn_angle: 30
tilt_angle: 30
action_space_config: "v1"
agent_0:
sim_sensors:
rgb_sensor:
width: 640
height: 480
hfov: 79
position: [0, 0.88, 0]
depth_sensor:
width: 640
height: 480
hfov: 79
min_depth: 0.5
max_depth: 5.0
position: [0, 0.88, 0]
height: 0.88
radius: 0.18
agents:
agent_0:
sim_sensors:
rgb_sensor:
width: 640
height: 480
hfov: 79
position: [0, 0.88, 0]
depth_sensor:
width: 640
height: 480
hfov: 79
min_depth: 0.5
max_depth: 5.0
position: [0, 0.88, 0]
height: 0.88
radius: 0.18
habitat_sim_v0:
gpu_device_id: 0
allow_sliding: False
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

habitat:
simulator:
agent_0:
sim_sensors:
semantic_sensor:
width: 640
height: 480
hfov: 79
position: [0, 0.88, 0]
agents:
agent_0:
sim_sensors:
semantic_sensor:
width: 640
height: 480
hfov: 79
position: [0, 0.88, 0]
Loading