-
Notifications
You must be signed in to change notification settings - Fork 427
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
Better Camera unproject #2001
Better Camera unproject #2001
Changes from all commits
f10aaed
21c90f4
7140c54
ce77520
70432ba
476261a
71c31b1
c3c66b0
fd23b2d
586072c
d455cd2
189a9f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
"default_agent": 0, | ||
"sensor_height": 1.5, | ||
"hfov": 90, | ||
"zfar": 1000.0, | ||
"color_sensor": True, | ||
"semantic_sensor": False, | ||
"depth_sensor": False, | ||
|
@@ -30,6 +31,7 @@ | |
"equirect_semantic_sensor": False, | ||
"seed": 1, | ||
"physics_config_file": "data/default.physics_config.json", | ||
"enable_physics": True, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are the consequences of enabling physics by default here? Do we want to do this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair point. This means any Simulator initialized from the default settings util will have access to Bullet API (if installed). Some justification:
We could add the breaking change tag to the PR and mention this in the description. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. I think we can proceed with it here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that it would be preferable to add this change to another PR for traceability. However, I don't feel strongly either way. |
||
} | ||
# [/default_sim_settings] | ||
|
||
|
@@ -79,6 +81,7 @@ def create_camera_spec(**kw_args): | |
color_sensor_spec = create_camera_spec( | ||
uuid="color_sensor", | ||
hfov=settings["hfov"], | ||
far=settings["zfar"], | ||
sensor_type=habitat_sim.SensorType.COLOR, | ||
sensor_subtype=habitat_sim.SensorSubType.PINHOLE, | ||
) | ||
|
@@ -88,6 +91,7 @@ def create_camera_spec(**kw_args): | |
depth_sensor_spec = create_camera_spec( | ||
uuid="depth_sensor", | ||
hfov=settings["hfov"], | ||
far=settings["zfar"], | ||
sensor_type=habitat_sim.SensorType.DEPTH, | ||
channels=1, | ||
sensor_subtype=habitat_sim.SensorSubType.PINHOLE, | ||
|
@@ -98,6 +102,7 @@ def create_camera_spec(**kw_args): | |
semantic_sensor_spec = create_camera_spec( | ||
uuid="semantic_sensor", | ||
hfov=settings["hfov"], | ||
far=settings["zfar"], | ||
sensor_type=habitat_sim.SensorType.SEMANTIC, | ||
channels=1, | ||
sensor_subtype=habitat_sim.SensorSubType.PINHOLE, | ||
|
@@ -107,6 +112,7 @@ def create_camera_spec(**kw_args): | |
if settings["ortho_rgba_sensor"]: | ||
ortho_rgba_sensor_spec = create_camera_spec( | ||
uuid="ortho_rgba_sensor", | ||
far=settings["zfar"], | ||
sensor_type=habitat_sim.SensorType.COLOR, | ||
sensor_subtype=habitat_sim.SensorSubType.ORTHOGRAPHIC, | ||
) | ||
|
@@ -115,6 +121,7 @@ def create_camera_spec(**kw_args): | |
if settings["ortho_depth_sensor"]: | ||
ortho_depth_sensor_spec = create_camera_spec( | ||
uuid="ortho_depth_sensor", | ||
far=settings["zfar"], | ||
sensor_type=habitat_sim.SensorType.DEPTH, | ||
channels=1, | ||
sensor_subtype=habitat_sim.SensorSubType.ORTHOGRAPHIC, | ||
|
@@ -124,6 +131,7 @@ def create_camera_spec(**kw_args): | |
if settings["ortho_semantic_sensor"]: | ||
ortho_semantic_sensor_spec = create_camera_spec( | ||
uuid="ortho_semantic_sensor", | ||
far=settings["zfar"], | ||
sensor_type=habitat_sim.SensorType.SEMANTIC, | ||
channels=1, | ||
sensor_subtype=habitat_sim.SensorSubType.ORTHOGRAPHIC, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Again ignore if this utility isn't meant to be used in performance-sensitive scenarios.)
A better way would be to have this split into two functions, one
unproject()
that doesn't normalize, and anunprojectNormalized()
that callsunproject()
, normalizes its result and returns it. That way there's no branch. (Though that way it'll be a breaking change, becauseunproject()
will not normalize anymore, so you might want to invent different naming of the two overloads.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, thanks. I thought about this also, but didn't want a breaking change or to add more bulk to the API. I think this one can stay for now.