importhabitat_simimportrandom%matplotlibinlineimportmatplotlib.pyplotaspltimportnumpyasnptest_scene="../data/scene_datasets/mp3d/17DRP5sb8fy/17DRP5sb8fy.glb"sim_settings={"width":256,# Spatial resolution of the observations"height":256,"scene":test_scene,# Scene path"default_agent":0,"sensor_height":1.5,# Height of sensors in meters"color_sensor":True,# RGB sensor"semantic_sensor":True,# Semantic sensor"depth_sensor":True,# Depth sensor"seed":1,}
defmake_cfg(settings):sim_cfg=habitat_sim.SimulatorConfiguration()sim_cfg.gpu_device_id=0sim_cfg.scene_id=settings["scene"]# Note: all sensors must have the same resolutionsensor_specs=[]color_sensor_spec=habitat_sim.CameraSensorSpec()color_sensor_spec.uuid="color_sensor"color_sensor_spec.sensor_type=habitat_sim.SensorType.COLORcolor_sensor_spec.resolution=[settings["height"],settings["width"]]color_sensor_spec.position=[0.0,settings["sensor_height"],0.0]color_sensor_spec.sensor_subtype=habitat_sim.SensorSubType.PINHOLEsensor_specs.append(color_sensor_spec)depth_sensor_spec=habitat_sim.CameraSensorSpec()depth_sensor_spec.uuid="depth_sensor"depth_sensor_spec.sensor_type=habitat_sim.SensorType.DEPTHdepth_sensor_spec.resolution=[settings["height"],settings["width"]]depth_sensor_spec.position=[0.0,settings["sensor_height"],0.0]depth_sensor_spec.sensor_subtype=habitat_sim.SensorSubType.PINHOLEsensor_specs.append(depth_sensor_spec)semantic_sensor_spec=habitat_sim.CameraSensorSpec()semantic_sensor_spec.uuid="semantic_sensor"semantic_sensor_spec.sensor_type=habitat_sim.SensorType.SEMANTICsemantic_sensor_spec.resolution=[settings["height"],settings["width"]]semantic_sensor_spec.position=[0.0,settings["sensor_height"],0.0]semantic_sensor_spec.sensor_subtype=habitat_sim.SensorSubType.PINHOLEsensor_specs.append(semantic_sensor_spec)# Here you can specify the amount of displacement in a forward action and the turn angleagent_cfg=habitat_sim.agent.AgentConfiguration()agent_cfg.sensor_specifications=sensor_specsagent_cfg.action_space={"move_forward":habitat_sim.agent.ActionSpec("move_forward",habitat_sim.agent.ActuationSpec(amount=0.25)),"turn_left":habitat_sim.agent.ActionSpec("turn_left",habitat_sim.agent.ActuationSpec(amount=30.0)),"turn_right":habitat_sim.agent.ActionSpec("turn_right",habitat_sim.agent.ActuationSpec(amount=30.0)),}returnhabitat_sim.Configuration(sim_cfg,[agent_cfg])cfg=make_cfg(sim_settings)sim=habitat_sim.Simulator(cfg)
Search for modules, classes, functions and other
symbols. You can omit any prefix from the symbol path; adding a .
suffix lists all members of given symbol.
Use ↓
/ ↑ to navigate through the list,
Enter to go.
Tab autocompletes common prefix, you can
copy a link to the result using ⌘L while ⌘M produces a Markdown link.