Skip to content

sleeping#1369

Merged
thowell merged 1 commit into
google-deepmind:mainfrom
thowell:sleep
Jun 3, 2026
Merged

sleeping#1369
thowell merged 1 commit into
google-deepmind:mainfrom
thowell:sleep

Conversation

@thowell

@thowell thowell commented May 20, 2026

Copy link
Copy Markdown
Collaborator

initial implementation of sleeping for constraint islands and the collision driver

based on #1303


mjwarp-viewer ../mujoco/model/sleep/dominos.xml \
--nconmax=512 \
--njmax=2048 \
--islands_experimental_override \
-o "opt.enableflags=sleep" \
-o "opt.disableflags=nativeccd" 

*note: needed to use the primitive box<>box collider otherwise the blocks don't achieve the sleep tolerance

dominos.mp4

@thowell thowell linked an issue May 20, 2026 that may be closed by this pull request
@thowell thowell force-pushed the sleep branch 2 times, most recently from 7e6c637 to 0ef12a4 Compare May 21, 2026 16:17
@thowell thowell marked this pull request as ready for review May 21, 2026 16:19
@thowell thowell force-pushed the sleep branch 2 times, most recently from 3d2d8fe to 7aa50dd Compare May 22, 2026 13:06
@thowell thowell requested review from erikfrey and yuvaltassa May 22, 2026 13:21
@thowell thowell force-pushed the sleep branch 4 times, most recently from 69349a9 to 5910736 Compare May 28, 2026 15:29

@yuvaltassa yuvaltassa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Consider adding a test which is equivalent to SleepingUnaffectedByWaking which I expect would have caught the one major bug I seem to have detected (if it indeed is a bug, maybe I misunderstood)

Also consider adding a multi-world sleeping test that has nworld > 1 with different sleep states in each world.

Comment thread mujoco_warp/_src/sleep.py
Comment thread mujoco_warp/_src/sleep.py
Comment thread mujoco_warp/_src/sleep.py Outdated
Comment thread mujoco_warp/_src/io.py Outdated
Comment thread mujoco_warp/_src/forward.py Outdated
Comment thread mujoco_warp/_src/sleep.py
@thowell thowell force-pushed the sleep branch 2 times, most recently from 0010516 to 47addd7 Compare June 3, 2026 09:35
@thowell

thowell commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author

hadn't pushed all of the changes -- files should be updated now

@yuvaltassa yuvaltassa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, feel free to ack and merge, but two tests that I think might be valuable:

  1. No SleepPolicy.AUTO_NEVER test: The code handles this but there's no test verifying a tree with this policy (eg a tree with actuators) never sleeps.
  2. No multi-world test: Given the global contact indexing, a multi-world sleep test might be valuable.

@thowell

thowell commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author
  • added a test with an actuator to check AUTO_NEVER prevents a tree with an actuator from sleeping
  • parameterized tests in sleep_test.py to test nworld=1 and nworld=2

@thowell thowell merged commit 2e1a7e2 into google-deepmind:main Jun 3, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sleeping islands

2 participants