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

DebugVisualizer generic 'peek' function #1834

Merged
merged 3 commits into from
Mar 9, 2024
Merged

Conversation

aclegg3
Copy link
Contributor

@aclegg3 aclegg3 commented Mar 6, 2024

Motivation and Context

Breaking Change: removed functions from DebugVisualizer

  • peek_rigid_object
  • peek_articulated_object
  • peek_scene

This PR removes the previous type specific "peek_*" functions in favor of a single new generic "peek" function taking all reasonable inputs to describe the subject of the peek.

This function will take ManagedObject, integer object id, or string object instance handle.
For example, given a rigid or articulated object my_object, the following are all valid:

  • dbv.peek(my_object)
  • dbv.peek(my_object.object_id)
  • dbv.peek(my_object.handle)

This function will also accept string aliases "scene" and "stage" to set the subject as the full contents of the current scene:

  • dbv.peek("stage")
  • dbv.peek("scene")

Finally, the peek now returns a single DebugObservation, so both auto-saving feature and show variable are removed in favor of the standard interface of DebugObservation.show() and DebugObservation.save(directory_path).

How Has This Been Tested

Down-stream code refactored to use new interface.
Locally with all variations in a testing environment.

Types of changes

  • [Development] A pull request that add new features to the habitat-lab task and environment codebase. Development Pull Requests must be small (less that 500 lines of code change), have unit testing, very extensive documentation and examples. These are typically new tasks, environments, sensors, etc... The review process for these Pull Request is longer because these changes will be maintained by our core team of developers, so make sure your changes are easy to understand!

Checklist

  • My code follows the code style of this project.
  • I have updated the documentation if required.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes if required.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 6, 2024
Copy link
Contributor

@0mdc 0mdc left a comment

Choose a reason for hiding this comment

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

LGTM! Left some minor comments.

)
subject = subject_obj

if subject_bb is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: This could be a calculate_subject_bounding_box() method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: I'll refactor this later. I'm adding such a function in another PR.

@aclegg3 aclegg3 merged commit 1ec8590 into main Mar 9, 2024
1 of 3 checks passed
@aclegg3 aclegg3 deleted the alex-03_05-dbv_generic_peek branch March 9, 2024 00:15
dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jul 8, 2024
* replace specific peek functions with generic interface and remove auto-save in favor of DebugObservation interface
HHYHRHY pushed a commit to SgtVincent/habitat-lab that referenced this pull request Aug 31, 2024
* replace specific peek functions with generic interface and remove auto-save in favor of DebugObservation interface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants