Skip to content

Refactor to support expanded Simulator reset in RearrangeTask - #2018

Merged
aclegg3 merged 2 commits into
mainfrom
alex-08_20-expanded_reset_migration_rearrange
Aug 21, 2024
Merged

Refactor to support expanded Simulator reset in RearrangeTask#2018
aclegg3 merged 2 commits into
mainfrom
alex-08_20-expanded_reset_migration_rearrange

Conversation

@aclegg3

@aclegg3 aclegg3 commented Aug 20, 2024

Copy link
Copy Markdown
Contributor

Motivation and Context

This PR aims to refactor RearrangeTask to support the expanded reset functionality from facebookresearch/habitat-sim#2451
Primary change: apply auto-sleep and handle articulated_agent base setting after expanded state reset

Context: previously the Simulator.reset() only set time to 0, so RearrangeTask code was able to leave the robot in place between reset and objects would stay sleeping (e.g. for benchmarking or idle scenarios). Now the objects are set to origin or scene_instance initial state and the reset logic must also handle initial state resetting and re-sleeping (since objects wake when moved).

How Has This Been Tested

Previously the hab2_benchmark test was failing due to regression because the robot was resetting to the origin inside a furniture and objects were awoken on initial reset.

I expect to see the CI pass to validate the change.

Types of changes

  • [Refactoring] Large changes to the code that improve its functionality or performance

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 Aug 20, 2024

@0mdc 0mdc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

self._is_episode_active = True

if self._should_place_articulated_agent:
# here we are randomizing the base pos and rotation if necessary

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That config field name is ambiguous. It may be worth the trouble renaming (not in this PR).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this part of the code is ripe for refactor

for agent_idx in range(self._sim.num_articulated_agents):
self._set_articulated_agent_start(agent_idx)
# here we are setting initial joint states and such from configs, if a configured fixed base start state was provided, it is set
self._sim.agents_mgr.post_obj_load_reconfigure()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same with this method name.

@aclegg3
aclegg3 merged commit 4a23445 into main Aug 21, 2024
@aclegg3
aclegg3 deleted the alex-08_20-expanded_reset_migration_rearrange branch August 21, 2024 20:00
joannetruong pushed a commit that referenced this pull request Mar 12, 2025
* refactor to apply auto-sleep and handle articulated_agent base setting after expanded state reset

* add setting episode initial states for objects to rearrange_sim.reset
Zeying-Gong pushed a commit to Zeying-Gong/Falcon that referenced this pull request Mar 31, 2025
…okresearch#2018)

* refactor to apply auto-sleep and handle articulated_agent base setting after expanded state reset

* add setting episode initial states for objects to rearrange_sim.reset
Aawangas pushed a commit to Supramundaner/habitat-labForReasonNavi that referenced this pull request Aug 14, 2025
…okresearch#2018)

* refactor to apply auto-sleep and handle articulated_agent base setting after expanded state reset

* add setting episode initial states for objects to rearrange_sim.reset
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